Browse Source

Update App.vue

lex-xin 3 years ago
parent
commit
00327e78d7
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/App.vue

+ 4 - 4
src/App.vue

@@ -17,11 +17,11 @@ export default {
   name: "app",
   async created() {
     try {
-      const Authorization = this.getQueryVariable('Authorization')
-      console.log(decodeURI(Authorization))
+      let Authorization = this.getQueryVariable('Authorization')
+      Authorization = Authorization ? Authorization.split('+')[1] : null
       if (Authorization) {
-        localStorage.setItem("Authorization", decodeURI(Authorization));
-        localStorage.setItem("userInfo", decodeURI(Authorization));
+        localStorage.setItem("Authorization", ('bearer ' + Authorization));
+        localStorage.setItem("userInfo", ('bearer ' + Authorization));
       }
       const auth = localStorage.getItem("Authorization");
       const userInfo = localStorage.getItem("userInfo");