mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-23 03:36:30 +00:00
fix(plans): frontend validation for price > 0 and validity_days >= 1
This commit is contained in:
@@ -1 +1 @@
|
||||
0.1.110.36
|
||||
0.1.110.37
|
||||
|
||||
@@ -5413,6 +5413,8 @@ export default {
|
||||
tabUserSubs: 'User Subscriptions',
|
||||
selectGroup: 'Select a group',
|
||||
groupRequired: 'Please select a subscription group',
|
||||
priceRequired: 'Price must be greater than 0',
|
||||
validityDaysRequired: 'Validity days must be greater than 0',
|
||||
groupMissing: 'Missing',
|
||||
groupInfo: 'Group Info',
|
||||
platform: 'Platform',
|
||||
|
||||
@@ -5608,6 +5608,8 @@ export default {
|
||||
tabUserSubs: '用户订阅',
|
||||
selectGroup: '请选择分组',
|
||||
groupRequired: '请选择订阅分组',
|
||||
priceRequired: '价格必须大于 0',
|
||||
validityDaysRequired: '有效期天数必须大于 0',
|
||||
groupMissing: '缺失',
|
||||
groupInfo: '分组信息',
|
||||
platform: '平台',
|
||||
|
||||
@@ -281,6 +281,14 @@ async function handleSavePlan() {
|
||||
appStore.showError(t('payment.admin.groupRequired'))
|
||||
return
|
||||
}
|
||||
if (!planForm.price || planForm.price <= 0) {
|
||||
appStore.showError(t('payment.admin.priceRequired'))
|
||||
return
|
||||
}
|
||||
if (!planForm.validity_days || planForm.validity_days < 1) {
|
||||
appStore.showError(t('payment.admin.validityDaysRequired'))
|
||||
return
|
||||
}
|
||||
planSaving.value = true
|
||||
try {
|
||||
const data = buildPlanPayload()
|
||||
|
||||
Reference in New Issue
Block a user