From df9d07734f0c6d19578d4d69e9125e4fa4d4fcf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=89=93=E8=B1=86=E8=B1=86?= <3346088772@qq.comcd>
Date: Tue, 5 Dec 2023 13:49:20 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=81=A2=E5=A4=8D=E9=BB=98?=
=?UTF-8?q?=E8=AE=A4=E8=8F=9C=E5=8D=95=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/role.js | 9 +++++++++
src/views/system/role/index.vue | 26 ++++++++++++++++++++++++++
vue.config.js | 4 ++--
3 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/src/api/system/role.js b/src/api/system/role.js
index 4b455e1..1744cb7 100644
--- a/src/api/system/role.js
+++ b/src/api/system/role.js
@@ -108,4 +108,13 @@ export function authUserSelectAll(data) {
method: 'put',
params: data
})
+}
+
+// 角色恢复默认菜单权限
+export function resetRole(query) {
+ return request({
+ url: '/system/role/resetRole',
+ method: 'get',
+ params: query
+ })
}
\ No newline at end of file
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index 9d34963..bc140b0 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -134,6 +134,7 @@
@click="handleDelete(scope.row)"
v-hasPermi="['system:role:remove']"
>删除
+ 恢复默认菜单权限
handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
更多
@@ -603,6 +604,31 @@ export default {
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
+ // 恢复默认菜单权限
+ restoreRole(roleId) {
+ this.$confirm("确定恢复默认菜单权限吗?", '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ resetRole(roleId).then(result => {
+ if (result.code === 200) {
+ this.$notify({
+ title: '成功',
+ message: result.message,
+ type: 'success'
+ })
+ this.getList();
+ } else {
+ this.$notify({
+ title: '失败',
+ message: result.message,
+ type: 'error'
+ })
+ }
+ })
+ }).catch(() => {})
+ },
/** 导出按钮操作 */
handleExport() {
this.download('system/role/export', {
diff --git a/vue.config.js b/vue.config.js
index 0f7f8f6..6df3777 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -35,14 +35,14 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
"/prod-api": {
- target: `http://192.168.3.53:8062`,
+ target: `http://192.168.3.53:8063`,
changeOrigin: true,
// pathRewrite: {
// ['^' + process.env.VUE_APP_BASE_API]: ''
// }
},
"/ureport": {
- target: `http://192.168.3.53:8062`,
+ target: `http://192.168.3.53:8063`,
ws: false,
changeOrigin: true,
pathRewrite: {