Skip to content

Commit

Permalink
fix: 修改数据库密码校验规则 (#1815)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu authored Aug 3, 2023
1 parent d34e749 commit c7e7629
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion frontend/src/global/form-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/mysql/conn/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/mysql/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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],
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/database/mysql/password/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<el-form-item
:label="$t('commons.login.password')"
prop="password"
:rules="Rules.requiredInput"
:rules="Rules.paramComplexity"
>
<el-input
type="password"
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/views/database/redis/password/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -73,6 +73,7 @@ const loading = ref(false);
const dialogVisiable = ref(false);
const form = ref<App.DatabaseConnInfo>({
privilege: false,
password: '',
serviceName: '',
port: 0,
Expand Down

0 comments on commit c7e7629

Please sign in to comment.