Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
付智勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7499032b24c1b9e493a1a3568e79769cc41619b5
7499032b
1 parent
b8825404
身份证号验证
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
30 行增加
和
12 行删除
controller/userController.js
docs/api.md
routes/users.js
controller/userController.js
查看文件 @
7499032
...
...
@@ -182,9 +182,11 @@ userController.prototype.updatePwByTelphone = async(ctx, next) =>{
return
{
code
:
500
,
msg
:
'验证码错误'
};
}
else
if
(
!
password
){
return
{
code
:
501
,
msg
:
'密码不能为空'
};
}
else
if
(
!
IDcard
){
return
{
code
:
502
,
msg
:
'身份证号不能为空'
};
}
let
updatePW
=
await
userService
.
updatePwByTelphone
(
telephone
,
code
,
pw
)
return
{
code
:
redisCode
}
let
updatePW
=
await
userService
.
updatePwByTelphone
(
telephone
,
pw
)
return
updatePW
;
}
module
.
exports
=
new
userController
();
\ No newline at end of file
...
...
docs/api.md
查看文件 @
7499032
...
...
@@ -25,9 +25,9 @@
body
{
"loginName": "尼安德特",
"password": "123456",
"companyName":"bat",
"loginName": "尼安德特", // 登录名
"password": "123456", //登录密码
"companyName":"bat", //
"userName":"尼安德特人",
"userRole":0,
"userEmail":"kengni@buyouyu.com",
...
...
@@ -38,12 +38,27 @@
返回参数:
{
"id": "XWBreEM4OK0a5jQB2Q1bpkNlyq9AVmvd",// 用户ID
"createTime": "2017-08-22T08:51:59.000Z", //创建时间
"endTime": "2017-08-22T08:51:59.000Z",
"loginName": "admin", //登录名
"userType": 1 // 用户类型
}
"code": 200,
"returnData": {
"data": {
"id": "agoXryE96Jp4DbqXdqLB17MKzYV0meRw",
"createTime": "2017-08-28T02:47:34.000Z",
"loginName": "尼安德特3",
"password": "9f3d53742f6ac4ec14ee0e06a1e21478",
"companyName": "bat",
"userName": "尼安德特人",
"IDcard": "23123",
"salt": 69,
"userType": 1,
"userRole": 0,
"userEmail": "kengn1i@bu2youy1u.com",
"userMobile": 123211524,
"content": "2017-09-01",
"endTime": null,
"groupId": 1
}
}
}
### 用户登录
...
...
routes/users.js
查看文件 @
7499032
...
...
@@ -13,7 +13,8 @@ router.post('/addUser',async (ctx, next) => {
var
data
=
await
userContoller
.
addUser
(
ctx
,
next
);
status
.
successTemp
(
ctx
,
200
,
data
);
}
catch
(
e
){
status
.
catchError
(
400
,
e
.
message
);
console
.
log
(
e
)
status
.
catchError
(
ctx
,
400
,
e
.
message
);
}
})
...
...
请
注册
或
登录
后发表评论