From 1dd24f815b8dc8c8f3bb13f057b5d22c785eba0b Mon Sep 17 00:00:00 2001
From: chiyilin <2449182606@qq.com>
Date: Fri, 10 Nov 2023 13:20:05 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E7=99=BD?=
=?UTF-8?q?=E5=90=8D=E5=8D=95=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/system/user.js | 12 +++++++++
src/views/system/user/index.vue | 47 +++++++++++++++++++++++++++++++--
2 files changed, 57 insertions(+), 2 deletions(-)
diff --git a/src/api/system/user.js b/src/api/system/user.js
index 057ace8c..e3226a36 100644
--- a/src/api/system/user.js
+++ b/src/api/system/user.js
@@ -88,6 +88,18 @@ export function changeUserStatus(id, status) {
data: data
})
}
+// 用户白名单修改
+export function changeUserWhiteList(id, whiteList) {
+ const data = {
+ id,
+ whiteList
+ }
+ return request({
+ url: '/system/user/update-whiteList',
+ method: 'put',
+ data: data
+ })
+}
// 查询用户个人信息
export function getUserProfile() {
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 0ee1457d..3bcc4a7b 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -193,11 +193,29 @@
/>
+
+
+
+
+
+
@@ -464,6 +482,7 @@
import {
addUser,
changeUserStatus,
+ changeUserWhiteList,
delUser,
exportUser,
getUser,
@@ -543,6 +562,7 @@ export default {
username: undefined,
mobile: undefined,
status: undefined,
+ whiteList: undefined,
deptId: undefined,
createTime: [],
},
@@ -554,7 +574,8 @@ export default {
{ key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true },
- { key: 6, label: `创建时间`, visible: true },
+ { key: 6, label: `白名单`, visible: true },
+ { key: 7, label: `创建时间`, visible: true },
],
// 表单校验
rules: {
@@ -676,6 +697,27 @@ export default {
: CommonStatusEnum.ENABLE;
});
},
+ // 白名单状态修改
+ handleWhiteListChange(row) {
+ let text = row.whiteList === CommonStatusEnum.ENABLE ? "启用" : "停用";
+ this.$modal
+ .confirm(
+ '确认要"' + text + '""' + row.username + '"用户的token白名单吗?'
+ )
+ .then(function () {
+ return changeUserWhiteList(row.id, row.whiteList);
+ })
+ .then(() => {
+ this.$modal.msgSuccess("token白名单"+text + "成功");
+ })
+ .catch(function () {
+ row.whiteList =
+ row.whiteList === CommonStatusEnum.ENABLE
+ ? CommonStatusEnum.DISABLE
+ : CommonStatusEnum.ENABLE;
+
+ });
+ },
// 取消按钮
cancel() {
this.open = false;
@@ -698,6 +740,7 @@ export default {
email: undefined,
sex: undefined,
status: "0",
+ whiteList: "0",
remark: undefined,
postIds: [],
roleIds: [],