mirror of https://github.com/1Panel-dev/1Panel
fix: 修改数据库密码校验规则 (#1815)
parent
d34e7492e1
commit
c7e7629d85
|
@ -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 {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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],
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<el-form-item
|
||||
:label="$t('commons.login.password')"
|
||||
prop="password"
|
||||
:rules="Rules.requiredInput"
|
||||
:rules="Rules.paramComplexity"
|
||||
>
|
||||
<el-input
|
||||
type="password"
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue