diff --git a/src/store/account.ts b/src/store/account.ts index eaa465bffcbbe808c64a47db22f585e7f64d1973..3d05370f70ab11b915cb082c0492a12cd68565ab 100644 --- a/src/store/account.ts +++ b/src/store/account.ts @@ -53,6 +53,10 @@ export const useAccountStore = defineStore('account', () => { async function getAuthUrl(action: string) { const [_, res] = await api.queryAuthUrl(action); if (!_ && res) { + // 检查业务状态码,如果是400则返回特殊标识 + if (res.code === 400) { + return 'NO_USER_HOMEPAGE'; + } return res.result.url; } return null; diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index e82f2650f8f430bf195e35fb4a80c3b4d10ec060..632385e3ba82710b142e39f6a24fb9151520827a 100644 --- a/src/views/dialogue/components/TitleBar.vue +++ b/src/views/dialogue/components/TitleBar.vue @@ -85,7 +85,13 @@ const logoutHandler = () => { // 处理用户信息区域点击 const handleUserInfoClick = async () => { const store = useAccountStore(); - const authUrl = await store.getAuthUrl('authenticated'); + const authUrl = await store.getAuthUrl('settings'); + + // 如果返回特殊标识,说明当前鉴权服务暂无用户主页,跳过弹窗逻辑 + if (authUrl === 'NO_USER_HOMEPAGE') { + return; + } + if (authUrl) { const w = 1000; const h = 750;