mirror of
https://github.com/ZeroCatDev/ClassworksKVAdmin.git
synced 2025-12-07 18:13:09 +00:00
fix: 更新设备状态显示逻辑,修复未绑定设备的状态显示;增强权限错误处理,针对 JWT 过期的 403 错误进行特殊处理
This commit is contained in:
parent
d9d62e8f8c
commit
008d93e76c
@ -202,8 +202,8 @@ onMounted(() => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-1 ml-auto">
|
<div class="flex items-center gap-1 ml-auto">
|
||||||
<Badge v-if="currentDevice.isOwned" variant="secondary" class="h-4 px-1 text-[10px]">
|
<Badge v-if="!currentDevice.isOwned" variant="secondary" class="h-4 px-1 text-[10px]">
|
||||||
已绑定
|
未绑定
|
||||||
</Badge>
|
</Badge>
|
||||||
<ChevronDown
|
<ChevronDown
|
||||||
class="h-3 w-3 text-muted-foreground flex-shrink-0 transition-transform duration-200"
|
class="h-3 w-3 text-muted-foreground flex-shrink-0 transition-transform duration-200"
|
||||||
|
|||||||
@ -189,7 +189,7 @@ axiosInstance.interceptors.response.use(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 明确的权限问题同样触发登出(例如服务端使用 403 表示 Token 无效或权限已失效)
|
// 明确的权限问题同样触发登出(例如服务端使用 403 表示 Token 无效或权限已失效)
|
||||||
if (status === 403) {
|
if (status === 403&& resp?.data?.code === 'AUTH_JWT_EXPIRED') {
|
||||||
try { authHandlers?.onAuthFailure && authHandlers.onAuthFailure(new Error(message || 'FORBIDDEN')) } catch {}
|
try { authHandlers?.onAuthFailure && authHandlers.onAuthFailure(new Error(message || 'FORBIDDEN')) } catch {}
|
||||||
return Promise.reject(new Error(message || 'FORBIDDEN'))
|
return Promise.reject(new Error(message || 'FORBIDDEN'))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user