mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 22:49:26 +08:00
fix: api base url
This commit is contained in:
parent
0cb7820f6f
commit
3b6e7929b6
@ -12,16 +12,11 @@ export const SigninPage = (props: { authenticator: Authenticator }) => {
|
|||||||
const params = new URLSearchParams(location.search);
|
const params = new URLSearchParams(location.search);
|
||||||
const redirect = params.get('redirect');
|
const redirect = params.get('redirect');
|
||||||
const app = useApp();
|
const app = useApp();
|
||||||
|
const apiBaseURL = app.getOptions().apiClient?.['baseURL'];
|
||||||
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(
|
||||||
`${prefix}/api/cas:login?authenticator=${authenticator.name}&__appName=${appName}&redirect=${redirect}`,
|
`${apiBaseURL}cas:login?authenticator=${authenticator.name}&__appName=${appName}&redirect=${redirect}`,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user