|
@ -17,6 +17,9 @@ import io.renren.modules.app.service.SmsCodeService;
|
17
|
17
|
import io.renren.modules.app.service.UserService;
|
18
|
18
|
import io.swagger.annotations.Api;
|
19
|
19
|
import io.swagger.annotations.ApiOperation;
|
|
20
|
|
|
21
|
import java.util.Map;
|
|
22
|
|
20
|
23
|
import org.springframework.beans.factory.annotation.Autowired;
|
21
|
24
|
import org.springframework.web.bind.annotation.PostMapping;
|
22
|
25
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@ -43,9 +46,14 @@ public class AppRegisterController {
|
43
|
46
|
* 注册短信验证码
|
44
|
47
|
*/
|
45
|
48
|
@PostMapping("/mobilecode")
|
46
|
|
public R mobileCode(String uuid, String phone) {
|
|
49
|
public R mobileCode(@RequestBody Map<String, Object> params) {
|
|
50
|
String uuid = (String) params.get("uuid");
|
|
51
|
String phone = (String) params.get("phone");
|
|
52
|
|
47
|
53
|
Assert.isNotPhone(phone);
|
48
|
54
|
|
|
55
|
Assert.isBlank(uuid, "uuid不能为空");
|
|
56
|
|
49
|
57
|
UserEntity user = userService.queryByUsername(phone);
|
50
|
58
|
if (user != null) {
|
51
|
59
|
return R.error("手机号已注册");
|
|
@ -84,7 +92,10 @@ public class AppRegisterController {
|
84
|
92
|
* 找回密码短信验证码
|
85
|
93
|
*/
|
86
|
94
|
@PostMapping("/phonecode")
|
87
|
|
public R phoneCode(String uuid, String phone) {
|
|
95
|
public R phoneCode(@RequestBody Map<String, Object> params) {
|
|
96
|
String uuid = (String) params.get("uuid");
|
|
97
|
String phone = (String) params.get("phone");
|
|
98
|
|
88
|
99
|
UserEntity user = userService.queryByUsername(phone);
|
89
|
100
|
if (user == null) {
|
90
|
101
|
return R.error("手机号未注册");
|