修复request.js的bug
This commit is contained in:
parent
934252e2d1
commit
b8274529c2
|
@ -1,3 +1,4 @@
|
|||
import $store from "@/store/index";
|
||||
import Vue from "vue"
|
||||
let prototype = Vue.prototype;
|
||||
|
||||
|
@ -24,14 +25,14 @@ const request = async (args) => {
|
|||
throw "找不到API:" + args.api;
|
||||
}
|
||||
|
||||
if (rule.auth && !prototype.$store.state.user.token) {
|
||||
prototype.$store.commit("user/showLoginModal", true);
|
||||
if (rule.auth && !$store.state.user.token) {
|
||||
$store.commit("user/showLoginModal", true);
|
||||
return;
|
||||
}
|
||||
|
||||
const headers = {
|
||||
"XX-Wxapp-AppId": prototype.$config.appId,
|
||||
'XX-Token': prototype.$store.state.user.token,
|
||||
'XX-Token': $store.state.user.token,
|
||||
'XX-Device-Type': 'wxapp',
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue