fix(系统设置): 新建项目后刷新权限

--bug=1019781 --user=李玉号 【测试跟踪】新建项目-点击功能用例-跳转到了个人信息
https://www.tapd.cn/55049933/s/1303357
This commit is contained in:
shiziyuan9527 2022-11-23 19:51:00 +08:00 committed by lyh
parent 6164a2a632
commit 3c8a9c8a53
2 changed files with 17 additions and 7 deletions

View File

@ -44,6 +44,7 @@ export default {
this.userStore = useUserStore();
},
inject: [
'reload',
'reloadTopMenus'
],
data() {
@ -96,7 +97,7 @@ export default {
return (item.name.toLowerCase().indexOf(queryString.toLowerCase()) !== -1);
};
},
reloadPage: function () {
reloadPage() {
// todo refactor permission check
let redirectUrl = sessionStorage.getItem('redirectUrl');
let copyRedirectUrl = redirectUrl;

View File

@ -311,12 +311,21 @@ export default {
localStorage.removeItem("ISSUE_LIST");
}
let promise = this.form.id ? modifyProject(this.form) : saveProject(this.form);
this.loading = promise.then(() => {
this.createVisible = false;
this.$success(this.$t('commons.save_success'));
this.reload();
});
if (this.form.id) {
this.loading = modifyProject(this.form).then(() => {
this.createVisible = false;
this.$success(this.$t('commons.save_success'));
this.reload();
});
} else {
this.loading = saveProject(this.form).then(() => {
this.createVisible = false;
this.$success(this.$t('commons.save_success'));
setTimeout(() => {
location.reload();
}, 1000);
});
}
},
handleDelete(project) {
this.$refs.deleteConfirm.open(project);