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