|
@@ -94,6 +94,10 @@ public class UserController {
|
|
|
responseResult.setCode(ResultCode.FAILED_COMMON);
|
|
responseResult.setCode(ResultCode.FAILED_COMMON);
|
|
|
responseResult.setMessage("注册失败");
|
|
responseResult.setMessage("注册失败");
|
|
|
|
|
|
|
|
|
|
+ if (registerMap == null) {
|
|
|
|
|
+ return JSON.toJSONString(responseResult);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String email = String.valueOf(registerMap.get("email"));
|
|
String email = String.valueOf(registerMap.get("email"));
|
|
|
String code = String.valueOf(registerMap.get("code"));
|
|
String code = String.valueOf(registerMap.get("code"));
|
|
|
String password = String.valueOf(registerMap.get("password"));
|
|
String password = String.valueOf(registerMap.get("password"));
|
|
@@ -232,11 +236,19 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@RequestMapping(value = "/api/password", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
|
|
@RequestMapping(value = "/api/password", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
- public String resetPassword(String email, String code, String password) {
|
|
|
|
|
|
|
+ public String resetPassword(@RequestBody Map<String, Object> forgetMap) {
|
|
|
ResponseResult<User> responseResult = new ResponseResult<User>();
|
|
ResponseResult<User> responseResult = new ResponseResult<User>();
|
|
|
responseResult.setCode(ResultCode.FAILED_COMMON);
|
|
responseResult.setCode(ResultCode.FAILED_COMMON);
|
|
|
responseResult.setMessage("密码重置失败");
|
|
responseResult.setMessage("密码重置失败");
|
|
|
|
|
|
|
|
|
|
+ if (forgetMap == null) {
|
|
|
|
|
+ return JSON.toJSONString(responseResult);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ String email = String.valueOf(forgetMap.get("email"));
|
|
|
|
|
+ String code = String.valueOf(forgetMap.get("code"));
|
|
|
|
|
+ String password = String.valueOf(forgetMap.get("password"));
|
|
|
|
|
+
|
|
|
// 从数据库查询,如果有这个email并且不在黑名单里,才可以继续
|
|
// 从数据库查询,如果有这个email并且不在黑名单里,才可以继续
|
|
|
User dbUser = userRepository.findUserByEmail(email);
|
|
User dbUser = userRepository.findUserByEmail(email);
|
|
|
if (dbUser == null) {
|
|
if (dbUser == null) {
|