记得上下班打卡 | git大法好,push需谨慎

Commit ad5c96e3 authored by 张国柄's avatar 张国柄

~opt;

parent b6dc972f
...@@ -33,6 +33,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -33,6 +33,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -474,7 +475,7 @@ public class AdamUserController { ...@@ -474,7 +475,7 @@ public class AdamUserController {
}) })
@GetMapping(value = "info/identity") @GetMapping(value = "info/identity")
public ResponseDto<AdamUserIdentityInfoVo> identityInfoByMobile(@Pattern(regexp = "\\d{11}", message = "手机号格式有误") public ResponseDto<AdamUserIdentityInfoVo> identityInfoByMobile(@Pattern(regexp = "\\d{11}", message = "手机号格式有误")
@RequestParam(name = "mobile", required = false) String mobile) { @RequestParam(required = false) String mobile) {
String uid = null == mobile ? CurrentUtil.getCurrentUid() : adamRdmService.getUidByMobile(mobile); String uid = null == mobile ? CurrentUtil.getCurrentUid() : adamRdmService.getUidByMobile(mobile);
AdamUserInfoVo userInfoVo; AdamUserInfoVo userInfoVo;
if (uid == null || null == (userInfoVo = adamRdmService.getUserInfoVoByUid(uid))) { if (uid == null || null == (userInfoVo = adamRdmService.getUserInfoVoByUid(uid))) {
...@@ -498,7 +499,7 @@ public class AdamUserController { ...@@ -498,7 +499,7 @@ public class AdamUserController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mobile", value = "手机号[用于验证当前账户所绑定手机号]"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "mobile", value = "手机号[用于验证当前账户所绑定手机号]"),
}) })
@PostMapping(value = {"check/mobile"}) @PostMapping(value = {"check/mobile"})
public ResponseDto<Object> checkMobile(@Pattern(regexp = "\\d{11}", message = "手机号格式有误") @RequestParam String mobile) { public ResponseDto<Object> checkMobile(@NotBlank(message = "手机号不能为空") @Pattern(regexp = "\\d{11}", message = "手机号格式有误") @RequestParam String mobile) {
String currentMobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE); String currentMobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE);
return mobile.equals(currentMobile) ? ResponseDto.success() : ResponseDto.failure(ErrorMapping.get("10003")); return mobile.equals(currentMobile) ? ResponseDto.success() : ResponseDto.failure(ErrorMapping.get("10003"));
} }
......
...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -26,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
@ApiSupport(order = 141000) @ApiSupport(order = 141000)
...@@ -73,7 +74,7 @@ public class GoblinSmsController { ...@@ -73,7 +74,7 @@ public class GoblinSmsController {
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "验证码"), @ApiImplicitParam(type = "form", required = true, dataType = "String", name = "code", value = "验证码"),
}) })
@PostMapping(value = {"code/check"}) @PostMapping(value = {"code/check"})
public ResponseDto<Object> checkVerificationCode(@Pattern(regexp = "\\d{6}", message = "验证码格式有误") @RequestParam String code) { public ResponseDto<Object> checkVerificationCode(@NotBlank(message = "验证码不能为空") @Pattern(regexp = "\\d{6}", message = "验证码格式有误") @RequestParam String code) {
String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE); String mobile = (String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE);
if (!LnsEnum.ENV.prod.name().equals(env.getProperty(CurrentUtil.CK_ENV_ACTIVE))) { if (!LnsEnum.ENV.prod.name().equals(env.getProperty(CurrentUtil.CK_ENV_ACTIVE))) {
if (CurrentUtil.GRAY_LOGIN_SMS_CODE.equals(code)) return ResponseDto.success(); if (CurrentUtil.GRAY_LOGIN_SMS_CODE.equals(code)) return ResponseDto.success();
......
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