Browse Source

首页记住我功能

user5 2 years ago
parent
commit
61ee01719d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/views/modules/sys/login/login.vue

+ 2 - 2
src/views/modules/sys/login/login.vue

@@ -153,7 +153,7 @@
               if (checked) {
                 // eslint-disable-next-line no-undef
                 // let password = Base64.encode(passwordLogin) // base64加密
-                this.setCookie(username, Base64.encode(password), 7)
+                this.setCookie(Base64.encode(username), Base64.encode(password), 7)
               } else {
                 this.setCookie('', '', -1) // 修改2值都为空,天数为负1天就好了
               }
@@ -211,7 +211,7 @@
           for (let i = 0; i < arr.length; i++) {
             let arr2 = arr[i].split('=') // 再次切割,arr2[0]为key值,arr2[1]为对应的value
             if (arr2[0] === 'username') {
-              this.inputForm.username = arr2[1]
+              this.inputForm.username = Base64.decode(arr2[1])// base64解密
             } else if (arr2[0] === 'password') {
               // eslint-disable-next-line no-undef
               this.inputForm.password = Base64.decode(arr2[1])// base64解密