第 5 阶段:纠纷、通知与后台-2

This commit is contained in:
yml
2026-05-22 16:50:33 +08:00
parent 99f9df7bcd
commit aee3455e9a
22 changed files with 519 additions and 36 deletions
+3 -1
View File
@@ -6,7 +6,9 @@ export const apiClient = axios.create({
})
apiClient.interceptors.request.use((config) => {
const token = localStorage.getItem('access_token')
const url = config.url || ''
const tokenKey = url.startsWith('/admin') ? 'admin_access_token' : 'access_token'
const token = localStorage.getItem(tokenKey)
if (token) {
config.headers.Authorization = `Bearer ${token}`
}