feat:完成权限相关、全局配置、优化细节

This commit is contained in:
橙子
2023-03-26 16:22:49 +08:00
parent b6f4cbfb4f
commit e5460ae3cc
55 changed files with 386 additions and 51 deletions

View File

@@ -20,11 +20,15 @@ const myaxios = axios.create({
// }
// }],
})
// 请求拦截器
myaxios.interceptors.request.use(function (config) {
if (getToken()) {
config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
return config;
}, function (error) {
return Promise.reject(error);