Browse Source

[WHAT] 記住密碼 [WHY] 開發 ShowEasy 前台

Dev
Janie 2 years ago
parent
commit
2bedcb59b6
  1. 13
      FrontEnd/pages/user/index.vue

13
FrontEnd/pages/user/index.vue

@ -31,6 +31,8 @@
{{ $t('The username or password entered is incorrect') }}
</div>
<v-form ref="loginFormRef" lazy-validation>
<!-- <div v-if="$auth.$storage.getUniversal('userAccount') && $auth.$storage.getUniversal('userPassword')"></div>
<div v-else></div> -->
<v-text-field
v-model="userData.Account" background-color="neutrals darken-1" :label="this.$t('Email')"
:placeholder="this.$t('Email')" height="40px" filled rounded dense single-line persistent-placeholder
@ -142,11 +144,22 @@
handler: function () {
if (this.remember == true) {
this.$auth.$storage.setUniversal("userPassword", this.userData.Password);
this.$auth.$storage.setUniversal("userAccount", this.userData.Account);
}else{
this.$auth.$storage.removeUniversal("userPassword");
this.$auth.$storage.removeUniversal("userAccount", this.userData.Account);
}
},
},
},
mounted(){
var userAccount = this.$auth.$storage.getUniversal('userAccount');
var userPassword = this.$auth.$storage.getUniversal('userPassword');
this.userData.Account = userAccount ? userAccount : '';
this.userData.Password = userPassword ? userPassword : '';
},
methods: {
async userLogin() {

Loading…
Cancel
Save