Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xiaojie
fns_backend
Commits
727e62c0
Commit
727e62c0
authored
Nov 05, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 版本号只能输入数字
parent
107aaf1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
index.ts
src/views/Root/VersionControl/index.ts
+12
-9
No files found.
src/views/Root/VersionControl/index.ts
View file @
727e62c0
...
...
@@ -132,16 +132,19 @@ export const versionCodeFieldConfig = {
{
required
:
true
,
message
:
'请输入版本号'
},
{
validator
(
rule
:
string
,
value
:
string
,
callback
:
Function
)
{
const
osType
=
store
.
state
.
VersionControl
?.
form
.
osType
if
(
osType
===
eOsType
.
ios
)
{
value
.
match
(
/^
\d
+
\.\d
+
\.\d
+$/
)
value
.
match
(
/^
\d
+$/
)
?
callback
()
:
callback
(
new
Error
(
'苹果请输入x.x.x格式的版本号'
))
}
else
if
(
osType
===
eOsType
.
android
)
{
value
.
match
(
/^
\d
+$/
)
?
callback
()
:
callback
(
new
Error
(
'安卓请输入数字格式的版本号'
))
}
:
callback
(
new
Error
(
'请输入数字格式的版本号'
))
// const osType = store.state.VersionControl?.form.osType
// if (osType === eOsType.ios) {
// value.match(/^\d+\.\d+\.\d+$/)
// ? callback()
// : callback(new Error('苹果请输入x.x.x格式的版本号'))
// } else if (osType === eOsType.android) {
// value.match(/^\d+$/)
// ? callback()
// : callback(new Error('安卓请输入数字格式的版本号'))
// }
},
},
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment