fix: 修改数据库密码校验规则 (#1815)

pull/1817/head
ssongliu 2023-08-03 10:40:17 +08:00 committed by GitHub
parent d34e7492e1
commit c7e7629d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 5 deletions

View File

@ -72,7 +72,8 @@ const checkIllegal = (rule: any, value: any, callback: any) => {
value.indexOf("'") !== -1 ||
value.indexOf('`') !== -1 ||
value.indexOf('(') !== -1 ||
value.indexOf(')') !== -1
value.indexOf(')') !== -1 ||
value.indexOf("'") !== -1
) {
callback(new Error(i18n.global.t('commons.rule.illegalInput')));
} else {

View File

@ -26,7 +26,7 @@
<el-switch v-model="form.privilege" @change="onSaveAccess" />
<span class="input-help">{{ $t('database.remoteConnHelper') }}</span>
</el-form-item>
<el-form-item :label="$t('database.rootPassword')" :rules="Rules.requiredInput" prop="password">
<el-form-item :label="$t('database.rootPassword')" :rules="Rules.paramComplexity" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="onCopy(form.password)">{{ $t('commons.button.copy') }}</el-button>

View File

@ -97,7 +97,7 @@ const form = reactive({
const rules = reactive({
name: [Rules.requiredInput, Rules.dbName],
username: [Rules.requiredInput, Rules.name],
password: [Rules.requiredInput],
password: [Rules.paramComplexity],
permission: [Rules.requiredSelect],
permissionIPs: [Rules.requiredInput],
});

View File

@ -15,7 +15,7 @@
<el-form-item
:label="$t('commons.login.password')"
prop="password"
:rules="Rules.requiredInput"
:rules="Rules.paramComplexity"
>
<el-input
type="password"

View File

@ -6,7 +6,7 @@
<el-form @submit.prevent v-loading="loading" ref="formRef" :model="form" label-position="top">
<el-row type="flex" justify="center">
<el-col :span="22">
<el-form-item :label="$t('commons.login.password')" :rules="Rules.requiredInput" prop="password">
<el-form-item :label="$t('commons.login.password')" :rules="Rules.paramComplexity" prop="password">
<el-input type="password" show-password clearable v-model="form.password">
<template #append>
<el-button @click="onCopy(form.password)">{{ $t('commons.button.copy') }}</el-button>
@ -73,6 +73,7 @@ const loading = ref(false);
const dialogVisiable = ref(false);
const form = ref<App.DatabaseConnInfo>({
privilege: false,
password: '',
serviceName: '',
port: 0,