Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nodejs-yitong-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Metrics
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
yitong-public
nodejs-yitong-sdk
Commits
6b490591
Commit
6b490591
authored
5 years ago
by
huhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加maxlength校验
parent
794efb5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
yitong-sdk.js
yitong-sdk.js
+8
-1
No files found.
yitong-sdk.js
View file @
6b490591
...
...
@@ -445,6 +445,12 @@ function notEmpty(value, message) {
validate
(
!!
value
,
message
);
}
function
maxlength
(
value
,
expected
,
message
)
{
if
(
value
)
{
validate
(
value
.
length
<=
expected
,
message
);
}
}
/**
* App扩展
*/
...
...
@@ -475,7 +481,8 @@ module.exports = {
validator
:
{
// 数据校验工具
gt
,
notEmpty
,
equal
equal
,
maxlength
},
extendApp
// koa扩展入口
};
...
...
This diff is collapsed.
Click to expand it.
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