diff --git a/src/permission.js b/src/permission.js index b832f73..98ff92b 100644 --- a/src/permission.js +++ b/src/permission.js @@ -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 diff --git a/src/views/user/user-table/index.vue b/src/views/user/user-table/index.vue index 5ddb2c2..81e9029 100644 --- a/src/views/user/user-table/index.vue +++ b/src/views/user/user-table/index.vue @@ -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(() => {