mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-15 07:03:48 +08:00
v3.14.0 更新;【新增】EasyExcel重磅升级为FastExcel;【新增】使用最强Argon2算法作为密码存储;【新增】大家吐槽的数据字典改为可重复;【新增】前端布局再增加多种样式;【优化】升级SaToken到最新版本;【优化】token使用Sa-Token的Bearer类型;【优化】优化其他
This commit is contained in:
@@ -17,7 +17,7 @@ import _ from 'lodash';
|
||||
import LocalStorageKeyConst from '/@/constants/local-storage-key-const.js';
|
||||
|
||||
// token的消息头
|
||||
const TOKEN_HEADER = 'x-access-token';
|
||||
const TOKEN_HEADER = 'Authorization';
|
||||
|
||||
// 创建axios对象
|
||||
const smartAxios = axios.create({
|
||||
@@ -37,7 +37,7 @@ smartAxios.interceptors.request.use(
|
||||
// 在发送请求之前消息头加入token token
|
||||
const token = localRead(LocalStorageKeyConst.USER_TOKEN);
|
||||
if (token) {
|
||||
config.headers[TOKEN_HEADER] = token;
|
||||
config.headers[TOKEN_HEADER] = 'Bearer ' + token;
|
||||
} else {
|
||||
delete config.headers[TOKEN_HEADER];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user