diff --git a/src/views/setting/cloudManager.vue b/src/views/setting/cloudManager.vue index c6e8675..a65eb93 100644 --- a/src/views/setting/cloudManager.vue +++ b/src/views/setting/cloudManager.vue @@ -27,7 +27,7 @@ 一般用于初始化操作, 将文件数据同步到数据库
重置角色、菜单: - +
一般用于初始化角色、菜单数据 @@ -44,6 +44,7 @@ export default { return { title: '网盘管理', syncLoading: false, + resetLoading: false, webpEnabled: false } }, @@ -57,23 +58,37 @@ export default { }) }, sync() { - this.syncLoading = true - settingApi.sync({username: this.$store.state.user.name}).then(() => { - this.syncLoading = false + this.$confirm('是否开始同步? ', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.syncLoading = true + settingApi.sync({username: this.$store.state.user.name}).then(() => { + this.syncLoading = false + }).catch(() => { + this.syncLoading = false + }) }).catch(() => { this.syncLoading = false }) }, // 重置角色菜单 resetMenuAndRole(){ - this.$confirm('您确定要删除此角色、菜单吗?', '提示', { + this.$confirm('您确定要删除当前角色、菜单吗? ', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + this.resetLoading = true settingApi.resetMenuAndRole().then(() => { this.$message.success("重置完成") + this.resetLoading = false + }).catch(()=> { + this.resetLoading = false }) + }).catch(() => { + this.resetLoading = false }) }, webpChange(webpEnabled) {