Compare commits
2 Commits
4808960491
...
37c0ac035e
| Author | SHA1 | Date | |
|---|---|---|---|
| 37c0ac035e | |||
| 977ca260da |
@@ -50,10 +50,10 @@ public class GlobalExceptionHandler {
|
|||||||
* 处理其他异常
|
* 处理其他异常
|
||||||
*/
|
*/
|
||||||
@ExceptionHandler(Exception.class)
|
@ExceptionHandler(Exception.class)
|
||||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
// @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||||
public Result<String> handleException(Exception e) {
|
public Result<String> handleException(Exception e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR.value(),
|
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR.value(),
|
||||||
I18nUtil.getMessage("error.server.internal", e.getMessage()));
|
e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -264,8 +264,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
}
|
}
|
||||||
|
|
||||||
String codeKey = String.format("verify_code:%s:%s", "forget", request.getAccount());
|
String codeKey = String.format("verify_code:%s:%s", "forget", request.getAccount());
|
||||||
String checkCode = redisUtil.get(codeKey).toString();
|
Object checkCode = redisUtil.get(codeKey);
|
||||||
if(!checkCode.equalsIgnoreCase(request.getVerificationCode())) {
|
|
||||||
|
if(checkCode == null || !request.getVerificationCode().equalsIgnoreCase(checkCode.toString())) {
|
||||||
throw new RuntimeException(I18nUtil.getMessage("error.verify.code.invalid"));
|
throw new RuntimeException(I18nUtil.getMessage("error.verify.code.invalid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user