Browse Source

fix: 增加正整数正则校验

pull/201/head
ssongliu 2 years ago committed by ssongliu
parent
commit
26dd672522
  1. 3
      frontend/src/lang/modules/en.ts
  2. 3
      frontend/src/lang/modules/zh.ts
  3. 2
      frontend/src/views/setting/monitor/index.vue
  4. 5
      frontend/src/views/setting/panel/index.vue

3
frontend/src/lang/modules/en.ts

@ -131,12 +131,13 @@ export default {
simpleName: 'Support English, numbers and _ length 1-30',
dbName: 'Support English, Chinese, numbers, .-, and _ length 1-16',
imageName: 'Support English, numbers, :/.-_, length 1-150',
volumeName: 'Support English, numbers, .-_, length 1-30',
volumeName: 'Support English, numbers, .-_, length 2-30',
complexityPassword:
'Enter a password that is longer than eight characters and contains at least two letters, digits, and special characters',
commonPassword: 'Please enter a password with more than 6 characters',
email: 'Email format error',
number: 'Please enter the correct number',
integer: 'Please enter the correct positive integer',
ip: 'Please enter the correct IP address',
port: 'Please enter the correct port',
selectHelper: 'Please select the correct {0} file',

3
frontend/src/lang/modules/zh.ts

@ -135,12 +135,13 @@ export default {
simpleName: '支持英文数字_,长度1-30',
dbName: '支持英文中文数字.-_,长度1-16',
imageName: '支持英文数字:/.-_,长度1-150',
volumeName: '支持英文数字.-和_,长度1-30',
volumeName: '支持英文数字.-和_,长度2-30',
complexityPassword: '请输入长度大于 8 位且包含字母数字特殊字符至少两项的密码组合',
commonPassword: '请输入 6 位以上长度密码',
linuxName: '长度1-30名称不能含有{0}等符号',
email: '请输入正确的邮箱',
number: '请输入正确的数字',
integer: '请输入正确的正整数',
ip: '请输入正确的 IP 地址',
port: '请输入正确的端口,1-65535',
selectHelper: '请选择正确的 {0} 文件',

2
frontend/src/views/setting/monitor/index.vue

@ -20,7 +20,7 @@
</el-form-item>
<el-form-item
:label="$t('setting.storeDays')"
:rules="[Rules.number, checkNumberRange(1, 30)]"
:rules="[Rules.integerNumber, checkNumberRange(1, 30)]"
prop="monitorStoreDays"
>
<el-input clearable v-model.number="form.monitorStoreDays">

5
frontend/src/views/setting/panel/index.vue

@ -73,7 +73,7 @@
<el-form-item
:label="$t('setting.sessionTimeout')"
:rules="[Rules.number, checkNumberRange(300, 864000)]"
:rules="[Rules.integerNumber, checkNumberRange(300, 864000)]"
prop="sessionTimeout"
>
<el-input v-model.number="form.sessionTimeout">
@ -254,6 +254,9 @@ const onSave = async (formEl: FormInstance | undefined, key: string, val: any) =
globalStore.setLogStatus(false);
return;
}
if (param.key === 'Language') {
location.reload();
}
loading.value = false;
MsgSuccess(i18n.t('commons.msg.operationSuccess'));
search();

Loading…
Cancel
Save