From 197c6c86f43c5756b35f7a0ce2c1dc71be3752e3 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Sep 2026 16:25:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=A7=9F=E6=88=B7=E6=9C=AA=E5=B0=B1=E7=BB=AA=E6=97=B6?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E6=8F=90=E5=89=8D=E8=AF=B7=E6=B1=82=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E4=BC=98=E5=8C=96=E7=99=BB=E5=BD=95=E5=AE=A1?= =?UTF-8?q?=E8=AE=A1=E7=9B=B8=E5=85=B3=E6=96=87=E6=A1=88=E4=B8=8E=E5=88=97?= =?UTF-8?q?=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 为imSensitiveWord、imUserPolicyGroup、imSecurityPolicy页面添加租户ID校验,避免表格挂载时因租户默认值未就绪发起无效请求 2. 更新imLoginFailureLog、imUserLoginHistory的搜索占位符与账号列宽 3. 修正后端登录审计相关结构体的字段注释描述 --- server/internal/model/input/sysin/im_login_audit.go | 12 ++++++------ web/src/views/imLoginFailureLog/model.ts | 4 ++-- web/src/views/imSecurityPolicy/index.vue | 7 +++++-- web/src/views/imSensitiveWord/index.vue | 6 +++++- web/src/views/imUserLoginHistory/model.ts | 4 ++-- web/src/views/imUserPolicyGroup/index.vue | 4 +++- 6 files changed, 23 insertions(+), 14 deletions(-) diff --git a/server/internal/model/input/sysin/im_login_audit.go b/server/internal/model/input/sysin/im_login_audit.go index 80670b8..4b3e4d4 100644 --- a/server/internal/model/input/sysin/im_login_audit.go +++ b/server/internal/model/input/sysin/im_login_audit.go @@ -13,7 +13,7 @@ type ImUserLoginHistoryListInp struct { form.PageReq TenantId int64 `json:"tenantId" dc:"租户ID"` UserId string `json:"userId" dc:"用户ID"` - Account string `json:"account" dc:"脱敏账号"` + Account string `json:"account" dc:"账号"` LoginType string `json:"loginType" dc:"登录方式"` EventType string `json:"eventType" dc:"事件类型"` Platform string `json:"platform" dc:"客户端平台"` @@ -34,8 +34,8 @@ type ImUserLoginHistoryModel struct { UserId string `json:"userId" dc:"用户ID"` Username string `json:"username" dc:"用户名"` AccountType string `json:"accountType" dc:"账号类型"` - AccountMask string `json:"accountMask" dc:"脱敏账号"` - LoginType string `json:"loginType" dc:"登录方式"` + AccountMask string `json:"accountMask" dc:"账号"` + LoginType string `json:"loginType" dc:"登录方式"` EventType string `json:"eventType" dc:"事件类型"` SessionId string `json:"sessionId" dc:"会话ID"` DeviceId string `json:"deviceId" dc:"设备ID"` @@ -55,7 +55,7 @@ type ImLoginFailureLogListInp struct { form.PageReq TenantId int64 `json:"tenantId" dc:"租户ID"` UserId string `json:"userId" dc:"用户ID"` - Account string `json:"account" dc:"脱敏账号"` + Account string `json:"account" dc:"账号"` FailureType string `json:"failureType" dc:"失败类型"` Platform string `json:"platform" dc:"客户端平台"` Ip string `json:"ip" dc:"IP地址"` @@ -87,7 +87,7 @@ type ImLoginFailureLogModel struct { Id int64 `json:"id" dc:"ID"` UserId string `json:"userId" dc:"用户ID"` AccountType string `json:"accountType" dc:"账号类型"` - AccountMask string `json:"accountMask" dc:"脱敏账号"` + AccountMask string `json:"accountMask" dc:"账号"` AccountHash string `json:"accountHash" dc:"账号哈希"` FailureType string `json:"failureType" dc:"失败类型"` Reason string `json:"reason" dc:"原因码"` @@ -172,7 +172,7 @@ func (in *ImLoginFailureBanUserInp) Filter(ctx context.Context) error { type ImLoginAuditExportModel struct { Id int64 `json:"id" dc:"ID"` UserId string `json:"userId" dc:"用户ID"` - AccountMask string `json:"accountMask" dc:"脱敏账号"` + AccountMask string `json:"accountMask" dc:"账号"` EventType string `json:"eventType" dc:"事件/失败类型"` Platform string `json:"platform" dc:"客户端平台"` Ip string `json:"ip" dc:"IP地址"` diff --git a/web/src/views/imLoginFailureLog/model.ts b/web/src/views/imLoginFailureLog/model.ts index 43e2402..edb4efc 100644 --- a/web/src/views/imLoginFailureLog/model.ts +++ b/web/src/views/imLoginFailureLog/model.ts @@ -27,7 +27,7 @@ export const schemas = ref([ field: 'account', component: 'NInput', label: '账号', - componentProps: { placeholder: '请输入脱敏账号' }, + componentProps: { placeholder: '请输入账号' }, }, { field: 'failureType', @@ -66,7 +66,7 @@ export const schemas = ref([ export const columns = [ { title: 'ID', key: 'id', width: 90 }, { title: '用户ID', key: 'userId', width: 130 }, - { title: '账号', key: 'accountMask', width: 170 }, + { title: '账号', key: 'accountMask', width: 200 }, { title: '失败类型', key: 'failureType', diff --git a/web/src/views/imSecurityPolicy/index.vue b/web/src/views/imSecurityPolicy/index.vue index 8bcc47c..8a745db 100644 --- a/web/src/views/imSecurityPolicy/index.vue +++ b/web/src/views/imSecurityPolicy/index.vue @@ -543,8 +543,11 @@ labelWidth: 90, schemas, }); - const loadTable = (res) => List({ ...searchFormRef.value?.formModel, ...res }), - loadIPTable = (res) => IPRuleList({ tenantId: tenantId(), ...res }); + // 表格挂载时自动请求早于租户默认值就绪(tenantId 尚为 0),此时跳过请求,由 onMounted 的 reloadAll 加载首屏 + const loadTable = (res) => + tenantId() ? List({ ...searchFormRef.value?.formModel, ...res }) : Promise.resolve({}), + loadIPTable = (res) => + tenantId() ? IPRuleList({ tenantId: tenantId(), ...res }) : Promise.resolve({}); const reloadAll = () => { tableRef.value?.reload(); ipTableRef.value?.reload(); diff --git a/web/src/views/imSensitiveWord/index.vue b/web/src/views/imSensitiveWord/index.vue index 7f29891..a3a5725 100644 --- a/web/src/views/imSensitiveWord/index.vue +++ b/web/src/views/imSensitiveWord/index.vue @@ -206,7 +206,11 @@ labelWidth: 90, schemas, }); - const loadTable = (res) => List({ ...searchFormRef.value?.formModel, ...res }); + // 表格挂载自动请求早于租户默认值就绪,tenantId 未就绪时跳过,由 onMounted 的 reload 加载首屏 + const loadTable = (res) => + Number(searchFormRef.value?.formModel?.tenantId || 0) + ? List({ ...searchFormRef.value?.formModel, ...res }) + : Promise.resolve({}); const reload = () => tableRef.value?.reload(); const actionColumn = reactive({ width: 150, diff --git a/web/src/views/imUserLoginHistory/model.ts b/web/src/views/imUserLoginHistory/model.ts index 51b4094..82f8319 100644 --- a/web/src/views/imUserLoginHistory/model.ts +++ b/web/src/views/imUserLoginHistory/model.ts @@ -27,7 +27,7 @@ export const schemas = ref([ field: 'account', component: 'NInput', label: '账号', - componentProps: { placeholder: '请输入手机号/脱敏账号' }, + componentProps: { placeholder: '请输入账号' }, }, { field: 'loginType', @@ -77,7 +77,7 @@ export const columns = [ { title: 'ID', key: 'id', width: 90 }, { title: '用户ID', key: 'userId', width: 130 }, { title: '用户名', key: 'username', width: 150 }, - { title: '账号', key: 'accountMask', width: 170 }, + { title: '账号', key: 'accountMask', width: 200 }, { title: '登录方式', key: 'loginType', diff --git a/web/src/views/imUserPolicyGroup/index.vue b/web/src/views/imUserPolicyGroup/index.vue index 08f16e3..6f331f8 100644 --- a/web/src/views/imUserPolicyGroup/index.vue +++ b/web/src/views/imUserPolicyGroup/index.vue @@ -290,7 +290,9 @@ labelWidth: 90, schemas, }); - const loadDataTable = (res) => List({ ...searchFormRef.value?.formModel, ...res }); + // 表格挂载自动请求早于租户默认值就绪,tenantId 未就绪时跳过,由 onMounted 的 reloadTable 加载首屏 + const loadDataTable = (res) => + currentTenantId() ? List({ ...searchFormRef.value?.formModel, ...res }) : Promise.resolve({}); const currentTenantId = () => Number(searchFormRef.value?.formModel?.tenantId || 0); const reloadTable = () => { actionRef.value?.reload();