From e354812501f7bfb7c8a8cd761a435d0be53ecb0b Mon Sep 17 00:00:00 2001 From: jmal Date: Tue, 9 Aug 2022 15:16:29 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=B7=BB=E5=8A=A0=E5=8F=8B=E5=A5=BD?= =?UTF-8?q?=E6=80=A7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/cloudManager.vue | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) 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) {