fix(auth): normalize external accessToken and preserve on empty yUser login
This commit is contained in:
1 parent
44d7304f8e
commit
1847eb9d6a
5 files changed
+53
-20
No files matched your search
@@ -1,6 +1,7 @@
|
||||
/** Strategy 模块外部 iframe / 嵌入页链接(来自 Vite 环境变量) */
|
||||
|
||||
import { authStorageGet } from "@/core/auth/scoped-storage";
|
||||
import { normalizeExternalAccessToken } from "@/core/auth/external-access-token";
|
||||
|
||||
function trimTrailingSlash(url: string): string {
|
||||
return url.replace(/\/+$/, "");
|
||||
@@ -43,8 +44,7 @@ function readUserInfo(): Record<string, unknown> {
|
||||
|
||||
/** 当前登录态 accessToken(无则空串)。 */
|
||||
export function getAccessToken(): string {
|
||||
const value = readUserInfo().accessToken;
|
||||
return value == null ? "" : String(value);
|
||||
return normalizeExternalAccessToken(readUserInfo().accessToken);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user