mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-09 23:49:27 +08:00
fix(auth): cas login bug when use subdirectory deployment (#4017)
Co-authored-by: ChimingLiu <chinmingcock@gmail.com>
This commit is contained in:
parent
fa815aeb3c
commit
0cb7820f6f
@ -13,10 +13,15 @@ export const SigninPage = (props: { authenticator: Authenticator }) => {
|
|||||||
const redirect = params.get('redirect');
|
const redirect = params.get('redirect');
|
||||||
const app = useApp();
|
const app = useApp();
|
||||||
|
|
||||||
|
let prefix = process.env.APP_PUBLIC_PATH || '';
|
||||||
|
if (prefix.endsWith('/')) {
|
||||||
|
prefix = prefix.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
const appName = getSubAppName(app.getPublicPath()) || 'main';
|
const appName = getSubAppName(app.getPublicPath()) || 'main';
|
||||||
const login = async () => {
|
const login = async () => {
|
||||||
window.location.replace(
|
window.location.replace(
|
||||||
`/api/cas:login?authenticator=${authenticator.name}&__appName=${appName}&redirect=${redirect}`,
|
`${prefix}/api/cas:login?authenticator=${authenticator.name}&__appName=${appName}&redirect=${redirect}`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user