wangfei 6 年 前
コミット
a66320f1a5
共有2 個のファイルを変更した8 個の追加10 個の削除を含む
  1. 8
    6
      src/App.vue
  2. 0
    4
      src/store/vote.js

+ 8
- 6
src/App.vue ファイルの表示

32
     ...mapactivityState({
32
     ...mapactivityState({
33
       activity: s => s.activity || {},
33
       activity: s => s.activity || {},
34
       theme: s => `${s.theme}`,
34
       theme: s => `${s.theme}`,
35
-      code: s => s.code,
36
     })
35
     })
37
   },
36
   },
38
   created() {
37
   created() {
40
     console.log("process.env.NODE_ENV =>", env)
39
     console.log("process.env.NODE_ENV =>", env)
41
     if (env === 'production' || env === 'test') {
40
     if (env === 'production' || env === 'test') {
42
       if (location.search && this.toolClass.UrlSearch(location.search).code) {
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
           this.toolClass.getCode(this.appid[env])
46
           this.toolClass.getCode(this.appid[env])
46
         } else {
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
             this.showPage = true
51
             this.showPage = true
50
           })
52
           })
51
         }
53
         }
57
     }
59
     }
58
   },
60
   },
59
   methods: {
61
   methods: {
60
-    ...mapIndexActions(["getUser","setCode"])
62
+    ...mapIndexActions(["getUser"])
61
   }
63
   }
62
 };
64
 };
63
 </script>
65
 </script>

+ 0
- 4
src/store/vote.js ファイルの表示

11
     toplist: [],
11
     toplist: [],
12
     list: [],
12
     list: [],
13
     theme: 1,
13
     theme: 1,
14
-    code: '',
15
   },
14
   },
16
   mutations: {
15
   mutations: {
17
     updateActivity(state, data) {
16
     updateActivity(state, data) {
50
         return x.MemberId === data.MemberId ? data : x
49
         return x.MemberId === data.MemberId ? data : x
51
       })
50
       })
52
     },
51
     },
53
-    setCode(state, code) {
54
-      state.code = code
55
-    }
56
   },
52
   },
57
   actions: {
53
   actions: {
58
     getActivity ({ commit, state }, {actid}) {
54
     getActivity ({ commit, state }, {actid}) {