Skip to content

Commit

Permalink
feat(frontend): 密码长度限制调整 #7031
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 21766
  • Loading branch information
JustaCattt authored and jinquantianxia committed Oct 24, 2024
1 parent ddc8207 commit 6044b9d
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@
:label-width="260"
:model="formData"
:rules="rules">
<DbCard
mode="collapse"
:title="t('密码组成设置')">
<DbCard :title="t('密码组成设置')">
<BkFormItem
:label="t('密码长度')"
required>
<BkInput
v-model="formData.min_length"
class="password-policy-number mr-6"
:max="defaultConfig.max_length"
:min="defaultConfig.min_length"
:max="formData.max_length"
:min="6"
type="number" />
<span class="password-policy-text">{{ t('至') }}</span>
<BkInput
v-model="formData.max_length"
class="password-policy-number ml-6"
:max="defaultConfig.max_length"
:min="defaultConfig.min_length"
:max="48"
:min="formData.min_length"
type="number" />
</BkFormItem>
<BkFormItem
Expand Down Expand Up @@ -103,7 +101,7 @@
v-model="formData.weak_password"
theme="primary" />
<span class="ml-10">
{{ t('开启后,不允许超过 x 位连续字符,如出现以下示例密码将无法通过检测', { x: defaultConfig.repeats }) }}
{{ t('开启后,不允许超过 x 位连续字符,如出现以下示例密码将无法通过检测', { x: formData.repeats }) }}
</span>
</div>
<ul class="password-policy-rules">
Expand Down Expand Up @@ -217,7 +215,6 @@
],
};

const defaultConfig = reactive(initData());
const formRef = ref();
const formData = reactive(initData());
const excludeContinuousRule = shallowRef({
Expand All @@ -237,7 +234,6 @@
const { id, name, rule } = data;
passwordPolicyData.id = id;
passwordPolicyData.name = name;
Object.assign(defaultConfig, rule);
Object.assign(formData, rule);
const { repeats } = rule;
excludeContinuousRule.value = {
Expand Down Expand Up @@ -298,7 +294,6 @@
};

const handleReset = () => {
Object.assign(formData, defaultConfig);
handleSubmit(true);
};
</script>
Expand Down

0 comments on commit 6044b9d

Please sign in to comment.