Commit 23a3241f1a54ed352cbea47da61a10f0cb7271e9

Authored by landong2015
1 parent 5879c03e2e
Exists in master

提交代码

Showing 1 changed file with 4 additions and 8 deletions

webApi/src/main/java/com/lyms/yimiao/web/controller/v1/UserController.java View file @ 23a3241
... ... @@ -81,13 +81,11 @@
81 81 @RequestParam("code") String code) {
82 82  
83 83 LoginContext result = LoginUtil.login(phone, code, typeId, token);
84   -
  84 + Map<String, Object> map = new HashMap<>();
  85 + map.put("errorcode", result.getErrorcode());
  86 + map.put("errormsg", result.getErrormsg());
85 87 //登陆的同时,在数据库创建账号,对手机号唯一性判断
86 88 if (result.getToken()!=null){
87   - Map<String, Object> map = new HashMap<>();
88   - map.put("errorcode", result.getErrorcode());
89   - map.put("errormsg", result.getErrormsg());
90   -
91 89 YmUsersQuery query = new YmUsersQuery();
92 90 query.setPhone(phone);
93 91 query.setYn(YnEnum.yes.getId());
94 92  
... ... @@ -109,10 +107,8 @@
109 107 map.put("token", result.getToken());
110 108 map.put("id", users.getId());
111 109 }
112   - writeJson(response, JsonUtil.obj2JsonString(map));
113   - }else {
114   - ResultUtils.buildParameterErrorResultAndWrite(response,"登陆失败,异常");
115 110 }
  111 + writeJson(response, JsonUtil.obj2JsonString(map));
116 112 }
117 113  
118 114 //暫時獲取token接口