瀏覽代碼

bug修改

wangfei 6 年之前
父節點
當前提交
d90b58feb4
共有 1 個檔案被更改,包括 8 行新增6 行删除
  1. 8
    6
      src/App.vue

+ 8
- 6
src/App.vue 查看文件

@@ -32,7 +32,6 @@ export default {
32 32
     ...mapactivityState({
33 33
       activity: s => s.activity || {},
34 34
       theme: s => `${s.theme}`,
35
-      code: s => s.code,
36 35
     })
37 36
   },
38 37
   created() {
@@ -40,12 +39,15 @@ export default {
40 39
     console.log("process.env.NODE_ENV =>", env)
41 40
     if (env === 'production' || env === 'test') {
42 41
       if (location.search && this.toolClass.UrlSearch(location.search).code) {
43
-        const code = this.toolClass.UrlSearch(location.search).code
44
-        if (this.code === code) {
42
+        this.code = this.toolClass.UrlSearch(location.search).code
43
+        let oldCode = localStorage.getItem('code')
44
+        if (this.code === oldCode) {
45
+          localStorage.setItem('code', this.code)
45 46
           this.toolClass.getCode(this.appid[env])
46 47
         } else {
47
-          this.setCode(code)
48
-          this.getUser({ code }).then(() => {
48
+          localStorage.setItem('code', this.code)
49
+          // this.showPage = true
50
+          this.getUser({code: this.code }).then(() => {
49 51
             this.showPage = true
50 52
           })
51 53
         }
@@ -57,7 +59,7 @@ export default {
57 59
     }
58 60
   },
59 61
   methods: {
60
-    ...mapIndexActions(["getUser","setCode"])
62
+    ...mapIndexActions(["getUser"])
61 63
   }
62 64
 };
63 65
 </script>