|
@@ -70,10 +70,13 @@ let router = new Router({
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
const loginPath = "/login/" + localStorage.getItem("domain");
|
|
const loginPath = "/login/" + localStorage.getItem("domain");
|
|
- if (to.path === loginPath) {
|
|
|
|
|
|
+ if (to.path.match(/^\/login\/.+$/)) {
|
|
next();
|
|
next();
|
|
} else {
|
|
} else {
|
|
if (!window.localStorage.getItem("token")) {
|
|
if (!window.localStorage.getItem("token")) {
|
|
|
|
+ if (!localStorage.getItem("domain")) {
|
|
|
|
+ alert("地址出错,找不到机构!");
|
|
|
|
+ }
|
|
next({ path: loginPath });
|
|
next({ path: loginPath });
|
|
} else {
|
|
} else {
|
|
next();
|
|
next();
|