You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
361 B
18 lines
361 B
3 years ago
|
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];
|
||
|
}
|