|
|
@@ -5,7 +5,10 @@ const ServerUrl = '/casdoor'
|
|
|
const ClientId = 'f7059ed03570512cc79c'
|
|
|
const AppName = 'app-franklinwh-toolbox'
|
|
|
const OrganizationName = 'organization_franklinwh_toolbox'
|
|
|
-const RedirectPath = '/fwh-toolbox/casdoor/callback'
|
|
|
+// 从环境变量读取公共基础路径(生产 /fwh-toolbox/,测试 /fwh-toolbox-test/)
|
|
|
+// 去掉末尾多余的斜杠后再拼接回调路径,避免出现双斜杠
|
|
|
+const PublicPath = import.meta.env.VITE_PUBLIC_PATH.replace(/\/+$/, '')
|
|
|
+const RedirectPath = `${PublicPath}/casdoor/callback`
|
|
|
|
|
|
export function setupCasdoor(app: App) {
|
|
|
app.use(casdoor.default, {
|