From 8309fb1e40a50df9774fbf98d44ac3889a5c94c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B8=B8=E7=86=9F=E5=90=B4=E5=BD=A6=E7=A5=96?= Date: Thu, 26 Feb 2026 13:29:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/sys/role.vue | 3 +- src/views/modules/sys/user-add-or-update.vue | 20 +++++----- src/views/modules/sys/user.vue | 40 ++++++++++++++++++-- 3 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/views/modules/sys/role.vue b/src/views/modules/sys/role.vue index 6278122..64069b6 100644 --- a/src/views/modules/sys/role.vue +++ b/src/views/modules/sys/role.vue @@ -43,7 +43,8 @@ diff --git a/src/views/modules/sys/user-add-or-update.vue b/src/views/modules/sys/user-add-or-update.vue index b9a6687..59adcaa 100644 --- a/src/views/modules/sys/user-add-or-update.vue +++ b/src/views/modules/sys/user-add-or-update.vue @@ -44,12 +44,12 @@ - - - - - + + + + + + @@ -105,7 +105,7 @@ export default { userName: '', password: '', comfirmPassword: '', - languageDefault: '', + languageDefault: 'cn', salt: '', email: '', mobile: '', @@ -177,7 +177,7 @@ export default { init(id) { this.dataForm.id = id || 0 - + // 如果是新增模式,清空表单数据 if (!this.dataForm.id) { this.dataForm = { @@ -185,7 +185,7 @@ export default { userName: '', password: '', comfirmPassword: '', - languageDefault: '', + languageDefault: 'cn', salt: '', email: '', mobile: '', @@ -197,7 +197,7 @@ export default { domainAccount: '' } } - + // this.factoryList(); this.getLanguageList(); this.getSiteOptions(); // 获取工厂选项 diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index 0bbedf0..085ab7a 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -84,12 +84,13 @@ fixed="right" header-align="center" align="center" - width="150" + width="200" :label="buttons.cz||'操作'"> @@ -219,6 +220,7 @@ export default { specialVisible: false, siteVisible: false, warehouseVisible: false, + forceLogoutLoading: false, currentData: {}, userId: this.$store.state.user.name, transferData: [], @@ -291,6 +293,7 @@ export default { add: '添加', edit: '编辑', delete: '删除', + forceLogout: '踢出登录', specialCompetencies: '特殊权限', factoryAuthorization: '工厂授权', warehouseAuthorization: '仓库授权', @@ -621,6 +624,35 @@ export default { }) }).catch(() => { }) + }, + // 踢出登录 - rqrq + forceLogoutHandle(row) { + this.$confirm(`确定要踢出用户 [${row.username}] 的登录状态吗?该操作将清除该用户的登录状态,使其需要重新登录。`, '踢出登录确认', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.forceLogoutLoading = true + this.$http({ + url: this.$http.adornUrl('/sys/user/forceLogout'), + method: 'post', + data: this.$http.adornData({ + userId: row.userId + }) + }).then(({data}) => { + if (data && data.code === 0) { + this.$message.success('已成功踢出该用户,用户需要重新登录') + this.getDataList() + } else { + this.$alert(data.msg || '踢出登录失败', '错误') + } + }).catch(() => { + this.$message.error('踢出登录失败') + }).finally(() => { + this.forceLogoutLoading = false + }) + }).catch(() => { + }) } }, created() {