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.
|
|
|
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) => {
|
|
|
|
let token = localStorage.getItem('MSSM-LIAONING__TOKEN')
|
|
|
|
if (token) {
|
|
|
|
next()
|
|
|
|
} else {
|
|
|
|
this.$alert("暂无token",'提示', {
|
|
|
|
confirmButtonText: "返回",
|
|
|
|
callback: (action) => {
|
|
|
|
this.$router.go(-1);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
router.afterEach(() => {
|
|
|
|
NProgress.done();
|
|
|
|
});
|