Browse Source

解决登录时禁止缓存错误的用户信息

hangb 7 years ago
parent
commit
050d061818
1 changed files with 7 additions and 7 deletions
  1. 7 7
      components/login/Login.vue

+ 7 - 7
components/login/Login.vue

@@ -365,13 +365,6 @@
           this.isShowLoading = false
           this.$message.error('请填写密码')
         } else {
-          if (this.appId === 'mall' || this.appId === 'home') {
-            if (this.checked) {
-              this.setCookie(this.login.username, this.login.password, 7)
-            } else {
-              this.clearCookie()
-            }
-          }
           let param = new FormData()
           param.append('username', this.login.username)
           param.append('password', this.login.password)
@@ -450,6 +443,13 @@
         this.login.spaceUU = spaceUU
         this.dialogVisible = false
         this.isLogin(flag)
+        if (this.appId === 'mall' || this.appId === 'home') {
+          if (this.checked) {
+            this.setCookie(this.login.username, this.login.password, 7)
+          } else {
+            this.clearCookie()
+          }
+        }
       },
       getJsonp: function (url, timeout = 500) {
         return new Promise((resolve, reject) => {