feat: rbac接入完成,file接入完成
This commit is contained in:
+2
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user