fix: 针对刷新页面获取不到系统导致一直转圈的处理

This commit is contained in:
hzj 2026-04-21 18:48:35 +08:00
parent 628879f602
commit b3661292cb
2 changed files with 14 additions and 7 deletions

View File

@ -54,7 +54,7 @@ router.beforeEach(async(to, from, next) => {
}).catch(err => {
console.error(err)
})
store.dispatch('user/buttonPermissions')
await store.dispatch('user/buttonPermissions')
next()
} catch (error) {
// remove token and go to login page to re-login

View File

@ -966,6 +966,7 @@ export default {
allCountryList: [],
rangeDate: "",
listLoading: true,
hasInitializedSysOrigin: false,
searchLoading: false,
clickUserId: "",
@ -994,17 +995,23 @@ export default {
this.listQuery.startCreateDate = "";
this.listQuery.endCreateDate = "";
}
},
permissionsSysOriginPlatforms: {
immediate: true,
handler(newVal) {
if (this.hasInitializedSysOrigin || !newVal || newVal.length <= 0) {
return;
}
const querySystem = newVal[0];
this.hasInitializedSysOrigin = true;
this.listQuery.sysOrigins = [querySystem.value];
this.renderData(true);
}
}
},
created() {
const that = this;
const querySystem = this.permissionsSysOriginPlatforms[0];
if (!querySystem) {
return;
}
that.listQuery.sysOrigins = [querySystem.value];
that.renderData(true);
// that.loadCountryAlls()
this.loadOpenCountry();
setTimeout(() => {