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.
LiaoningYaopinIframe/src/permission.js

31 lines
788 B

2 years ago
import router from "./router";
import store from "./store";
import { Message } from "element-ui";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
import { isRelogin } from "@/utils/request";
import API from "@/api/index.js";
import Cookies from "js-cookie";
import axios from "axios";
NProgress.configure({ showSpinner: false });
const whiteList = ["/login", "/register"];
router.beforeEach(async (to, from, next) => {
2 years ago
let token = localStorage.getItem('MSSM-LIAONING__TOKEN')
if (token) {
next()
2 years ago
} else {
2 years ago
this.$alert("暂无token",'提示', {
confirmButtonText: "返回",
callback: (action) => {
this.$router.go(-1);
},
2 years ago
});
}
2 years ago
})
2 years ago
router.afterEach(() => {
NProgress.done();
});