fix: 更新设备状态显示逻辑,修复未绑定设备的状态显示;增强权限错误处理,针对 JWT 过期的 403 错误进行特殊处理

This commit is contained in:
Sunwuyuan 2025-11-16 16:15:27 +08:00
parent d9d62e8f8c
commit 008d93e76c
No known key found for this signature in database
GPG Key ID: A6A54CF66F56BB64
2 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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'))
} }