瀏覽代碼

Update App.vue

lex-xin 3 年之前
父節點
當前提交
00327e78d7
共有 1 個文件被更改,包括 4 次插入4 次删除
  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");