fix: 请求地址,localStorage(key)优化
This commit is contained in:
@@ -2,7 +2,7 @@ import axios from 'axios'
|
||||
import { storageKey } from '@/utils/constants'
|
||||
|
||||
axios.interceptors.request.use(config => {
|
||||
const token = localStorage.getItem('cn-token')
|
||||
const token = localStorage.getItem(storageKey.token)
|
||||
if (token) {
|
||||
config.headers.Authorization = token // 请求头token
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user