mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-12 09:11:53 +08:00
1. code review 后台的短信验证码登陆
2. 解决 SQL Server LIMIT 1 存在报错的问题
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.auth;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.auth.vo.*;
|
||||
import cn.iocoder.yudao.module.member.service.auth.MemberAuthService;
|
||||
@@ -35,7 +34,6 @@ public class AppAuthController {
|
||||
@ApiOperation("使用手机 + 密码登录")
|
||||
public CommonResult<AppAuthLoginRespVO> login(@RequestBody @Valid AppAuthLoginReqVO reqVO) {
|
||||
String token = authService.login(reqVO, getClientIP(), getUserAgent());
|
||||
// 返回结果
|
||||
return success(AppAuthLoginRespVO.builder().token(token).build());
|
||||
}
|
||||
|
||||
@@ -49,7 +47,7 @@ public class AppAuthController {
|
||||
|
||||
@PostMapping("/send-sms-code")
|
||||
@ApiOperation(value = "发送手机验证码")
|
||||
public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid AppAuthSendSmsReqVO reqVO) {
|
||||
public CommonResult<Boolean> sendSmsCode(@RequestBody @Valid AppAuthSmsSendReqVO reqVO) {
|
||||
authService.sendSmsCode(getLoginUserId(), reqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
@@ -10,10 +10,10 @@ import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("用户 APP - 发送手机验证码 Response VO")
|
||||
@ApiModel("用户 APP - 发送手机验证码 Request VO")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class AppAuthSendSmsReqVO {
|
||||
public class AppAuthSmsSendReqVO {
|
||||
|
||||
@ApiModelProperty(value = "手机号", example = "15601691234")
|
||||
@Mobile
|
@@ -31,7 +31,7 @@ public interface AuthConvert {
|
||||
SocialUserBindReqDTO convert(Long userId, Integer userType, AppAuthSocialQuickLoginReqVO reqVO);
|
||||
SocialUserUnbindReqDTO convert(Long userId, Integer userType, AppSocialUserUnbindReqVO reqVO);
|
||||
|
||||
SmsCodeSendReqDTO convert(AppAuthSendSmsReqVO reqVO);
|
||||
SmsCodeSendReqDTO convert(AppAuthSmsSendReqVO reqVO);
|
||||
SmsCodeUseReqDTO convert(AppAuthResetPasswordReqVO reqVO, SmsSceneEnum scene, String usedIp);
|
||||
SmsCodeUseReqDTO convert(AppAuthSmsLoginReqVO reqVO, Integer scene, String usedIp);
|
||||
|
||||
|
@@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.member.service.auth;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.service.SecurityAuthFrameworkService;
|
||||
import cn.iocoder.yudao.module.member.controller.app.auth.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserBindReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserUnbindReqVO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@@ -36,7 +34,6 @@ public interface MemberAuthService extends SecurityAuthFrameworkService {
|
||||
*/
|
||||
String smsLogin(@Valid AppAuthSmsLoginReqVO reqVO, String userIp, String userAgent);
|
||||
|
||||
|
||||
/**
|
||||
* 社交登录,使用 code 授权码
|
||||
*
|
||||
@@ -85,6 +82,6 @@ public interface MemberAuthService extends SecurityAuthFrameworkService {
|
||||
* @param userId 用户编号
|
||||
* @param reqVO 发送信息
|
||||
*/
|
||||
void sendSmsCode(Long userId, AppAuthSendSmsReqVO reqVO);
|
||||
void sendSmsCode(Long userId, AppAuthSmsSendReqVO reqVO);
|
||||
|
||||
}
|
||||
|
@@ -288,7 +288,7 @@ public class MemberAuthServiceImpl implements MemberAuthService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSmsCode(Long userId, AppAuthSendSmsReqVO reqVO) {
|
||||
public void sendSmsCode(Long userId, AppAuthSmsSendReqVO reqVO) {
|
||||
// TODO 要根据不同的场景,校验是否有用户
|
||||
smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO).setCreateIp(getClientIP()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user