Skip to content

Commit

Permalink
feat(front): 静态地址不同源,修改静态地址
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 9953
  • Loading branch information
hyunfa authored and wyyalt committed Jun 18, 2024
1 parent 4fd203b commit 1a0ae36
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions web/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,13 @@ function handleReject(error, config) {
// 未登录, o.a 登录弹窗有问题先不做弹窗
let siteLoginUrl = window.PROJECT_CONFIG.LOGIN_URL;
// 设置login_success.html文件路径
let successBaseUrl = '';
if (NODE_ENV === 'development') {
successBaseUrl = window.location.origin;
} else {
successBaseUrl = window.PROJECT_CONFIG.BK_STATIC_URL;
let successBaseUrl = window.PROJECT_CONFIG.BK_STATIC_URL;
const index = successBaseUrl.indexOf('static');
if (index > -1) {
successBaseUrl = '/' + successBaseUrl.slice(index);
}
// 登录成功之后的回调地址,用于执行关闭登录窗口或刷新父窗口页面等动作
const successUrl =`${successBaseUrl}/login_success.html`;
const successUrl =`${window.location.origin}${successBaseUrl}/login_success.html`;
if (!siteLoginUrl) {
console.error('Login URL not configured!')
return
Expand Down

0 comments on commit 1a0ae36

Please sign in to comment.