fix: 充值金额用rules校验(min+number)替代无效的min属性 + 后端NaN防护
This commit is contained in:
parent
e17a9ac58b
commit
511f4b0720
@ -52,7 +52,10 @@
|
||||
"uitype": "float",
|
||||
"required": true,
|
||||
"placeholder": "输入充值金额",
|
||||
"min": 0.01,
|
||||
"rules": [
|
||||
{"type": "number", "message": "充值金额必须是有效数字"},
|
||||
{"type": "min", "value": 0.01, "message": "充值金额必须大于0"}
|
||||
],
|
||||
"cwidth": 20
|
||||
}
|
||||
]
|
||||
|
||||
@ -57,7 +57,7 @@ except (ValueError, TypeError):
|
||||
"options": {"text": "❌ 充值金额格式错误", "color": "#EF4444"}
|
||||
}
|
||||
|
||||
if amount <= 0:
|
||||
if amount != amount or amount <= 0:
|
||||
return {
|
||||
"widgettype": "Text",
|
||||
"options": {"text": "❌ 充值金额必须大于0", "color": "#EF4444"}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user