|
@@ -5,7 +5,7 @@ import ChangePassword from "@/features/ChangePassword/ChangePassword.vue";
|
|
|
import { resetStore, store } from "@/store/store";
|
|
|
|
|
|
const routes: RouteRecordRaw[] = [
|
|
|
- { path: "/", component: UserLogin },
|
|
|
+ { path: "/", redirect: "/login" },
|
|
|
{ path: "/login", component: UserLogin, name: "UserLogin" },
|
|
|
{
|
|
|
path: "/",
|
|
@@ -14,6 +14,7 @@ const routes: RouteRecordRaw[] = [
|
|
|
{
|
|
|
path: "password",
|
|
|
component: ChangePassword,
|
|
|
+ name: "ChangePassword",
|
|
|
},
|
|
|
],
|
|
|
},
|
|
@@ -40,13 +41,10 @@ router.beforeEach((to, from, next) => {
|
|
|
_hmt.push(["_trackPageview", "/oe-web" + to.fullPath]);
|
|
|
}
|
|
|
|
|
|
- if (to.path.match(/^\/?/) || to.path.match(/^\/login\/.?$/)) {
|
|
|
+ if (to.name === "UserLogin") {
|
|
|
resetStore();
|
|
|
next();
|
|
|
} else {
|
|
|
- if (!localStorage.getItem("domain")) {
|
|
|
- alert("地址出错,找不到机构!请关闭应用后重试!");
|
|
|
- }
|
|
|
if (!store.user.token) {
|
|
|
next({ path: loginPath });
|
|
|
} else {
|