fix: 无权使用页和管理员登录入口先退出平台当前账号,不再被直接送回
This commit is contained in:
@@ -12,6 +12,8 @@ export function appUrl(path: string) {
|
||||
|
||||
export const platformHome = "/";
|
||||
|
||||
export function platformLoginUrl(target = basePath) {
|
||||
return `/login?redirect=${encodeURIComponent(target)}`;
|
||||
/** switchAccount 让平台先退出当前账号再显示登录表单,否则已登录的平台账号会被直接送回来。 */
|
||||
export function platformLoginUrl(target = basePath, switchAccount = false) {
|
||||
const url = `/login?redirect=${encodeURIComponent(target)}`;
|
||||
return switchAccount ? `${url}&switch=1` : url;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export function justBounced() {
|
||||
return at > 0 && Date.now() - at < BOUNCE_MS;
|
||||
}
|
||||
|
||||
export function goPlatformLogin(target = basePath) {
|
||||
export function goPlatformLogin(target = basePath, switchAccount = false) {
|
||||
sessionStorage.setItem(BOUNCE_KEY, String(Date.now()));
|
||||
window.location.assign(platformLoginUrl(target));
|
||||
window.location.assign(platformLoginUrl(target, switchAccount));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user