|
@@ -59,16 +59,21 @@ export default {
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
- this.searchInfo();
|
|
|
|
|
|
+ this.searchSite();
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
...mapStudent(['fetch']),
|
|
...mapStudent(['fetch']),
|
|
- async searchInfo() {
|
|
|
|
- const res = await this.fetch('5e4f3d096a90e861b0f30871');
|
|
|
|
- if (res.errcode === 0) {
|
|
|
|
- sessionStorage.setItem('site', JSON.stringify(res.data));
|
|
|
|
- this.$set(this, `info`, res.data);
|
|
|
|
|
|
+ async searchSite() {
|
|
|
|
+ let site = sessionStorage.getItem('site');
|
|
|
|
+ if (site) {
|
|
|
|
+ this.$set(this, `info`, JSON.parse(site));
|
|
|
|
+ } else {
|
|
|
|
+ const res = await this.fetch('5e4f3d096a90e861b0f30871');
|
|
|
|
+ if (res.errcode === 0) {
|
|
|
|
+ sessionStorage.setItem('site', JSON.stringify(res.data));
|
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|