Fixed the issue that SSO could not jump when debugging the front-end and backend separation locally (#3658)
修复sso在本地调试前后端分离时无法跳转
diff --git a/streampark-console/streampark-console-webapp/.env.development b/streampark-console/streampark-console-webapp/.env.development
index 2221217..ea2a9e8 100644
--- a/streampark-console/streampark-console-webapp/.env.development
+++ b/streampark-console/streampark-console-webapp/.env.development
@@ -20,6 +20,8 @@
# Please note that no line breaks
VITE_PROXY=[["/basic-api","http://localhost:10000"]]
+VITE_BASE_ADDRESS=http://localhost:10000
+
# Delete console
VITE_DROP_CONSOLE=false
diff --git a/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue b/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
index a2cd069..ca3bc11 100644
--- a/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
+++ b/streampark-console/streampark-console-webapp/src/views/base/login/LoginForm.vue
@@ -68,7 +68,7 @@
</FormItem>
<FormItem class="enter-x text-left">
- <Button :href="SSO_LOGIN_PATH" type="link" v-if="enableSSO">
+ <Button :href="BASE_ADDRESS+SSO_LOGIN_PATH" type="link" v-if="enableSSO">
{{ t('sys.login.ssoSignIn') }}
</Button>
<Button type="link" class="float-right" @click="changeLoginType" v-if="enableLDAP">
@@ -117,6 +117,7 @@
account: string;
password: string;
}
+ const BASE_ADDRESS= import.meta.env.VITE_BASE_ADDRESS;
const formRef = ref();
const loading = ref(false);
const userId = ref('');
diff --git a/streampark-console/streampark-console-webapp/types/global.d.ts b/streampark-console/streampark-console-webapp/types/global.d.ts
index 049ef55..045faf6 100644
--- a/streampark-console/streampark-console-webapp/types/global.d.ts
+++ b/streampark-console/streampark-console-webapp/types/global.d.ts
@@ -62,6 +62,7 @@
VITE_USE_PWA: boolean;
VITE_PUBLIC_PATH: string;
VITE_PROXY: [string, string][];
+ VITE_BASE_ADDRESS : string;
VITE_GLOB_APP_TITLE: string;
VITE_GLOB_APP_SHORT_NAME: string;
VITE_USE_CDN: boolean;