|
@@ -71,7 +71,7 @@
|
|
|
</el-input>
|
|
|
<div class="PasswordInfoDiv">
|
|
|
<div>
|
|
|
- <el-checkbox :checked="RememberYourPassword">记住密码</el-checkbox>
|
|
|
+ <el-checkbox :checked="RememberYourPassword" v-model="RememberYourPassword">记住密码</el-checkbox>
|
|
|
</div>
|
|
|
<div><el-link type="primary" @click="forgetYouPassword()">忘记密码?</el-link></div>
|
|
|
</div>
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
|
- if (this.RememberYourPassword) {
|
|
|
+ if (localStorage.getItem("RememberYourPassword") === "true") {
|
|
|
if (localStorage.getItem("_USER_NAME") && localStorage.getItem("_PASSWORD")) {
|
|
|
this.userName = localStorage.getItem("_USER_NAME");
|
|
|
this.password = publicFun.Decrypt(localStorage.getItem("_PASSWORD"));
|
|
@@ -129,9 +129,9 @@ export default {
|
|
|
// 登录成功
|
|
|
if (res.code == 200) {
|
|
|
// 登录校验成功后
|
|
|
+ localStorage.setItem("RememberYourPassword", this.RememberYourPassword);
|
|
|
if (this.RememberYourPassword) {
|
|
|
// 需要长期缓存的数据使用localStorage
|
|
|
- localStorage.setItem("RememberYourPassword", true);
|
|
|
localStorage.setItem("_USER_NAME", this.userName);
|
|
|
localStorage.setItem("_PASSWORD", publicFun.Encrypt(this.password));
|
|
|
}
|