parent
dfce24e466
commit
440189d305
@ -0,0 +1,17 @@
|
||||
import Vue from "vue";
|
||||
import { TOKEN_KEY } from "@/constants";
|
||||
|
||||
const injectOptions = {
|
||||
// 是否需要登录拦截
|
||||
$isLoginValidate() {
|
||||
if (this.$cookies.get(TOKEN_KEY)) {
|
||||
return true;
|
||||
}
|
||||
this.$store.commit("setLoginVisible", true);
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
for (let key in injectOptions) {
|
||||
Vue.prototype[key] = injectOptions[key];
|
||||
}
|
Loading…
Reference in new issue