fix(后台会员): 每期泥点改为提交前校验

- AdminMembershipPlanPage.tsx:非 normal 档位要求每期泥点大于 0,不再等后端返回笼统目录错误

Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
2026-10-03 14:59:24 +08:00
parent 7dd26b9cda
commit 58e07ba282
@@ -110,11 +110,16 @@ export function AdminMembershipPlanPage({
const normalizedYearPriceCents = parsePositiveInteger(yearPriceCents);
const normalizedConcurrentJobLimit =
parsePositiveInteger(concurrentJobLimit);
const normalizedPeriodPoints = parsePositiveInteger(periodPoints);
if (plan !== 'normal') {
if (!normalizedMonthPriceCents || !normalizedYearPriceCents) {
setErrorMessage('月价与年价必须是大于 0 的整数分');
return;
}
if (!normalizedPeriodPoints) {
setErrorMessage('每期泥点必须是大于 0 的整数');
return;
}
if (!normalizedConcurrentJobLimit) {
setErrorMessage(
`并发上限必须是大于 0 的整数;${UNLIMITED_CONCURRENT_JOB_LIMIT} 表示不设上限`,
@@ -138,7 +143,7 @@ export function AdminMembershipPlanPage({
title: title.trim(),
monthPriceCents: normalizedMonthPriceCents,
yearPriceCents: normalizedYearPriceCents,
periodPoints: parsePositiveInteger(periodPoints),
periodPoints: normalizedPeriodPoints,
modelAccess,
concurrentJobLimit: normalizedConcurrentJobLimit,
enabled,