token修改
This commit is contained in:
parent
1063d79d50
commit
ce49dfe013
@ -28,7 +28,7 @@ export const request: RequestConfig = {
|
||||
const token = localStorage.getItem('authToken'); // 从某处获取你的认证token,例如localStorage
|
||||
if (token) {
|
||||
const headers = {
|
||||
Authorization: `Bearer ${token}`,
|
||||
Authorization: `${token}`,
|
||||
...options.headers,
|
||||
};
|
||||
return {
|
||||
|
@ -10,7 +10,7 @@ const http = axios.create({
|
||||
// 请求拦截注入token
|
||||
const token = getToken()
|
||||
if (token) {
|
||||
config.headers.Authorization = `Bearer ${token}`
|
||||
config.headers.Authorization = `${token}`
|
||||
}
|
||||
|
||||
return config
|
||||
|
Loading…
Reference in New Issue
Block a user