Merge pull request #13750 from dataease/pr@dev-v2@perf_login_limit_validate

perf(X-Pack): 登录限制-表单验证
This commit is contained in:
dataeaseShu 2024-12-03 09:57:03 +08:00 committed by GitHub
commit d71096e2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 12 deletions

View File

@ -28,7 +28,14 @@ const pvpOptions = [
{ value: '3', label: t('commons.date.three_months') }, { value: '3', label: t('commons.date.three_months') },
{ value: '4', label: t('commons.date.one_month') } { value: '4', label: t('commons.date.one_month') }
] ]
const requireKeys = [
'logLiveTime',
'thresholdLogLiveTime',
'exportFileLiveTime',
'frontTimeOut',
'loginLimitTime',
'loginLimitRate'
]
const state = reactive({ const state = reactive({
form: reactive({ form: reactive({
dsIntervalTime: '30', dsIntervalTime: '30',
@ -166,16 +173,7 @@ const edit = (
state.openOptions = openOptions || [] state.openOptions = openOptions || []
state.settingList = list.map(item => { state.settingList = list.map(item => {
const pkey = item.pkey const pkey = item.pkey
if (pkey === 'basic.logLiveTime' || pkey === 'basic.thresholdLogLiveTime') { if (requireKeys.some(requireKey => `basic.${requireKey}` === pkey)) {
rule[pkey.split('.')[1]] = [
{
required: true,
message: t('common.require'),
trigger: ['blur', 'change']
}
]
}
if (pkey === 'basic.exportFileLiveTime' || pkey === 'basic.frontTimeOut') {
rule[pkey.split('.')[1]] = [ rule[pkey.split('.')[1]] = [
{ {
required: true, required: true,

@ -1 +1 @@
Subproject commit 6b084968357d809d46b9b6f2bc2c2fa787f28f6e Subproject commit 3bc8d0b3767818d5ba49f13b7b72b7e82b4e2c27