|
@@ -35,7 +35,7 @@
|
|
|
/>
|
|
|
</svg>
|
|
|
</el-input>
|
|
|
- <el-input placeholder="密码" v-model="password">
|
|
|
+ <el-input placeholder="密码" type="password" autocomplete="off" v-model="password">
|
|
|
<svg
|
|
|
class="loginInputIcon"
|
|
|
slot="prefix"
|
|
@@ -86,6 +86,7 @@
|
|
|
* @author: LiuMengxiang
|
|
|
* @Date: 2022年12月02日
|
|
|
*/
|
|
|
+import publicFun from "@/utils/publicFunction.js";
|
|
|
export default {
|
|
|
name: "Login",
|
|
|
components: {},
|
|
@@ -96,7 +97,17 @@ export default {
|
|
|
RememberYourPassword: localStorage.getItem("RememberYourPassword")
|
|
|
};
|
|
|
},
|
|
|
- mounted() {},
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.RememberYourPassword = localStorage.getItem("RememberYourPassword");
|
|
|
+ if (this.RememberYourPassword) {
|
|
|
+ if (localStorage.getItem("_USER_NAME") && localStorage.getItem("_PASSWORD")) {
|
|
|
+ this.userName = localStorage.getItem("_USER_NAME");
|
|
|
+ this.password = publicFun.Decrypt(localStorage.getItem("_PASSWORD"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
destroy() {},
|
|
|
props: [],
|
|
|
methods: {
|
|
@@ -109,16 +120,18 @@ export default {
|
|
|
this.$message.info("请输入密码");
|
|
|
return false;
|
|
|
}
|
|
|
+ // 登录校验成功后
|
|
|
+ if (this.RememberYourPassword) {
|
|
|
+ localStorage.setItem("RememberYourPassword", true);
|
|
|
+ localStorage.setItem("_USER_NAME", this.userName);
|
|
|
+ localStorage.setItem("_PASSWORD", publicFun.Encrypt(this.password));
|
|
|
+ }
|
|
|
this.$router.push("/");
|
|
|
const h = this.$createElement;
|
|
|
|
|
|
this.$notify({
|
|
|
title: "登录成功",
|
|
|
- message: h(
|
|
|
- "i",
|
|
|
- { style: "color: teal" },
|
|
|
- this.userName+",欢迎回来!"
|
|
|
- )
|
|
|
+ message: h("i", { style: "color: teal" }, this.userName + ",欢迎回来!")
|
|
|
});
|
|
|
},
|
|
|
forgetYouPassword() {
|
|
@@ -143,7 +156,7 @@ export default {
|
|
|
background: url("@static/images/bg.png") no-repeat center;
|
|
|
background-size: 100% 100%;
|
|
|
.loginBox_title {
|
|
|
- position:absolute;
|
|
|
+ position: absolute;
|
|
|
text-align: center;
|
|
|
margin-bottom: 600px;
|
|
|
width: 100%;
|