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

@@ -20,7 +20,7 @@ The admin frontend SHALL provide a bulk purchase form that binds one uploaded ba
#### Scenario: Hide voucher upload for wallet payment #### Scenario: Hide voucher upload for wallet payment
- **GIVEN** 用户选择代理钱包支付 - **GIVEN** 用户选择代理预存款支付
- **WHEN** 页面渲染或提交批量订购表单 - **WHEN** 页面渲染或提交批量订购表单
- **THEN** 页面 MUST NOT submit a voucher file - **THEN** 页面 MUST NOT submit a voucher file
- **AND** 页面 MUST clear or ignore a voucher selected before switching to wallet payment - **AND** 页面 MUST clear or ignore a voucher selected before switching to wallet payment

View File

@@ -10,7 +10,7 @@
- [x] 2.1 新增批量订购入口和表单,支持选择代理商、支付方式和 Excel 文件。 - [x] 2.1 新增批量订购入口和表单,支持选择代理商、支付方式和 Excel 文件。
- [x] 2.2 提供前端静态 Excel 模板下载,并限制上传文件类型和必要的文件状态。 - [x] 2.2 提供前端静态 Excel 模板下载,并限制上传文件类型和必要的文件状态。
- [x] 2.3 线下支付时显示整批支付凭证上传,钱包支付时隐藏或清理凭证字段。 - [x] 2.3 线下支付时显示整批支付凭证上传,预存款支付时隐藏或清理凭证字段。
- [x] 2.4 复用订单列表已有 `VoucherUpload` 组件展示凭证上传进度,上传未完成时禁止创建任务。 - [x] 2.4 复用订单列表已有 `VoucherUpload` 组件展示凭证上传进度,上传未完成时禁止创建任务。
- [x] 2.5 创建请求携带 `shop_id`、`payment_method`、`file`、必要的 `voucher_file` 和 `request_id`。 - [x] 2.5 创建请求携带 `shop_id`、`payment_method`、`file`、必要的 `voucher_file` 和 `request_id`。
- [x] 2.6 防止重复点击和重复提交,创建成功后保存 `task_id` 并进入任务详情。 - [x] 2.6 防止重复点击和重复提交,创建成功后保存 `task_id` 并进入任务详情。

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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