|
@@ -44,18 +44,18 @@ axios.interceptors.request.use(async (config) => {
|
|
|
return config;
|
|
|
}
|
|
|
|
|
|
+ const { token, userId } = getAuth();
|
|
|
+ config.headers.token = token;
|
|
|
+ config.headers.userid = userId;
|
|
|
+
|
|
|
const hasIgnore = config.params ? "ingoreRes" in config.params : false;
|
|
|
if (!hasIgnore) {
|
|
|
- const { token, userId } = getAuth();
|
|
|
if (!token && !~notLoginUrls.indexOf(config.url)) {
|
|
|
router.replace({ name: RouteName.login });
|
|
|
throw "用户未登录";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- config.headers.token = token;
|
|
|
- config.headers.userid = userId;
|
|
|
-
|
|
|
if (~GetUrls.indexOf(config.url)) {
|
|
|
config.method = "GET";
|
|
|
} else if (~PostUrls.indexOf(config.url)) {
|