|
|
@ -2,7 +2,7 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-05-04 17:11:07
|
|
|
|
* @Date: 2022-05-04 17:11:07
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-06-29 11:16:31
|
|
|
|
* @LastEditTime: 2022-06-29 16:01:55
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
import { CreateUUID } from "@/plugins/utils";
|
|
|
|
import { CreateUUID } from "@/plugins/utils";
|
|
|
@ -23,14 +23,12 @@ export default function ({$axios, store, route, req}, inject) {
|
|
|
|
$axiosTk.defaults.timeout = 3000;
|
|
|
|
$axiosTk.defaults.timeout = 3000;
|
|
|
|
$axiosTk.onRequest( config =>{
|
|
|
|
$axiosTk.onRequest( config =>{
|
|
|
|
config.headers.uid = uuid;
|
|
|
|
config.headers.uid = uuid;
|
|
|
|
if (config.headers.notVerifyToken) {
|
|
|
|
if(!store.state.token && !config.headers.notVerifyToken){
|
|
|
|
if(!store.state.token){
|
|
|
|
|
|
|
|
location.href = '/';
|
|
|
|
location.href = '/';
|
|
|
|
return Promise.reject({message : '要先登录才能操作哦~'});
|
|
|
|
return Promise.reject({message : '要先登录才能操作哦~'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete config.headers.notVerifyToken;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
delete config.headers.notVerifyToken;
|
|
|
|
config.headers.Authorization = store.state.token;
|
|
|
|
config.headers.Authorization = store.state.token;
|
|
|
|
return config;
|
|
|
|
return config;
|
|
|
|
});
|
|
|
|
});
|
|
|
|