优化获取平台数据逻辑
This commit is contained in:
parent
7b785fa827
commit
529c001b66
|
|
@ -5,6 +5,7 @@ export default {
|
||||||
currentCateId: 0,
|
currentCateId: 0,
|
||||||
currentOrderTabIndex: 0,
|
currentOrderTabIndex: 0,
|
||||||
platformData: {
|
platformData: {
|
||||||
|
loaded: false,
|
||||||
about: "",
|
about: "",
|
||||||
privacy: "",
|
privacy: "",
|
||||||
register: "",
|
register: "",
|
||||||
|
|
@ -29,8 +30,12 @@ export default {
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
async platformData(context, data) {
|
async platformData(context, data) {
|
||||||
|
if (context.state.platformData.loaded) return;
|
||||||
await system.platformData().then(data => {
|
await system.platformData().then(data => {
|
||||||
context.commit('platformData', data);
|
context.commit('platformData', {
|
||||||
|
...data,
|
||||||
|
loaded: true,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue