From d5b926ca80187d084a082883b8993295f5963866 Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Tue, 12 Sep 2023 20:07:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 6 ++++- src/views/newLogin.vue | 56 ++++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/permission.js b/src/permission.js index 5a445f8..11eaf20 100644 --- a/src/permission.js +++ b/src/permission.js @@ -9,7 +9,11 @@ import { isRelogin } from "@/utils/request"; NProgress.configure({ showSpinner: false }); const whiteList = [ - '/toLogin' + '/toLogin', + '/home', + '/planManage', + "/enforcing", + "/focusEnter" ]; router.beforeEach((to, from, next) => { diff --git a/src/views/newLogin.vue b/src/views/newLogin.vue index cb1b061..0ec7bfd 100644 --- a/src/views/newLogin.vue +++ b/src/views/newLogin.vue @@ -130,8 +130,8 @@ export default { }, }, created() { - this.getCode(); - this.getCookie(); + // this.getCode(); + // this.getCookie(); }, methods: { getCode() { @@ -158,31 +158,33 @@ export default { handleLogin() { this.$refs.loginForm.validate((valid) => { if (valid) { - this.loading = true; - if (this.loginForm.rememberMe) { - Cookies.set("username", this.loginForm.username, { expires: 30 }); - Cookies.set("password", encrypt(this.loginForm.password), { - expires: 30, - }); - Cookies.set("rememberMe", this.loginForm.rememberMe, { - expires: 30, - }); - } else { - Cookies.remove("username"); - Cookies.remove("password"); - Cookies.remove("rememberMe"); - } - this.$store - .dispatch("Login", this.loginForm) - .then(() => { - this.$router.push({ path: this.redirect || "/" }).catch(() => {}); - }) - .catch(() => { - this.loading = false; - if (this.captchaEnabled) { - this.getCode(); - } - }); + // this.loading = true; + this.$router.push({ path: "/home" }).catch(() => {}); + + // if (this.loginForm.rememberMe) { + // Cookies.set("username", this.loginForm.username, { expires: 30 }); + // Cookies.set("password", encrypt(this.loginForm.password), { + // expires: 30, + // }); + // Cookies.set("rememberMe", this.loginForm.rememberMe, { + // expires: 30, + // }); + // } else { + // Cookies.remove("username"); + // Cookies.remove("password"); + // Cookies.remove("rememberMe"); + // } + // this.$store + // .dispatch("Login", this.loginForm) + // .then(() => { + // this.$router.push({ path: this.redirect || "/" }).catch(() => {}); + // }) + // .catch(() => { + // this.loading = false; + // if (this.captchaEnabled) { + // this.getCode(); + // } + // }); } }); },