feat: rbac接入完成,file接入完成

This commit is contained in:
Blizzard
2026-05-01 12:57:26 +08:00
parent e3e38800aa
commit 8ca5aa3148
10 changed files with 491 additions and 30 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ const AUTH_WHITELIST = ['/auth/captcha', '/auth/login']
const request = axios.create({
baseURL: API_BASE_URL,
timeout: 30000,
headers: { 'Content-Type': 'application/json' },
// Let Axios automatically set Content-Type based on payload type
})
request.interceptors.request.use(
@@ -18,9 +18,7 @@ request.interceptors.request.use(
const token = localStorage.getItem('token')
if (token) config.headers.Authorization = `Bearer ${token}`
}
if (config.data instanceof FormData) {
config.headers.delete('Content-Type')
}
// Remove any custom handling, Axios natively handles FormData correctly without global Content-Type
return config
},
(error: AxiosError) => Promise.reject(error)