fix: 密码长度限制
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 55s

This commit is contained in:
luo
2026-09-29 16:40:31 +08:00
parent aec2a27a65
commit d02ce01f6a
8 changed files with 19 additions and 11 deletions

View File

@@ -242,7 +242,7 @@
)
const paymentMethodLabel = computed(() => {
const labels = {
wallet: '钱包支付',
wallet: '预存款支付',
wechat: '微信支付',
alipay: '支付宝支付',
offline: '线下支付'

View File

@@ -20,6 +20,7 @@
v-model="formData.old_password"
type="password"
autocomplete="current-password"
maxlength="32"
show-password
:disabled="submitting"
/>
@@ -29,6 +30,7 @@
v-model="formData.new_password"
type="password"
autocomplete="new-password"
maxlength="32"
show-password
:disabled="submitting"
/>
@@ -38,6 +40,7 @@
v-model="formData.confirm_password"
type="password"
autocomplete="new-password"
maxlength="32"
show-password
:disabled="submitting"
@keyup.enter="handleSubmit"
@@ -87,13 +90,16 @@
const formRules = computed<FormRules>(() => ({
old_password: [
{ required: true, message: t('passwordChange.oldPasswordRequired'), trigger: 'blur' }
{ required: true, message: t('passwordChange.oldPasswordRequired'), trigger: 'blur' },
{ min: 8, max: 32, message: t('passwordChange.passwordLength'), trigger: 'blur' }
],
new_password: [
{ required: true, message: t('passwordChange.newPasswordRequired'), trigger: 'blur' }
{ required: true, message: t('passwordChange.newPasswordRequired'), trigger: 'blur' },
{ min: 8, max: 32, message: t('passwordChange.passwordLength'), trigger: 'blur' }
],
confirm_password: [
{ required: true, message: t('passwordChange.confirmPasswordRequired'), trigger: 'blur' },
{ min: 8, max: 32, message: t('passwordChange.passwordLength'), trigger: 'blur' },
{
validator: (_rule, value: string, callback) => {
if (value && value !== formData.new_password) {

View File

@@ -26,6 +26,7 @@
"oldPasswordRequired": "Please enter your current password",
"newPasswordRequired": "Please enter a new password",
"confirmPasswordRequired": "Please enter the new password again",
"passwordLength": "Password must be 8-32 characters",
"passwordMismatch": "The new passwords do not match",
"submit": "Change password",
"success": "Password changed successfully",

View File

@@ -27,6 +27,7 @@
"oldPasswordRequired": "请输入当前密码",
"newPasswordRequired": "请输入新密码",
"confirmPasswordRequired": "请再次输入新密码",
"passwordLength": "密码长度需为8-32位",
"passwordMismatch": "两次输入的新密码不一致",
"submit": "确认修改",
"success": "密码修改成功",

View File

@@ -71,12 +71,12 @@
style="width: 100%"
:disabled="selectedPackageIsGift"
>
<ElOption v-if="!selectedPackageIsGift" label="钱包支付" value="wallet" />
<ElOption v-if="!selectedPackageIsGift" label="预存款支付" value="wallet" />
<ElOption v-if="showOfflinePayment" label="线下支付" value="offline" />
</ElSelect>
<div style="margin-top: 8px; font-size: 12px; color: var(--el-text-color-secondary)">
<template v-if="form.payment_method === 'wallet'">
提示: 使用钱包支付时,订单将直接完成
提示: 使用预存款支付时,订单将直接完成
</template>
<template v-else-if="form.payment_method === 'offline'">
提示: 线下支付订单需要手动确认支付

View File

@@ -184,7 +184,7 @@
style="width: 100%"
:disabled="selectedPackageIsGift"
>
<ElOption v-if="!selectedPackageIsGift" label="钱包支付" value="wallet" />
<ElOption v-if="!selectedPackageIsGift" label="预存款支付" value="wallet" />
<!-- 只有平台用户(user_type 1:超级管理员, 2:平台用户)才显示线下支付选项 -->
<ElOption
v-if="userStore.info.user_type === 1 || userStore.info.user_type === 2"
@@ -194,7 +194,7 @@
</ElSelect>
<div style="margin-top: 8px; font-size: 12px; color: var(--el-text-color-secondary)">
<template v-if="createForm.payment_method === 'wallet'">
提示: 使用钱包支付时,订单将直接完成
提示: 使用预存款支付时,订单将直接完成
</template>
<template v-else-if="createForm.payment_method === 'offline'">
{{
@@ -427,7 +427,7 @@
type: 'select',
placeholder: '请选择支付方式',
options: [
{ label: '钱包支付', value: 'wallet' },
{ label: '预存款支付', value: 'wallet' },
{ label: '微信支付', value: 'wechat' },
{ label: '支付宝支付', value: 'alipay' },
{ label: '线下支付', value: 'offline' }
@@ -600,7 +600,7 @@
iot_card_series_id: null as number | null, // IoT卡的套餐系列ID
device_id: null as number | null,
device_series_id: null as number | null, // 设备的套餐系列ID
payment_method: 'wallet' as OrderPaymentMethod, // 默认使用钱包支付
payment_method: 'wallet' as OrderPaymentMethod, // 默认使用预存款支付
payment_voucher_key: [] as string[] // 线下支付凭证
})