fix: id兼容, 通知入口
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m0s

This commit is contained in:
luo
2026-07-28 15:19:29 +08:00
parent 0e8a11430a
commit 261f5f2853
21 changed files with 271 additions and 71 deletions

View File

@@ -4,6 +4,7 @@ import { useUserStore } from '@/store/modules/user'
import { ApiStatus } from './status'
import type { RequestOptions, ErrorMessageMode } from '@/types/api'
import { normalizeApiError } from '@/utils/business/apiError'
import { syncCompatibleIdFields } from '@/utils/business/id'
const axiosInstance = axios.create({
timeout: 15000, // 请求超时时间(毫秒)
@@ -90,6 +91,9 @@ const processQueue = (error: any, token: string | null = null) => {
// 响应拦截器
axiosInstance.interceptors.response.use(
(response: AxiosResponse) => {
// 兼容历史接口返回的 ID 与新接口返回的 id。
syncCompatibleIdFields(response.data)
// 401 未授权 - 尝试刷新 token
if (response.data.code === ApiStatus.unauthorized) {
const userStore = useUserStore()