Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -871,7 +871,7 @@ const onPublish = async () => { | ... | @@ -871,7 +871,7 @@ const onPublish = async () => { |
| 871 | * @returns {boolean} 是否为有效的价格格式 | 871 | * @returns {boolean} 是否为有效的价格格式 |
| 872 | */ | 872 | */ |
| 873 | const isValidPrice = (price) => { | 873 | const isValidPrice = (price) => { |
| 874 | - if (!price || price.trim() === '') return false | 874 | + if (!price || price.toString().trim() === '') return false |
| 875 | // 正则表达式:匹配数字和小数点,允许小数 | 875 | // 正则表达式:匹配数字和小数点,允许小数 |
| 876 | const priceRegex = /^\d+(\.\d+)?$/ | 876 | const priceRegex = /^\d+(\.\d+)?$/ |
| 877 | return priceRegex.test(price.toString().trim()) | 877 | return priceRegex.test(price.toString().trim()) | ... | ... |
-
Please register or login to post a comment