|
|
|
@ -5,6 +5,7 @@ import NProgress from "nprogress";
|
|
|
|
|
import "nprogress/nprogress.css";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
|
|
|
|
import { isRelogin } from "@/utils/request";
|
|
|
|
|
import { getLeaddata } from "@/utils/myFuntion";
|
|
|
|
|
|
|
|
|
|
NProgress.configure({ showSpinner: false });
|
|
|
|
|
|
|
|
|
@ -14,7 +15,7 @@ router.beforeEach((to, from, next) => {
|
|
|
|
|
NProgress.start();
|
|
|
|
|
if (to.path == "/xiaoqu" && to.query.isLeader && !getToken()) {
|
|
|
|
|
store
|
|
|
|
|
.dispatch("login2", { username: "领导", password: "Loudong@2022***" })
|
|
|
|
|
.dispatch("login2", getLeaddata())
|
|
|
|
|
.then((res) => {
|
|
|
|
|
handelRouter(to, from, next);
|
|
|
|
|
})
|
|
|
|
@ -24,7 +25,6 @@ router.beforeEach((to, from, next) => {
|
|
|
|
|
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
handelRouter(to, from, next);
|
|
|
|
|