付智勇

身份证号验证

@@ -182,9 +182,11 @@ userController.prototype.updatePwByTelphone = async(ctx, next) =>{ @@ -182,9 +182,11 @@ userController.prototype.updatePwByTelphone = async(ctx, next) =>{
182 return {code:500,msg:'验证码错误'}; 182 return {code:500,msg:'验证码错误'};
183 }else if(!password){ 183 }else if(!password){
184 return {code:501,msg:'密码不能为空'}; 184 return {code:501,msg:'密码不能为空'};
  185 + }else if(!IDcard){
  186 + return {code:502,msg:'身份证号不能为空'};
185 } 187 }
186 - let updatePW = await userService.updatePwByTelphone(telephone,code,pw)  
187 - return {code:redisCode} 188 + let updatePW = await userService.updatePwByTelphone(telephone,pw)
  189 + return updatePW;
188 } 190 }
189 191
190 module.exports = new userController(); 192 module.exports = new userController();
@@ -25,9 +25,9 @@ @@ -25,9 +25,9 @@
25 25
26 body 26 body
27 { 27 {
28 - "loginName": "尼安德特",  
29 - "password": "123456",  
30 - "companyName":"bat", 28 + "loginName": "尼安德特", // 登录名
  29 + "password": "123456", //登录密码
  30 + "companyName":"bat", //
31 "userName":"尼安德特人", 31 "userName":"尼安德特人",
32 "userRole":0, 32 "userRole":0,
33 "userEmail":"kengni@buyouyu.com", 33 "userEmail":"kengni@buyouyu.com",
@@ -38,11 +38,26 @@ @@ -38,11 +38,26 @@
38 返回参数: 38 返回参数:
39 39
40 { 40 {
41 - "id": "XWBreEM4OK0a5jQB2Q1bpkNlyq9AVmvd",// 用户ID  
42 - "createTime": "2017-08-22T08:51:59.000Z", //创建时间  
43 - "endTime": "2017-08-22T08:51:59.000Z",  
44 - "loginName": "admin", //登录名  
45 - "userType": 1 // 用户类型 41 + "code": 200,
  42 + "returnData": {
  43 + "data": {
  44 + "id": "agoXryE96Jp4DbqXdqLB17MKzYV0meRw",
  45 + "createTime": "2017-08-28T02:47:34.000Z",
  46 + "loginName": "尼安德特3",
  47 + "password": "9f3d53742f6ac4ec14ee0e06a1e21478",
  48 + "companyName": "bat",
  49 + "userName": "尼安德特人",
  50 + "IDcard": "23123",
  51 + "salt": 69,
  52 + "userType": 1,
  53 + "userRole": 0,
  54 + "userEmail": "kengn1i@bu2youy1u.com",
  55 + "userMobile": 123211524,
  56 + "content": "2017-09-01",
  57 + "endTime": null,
  58 + "groupId": 1
  59 + }
  60 + }
46 } 61 }
47 62
48 ### 用户登录 63 ### 用户登录
@@ -13,7 +13,8 @@ router.post('/addUser',async (ctx, next) => { @@ -13,7 +13,8 @@ router.post('/addUser',async (ctx, next) => {
13 var data = await userContoller.addUser(ctx, next); 13 var data = await userContoller.addUser(ctx, next);
14 status.successTemp(ctx,200,data); 14 status.successTemp(ctx,200,data);
15 }catch(e){ 15 }catch(e){
16 - status.catchError(400,e.message); 16 + console.log(e)
  17 + status.catchError(ctx,400,e.message);
17 } 18 }
18 }) 19 })
19 20