Commit dcc59b63 authored by zhouqian's avatar zhouqian

修复一个bug

parent a00bbabe
......@@ -588,4 +588,20 @@ public class InnerController implements IBaseController {
return JsonResult.buildErrorStateResult("用户密码重置失败.", null);
}
@RequestMapping("/user/register")
public JsonResult register(String phoneNo, String password, Long channelId) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult("手机号不正确", null);
}
User user = userService.findByPhoneInDb(phoneNo);
if (user == null) {
user = userService.registerAndReturn(phoneNo, StringUtils.defaultString(password, ""), channelId);
}
if (user == null) {
return JsonResult.buildErrorStateResult("注册失败", null);
}
return JsonResult.buildSuccessResult(null, UserRet.getUserRet(user));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment