Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
jgdl
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-07-15 14:07:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
91fe35449a9e748774dcb5a659c5fe051195a8d1
91fe3544
1 parent
45fe8c1d
fix(价格验证): 处理非字符串类型的价格输入
确保价格验证函数能够正确处理非字符串类型的输入,如数字类型
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
src/pages/sell/index.vue
src/pages/sell/index.vue
View file @
91fe354
...
...
@@ -871,7 +871,7 @@ const onPublish = async () => {
* @returns {boolean} 是否为有效的价格格式
*/
const isValidPrice = (price) => {
if (!price || price.trim() === '') return false
if (!price || price.t
oString().t
rim() === '') return false
// 正则表达式:匹配数字和小数点,允许小数
const priceRegex = /^\d+(\.\d+)?$/
return priceRegex.test(price.toString().trim())
...
...
Please
register
or
login
to post a comment