fix: 修复多页面租户未就绪时表格提前请求问题,优化登录审计相关文案与列宽
1. 为imSensitiveWord、imUserPolicyGroup、imSecurityPolicy页面添加租户ID校验,避免表格挂载时因租户默认值未就绪发起无效请求 2. 更新imLoginFailureLog、imUserLoginHistory的搜索占位符与账号列宽 3. 修正后端登录审计相关结构体的字段注释描述
This commit is contained in:
@@ -13,7 +13,7 @@ type ImUserLoginHistoryListInp struct {
|
|||||||
form.PageReq
|
form.PageReq
|
||||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||||
UserId string `json:"userId" dc:"用户ID"`
|
UserId string `json:"userId" dc:"用户ID"`
|
||||||
Account string `json:"account" dc:"脱敏账号"`
|
Account string `json:"account" dc:"账号"`
|
||||||
LoginType string `json:"loginType" dc:"登录方式"`
|
LoginType string `json:"loginType" dc:"登录方式"`
|
||||||
EventType string `json:"eventType" dc:"事件类型"`
|
EventType string `json:"eventType" dc:"事件类型"`
|
||||||
Platform string `json:"platform" dc:"客户端平台"`
|
Platform string `json:"platform" dc:"客户端平台"`
|
||||||
@@ -34,8 +34,8 @@ type ImUserLoginHistoryModel struct {
|
|||||||
UserId string `json:"userId" dc:"用户ID"`
|
UserId string `json:"userId" dc:"用户ID"`
|
||||||
Username string `json:"username" dc:"用户名"`
|
Username string `json:"username" dc:"用户名"`
|
||||||
AccountType string `json:"accountType" dc:"账号类型"`
|
AccountType string `json:"accountType" dc:"账号类型"`
|
||||||
AccountMask string `json:"accountMask" dc:"脱敏账号"`
|
AccountMask string `json:"accountMask" dc:"账号"`
|
||||||
LoginType string `json:"loginType" dc:"登录方式"`
|
LoginType string `json:"loginType" dc:"登录方式"`
|
||||||
EventType string `json:"eventType" dc:"事件类型"`
|
EventType string `json:"eventType" dc:"事件类型"`
|
||||||
SessionId string `json:"sessionId" dc:"会话ID"`
|
SessionId string `json:"sessionId" dc:"会话ID"`
|
||||||
DeviceId string `json:"deviceId" dc:"设备ID"`
|
DeviceId string `json:"deviceId" dc:"设备ID"`
|
||||||
@@ -55,7 +55,7 @@ type ImLoginFailureLogListInp struct {
|
|||||||
form.PageReq
|
form.PageReq
|
||||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||||
UserId string `json:"userId" dc:"用户ID"`
|
UserId string `json:"userId" dc:"用户ID"`
|
||||||
Account string `json:"account" dc:"脱敏账号"`
|
Account string `json:"account" dc:"账号"`
|
||||||
FailureType string `json:"failureType" dc:"失败类型"`
|
FailureType string `json:"failureType" dc:"失败类型"`
|
||||||
Platform string `json:"platform" dc:"客户端平台"`
|
Platform string `json:"platform" dc:"客户端平台"`
|
||||||
Ip string `json:"ip" dc:"IP地址"`
|
Ip string `json:"ip" dc:"IP地址"`
|
||||||
@@ -87,7 +87,7 @@ type ImLoginFailureLogModel struct {
|
|||||||
Id int64 `json:"id" dc:"ID"`
|
Id int64 `json:"id" dc:"ID"`
|
||||||
UserId string `json:"userId" dc:"用户ID"`
|
UserId string `json:"userId" dc:"用户ID"`
|
||||||
AccountType string `json:"accountType" dc:"账号类型"`
|
AccountType string `json:"accountType" dc:"账号类型"`
|
||||||
AccountMask string `json:"accountMask" dc:"脱敏账号"`
|
AccountMask string `json:"accountMask" dc:"账号"`
|
||||||
AccountHash string `json:"accountHash" dc:"账号哈希"`
|
AccountHash string `json:"accountHash" dc:"账号哈希"`
|
||||||
FailureType string `json:"failureType" dc:"失败类型"`
|
FailureType string `json:"failureType" dc:"失败类型"`
|
||||||
Reason string `json:"reason" dc:"原因码"`
|
Reason string `json:"reason" dc:"原因码"`
|
||||||
@@ -172,7 +172,7 @@ func (in *ImLoginFailureBanUserInp) Filter(ctx context.Context) error {
|
|||||||
type ImLoginAuditExportModel struct {
|
type ImLoginAuditExportModel struct {
|
||||||
Id int64 `json:"id" dc:"ID"`
|
Id int64 `json:"id" dc:"ID"`
|
||||||
UserId string `json:"userId" dc:"用户ID"`
|
UserId string `json:"userId" dc:"用户ID"`
|
||||||
AccountMask string `json:"accountMask" dc:"脱敏账号"`
|
AccountMask string `json:"accountMask" dc:"账号"`
|
||||||
EventType string `json:"eventType" dc:"事件/失败类型"`
|
EventType string `json:"eventType" dc:"事件/失败类型"`
|
||||||
Platform string `json:"platform" dc:"客户端平台"`
|
Platform string `json:"platform" dc:"客户端平台"`
|
||||||
Ip string `json:"ip" dc:"IP地址"`
|
Ip string `json:"ip" dc:"IP地址"`
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export const schemas = ref<FormSchema[]>([
|
|||||||
field: 'account',
|
field: 'account',
|
||||||
component: 'NInput',
|
component: 'NInput',
|
||||||
label: '账号',
|
label: '账号',
|
||||||
componentProps: { placeholder: '请输入脱敏账号' },
|
componentProps: { placeholder: '请输入账号' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'failureType',
|
field: 'failureType',
|
||||||
@@ -66,7 +66,7 @@ export const schemas = ref<FormSchema[]>([
|
|||||||
export const columns = [
|
export const columns = [
|
||||||
{ title: 'ID', key: 'id', width: 90 },
|
{ title: 'ID', key: 'id', width: 90 },
|
||||||
{ title: '用户ID', key: 'userId', width: 130 },
|
{ title: '用户ID', key: 'userId', width: 130 },
|
||||||
{ title: '账号', key: 'accountMask', width: 170 },
|
{ title: '账号', key: 'accountMask', width: 200 },
|
||||||
{
|
{
|
||||||
title: '失败类型',
|
title: '失败类型',
|
||||||
key: 'failureType',
|
key: 'failureType',
|
||||||
|
|||||||
@@ -543,8 +543,11 @@
|
|||||||
labelWidth: 90,
|
labelWidth: 90,
|
||||||
schemas,
|
schemas,
|
||||||
});
|
});
|
||||||
const loadTable = (res) => List({ ...searchFormRef.value?.formModel, ...res }),
|
// 表格挂载时自动请求早于租户默认值就绪(tenantId 尚为 0),此时跳过请求,由 onMounted 的 reloadAll 加载首屏
|
||||||
loadIPTable = (res) => IPRuleList({ tenantId: tenantId(), ...res });
|
const loadTable = (res) =>
|
||||||
|
tenantId() ? List({ ...searchFormRef.value?.formModel, ...res }) : Promise.resolve({}),
|
||||||
|
loadIPTable = (res) =>
|
||||||
|
tenantId() ? IPRuleList({ tenantId: tenantId(), ...res }) : Promise.resolve({});
|
||||||
const reloadAll = () => {
|
const reloadAll = () => {
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
ipTableRef.value?.reload();
|
ipTableRef.value?.reload();
|
||||||
|
|||||||
@@ -206,7 +206,11 @@
|
|||||||
labelWidth: 90,
|
labelWidth: 90,
|
||||||
schemas,
|
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 reload = () => tableRef.value?.reload();
|
||||||
const actionColumn = reactive({
|
const actionColumn = reactive({
|
||||||
width: 150,
|
width: 150,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export const schemas = ref<FormSchema[]>([
|
|||||||
field: 'account',
|
field: 'account',
|
||||||
component: 'NInput',
|
component: 'NInput',
|
||||||
label: '账号',
|
label: '账号',
|
||||||
componentProps: { placeholder: '请输入手机号/脱敏账号' },
|
componentProps: { placeholder: '请输入账号' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'loginType',
|
field: 'loginType',
|
||||||
@@ -77,7 +77,7 @@ export const columns = [
|
|||||||
{ title: 'ID', key: 'id', width: 90 },
|
{ title: 'ID', key: 'id', width: 90 },
|
||||||
{ title: '用户ID', key: 'userId', width: 130 },
|
{ title: '用户ID', key: 'userId', width: 130 },
|
||||||
{ title: '用户名', key: 'username', width: 150 },
|
{ title: '用户名', key: 'username', width: 150 },
|
||||||
{ title: '账号', key: 'accountMask', width: 170 },
|
{ title: '账号', key: 'accountMask', width: 200 },
|
||||||
{
|
{
|
||||||
title: '登录方式',
|
title: '登录方式',
|
||||||
key: 'loginType',
|
key: 'loginType',
|
||||||
|
|||||||
@@ -290,7 +290,9 @@
|
|||||||
labelWidth: 90,
|
labelWidth: 90,
|
||||||
schemas,
|
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 currentTenantId = () => Number(searchFormRef.value?.formModel?.tenantId || 0);
|
||||||
const reloadTable = () => {
|
const reloadTable = () => {
|
||||||
actionRef.value?.reload();
|
actionRef.value?.reload();
|
||||||
|
|||||||
Reference in New Issue
Block a user