手机号绑定微信
This commit is contained in:
@@ -206,4 +206,11 @@ public class AuthController {
|
||||
public CommonResult<Boolean> synchronize(@RequestBody @Valid UserReqVO reqVO) {
|
||||
return success(authService.synchronize(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/api/user-info")
|
||||
@PermitAll
|
||||
@Operation(summary = "手机号获取token")
|
||||
public CommonResult<AuthLoginRespVO> getUserInfo(@RequestBody @Valid UserReqVO reqVO) {
|
||||
return success(authService.getUserInfo(reqVO));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,4 +94,6 @@ public interface AdminAuthService {
|
||||
AuthLoginRespVO getPhoneNumber(@Valid WxLoginReqVO reqVO);
|
||||
|
||||
Boolean synchronize(@Valid UserReqVO reqVO);
|
||||
|
||||
AuthLoginRespVO getUserInfo(@Valid UserReqVO reqVO);
|
||||
}
|
||||
|
||||
@@ -385,6 +385,13 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuthLoginRespVO getUserInfo(UserReqVO reqVO) {
|
||||
AdminUserDO user = userService.getUserByMobile(reqVO.getPhone());
|
||||
// 创建 Token 令牌,记录登录日志
|
||||
return createTokenAfterLoginSuccess(user.getId(), reqVO.getPhone(), LoginLogTypeEnum.LOGIN_USERNAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密微信小程序数据
|
||||
* 根据微信官方文档:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html
|
||||
|
||||
Reference in New Issue
Block a user