parent
1397ad8917
commit
d2e42a5cb6
|
|
@ -77,7 +77,7 @@ public class LoginController {
|
|||
@PostMapping("/mnpLogin")
|
||||
@ApiOperation(value="微信登录")
|
||||
public AjaxResult<LoginTokenVo> mnpLogin(@Validated @RequestBody LoginCodeValidate loginCodeValidate) {
|
||||
Integer terminal = LikeFrontThreadLocal.getTerminal();
|
||||
Integer terminal = ClientEnum.MNP.getCode();
|
||||
|
||||
String code = loginCodeValidate.getCode();
|
||||
|
||||
|
|
@ -145,4 +145,14 @@ public class LoginController {
|
|||
iUserService.bindOa(BindOaValidate, userId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/mnpAuthBind")
|
||||
@ApiOperation(value="绑定小程序")
|
||||
public AjaxResult<Object> mnpAuthBind(@Validated @RequestBody UserBindWechatValidate BindOaValidate) {
|
||||
Integer userId = LikeFrontThreadLocal.getUserId();
|
||||
iUserService.bindMnp(BindOaValidate, userId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,11 +347,21 @@ public class LoginServiceImpl implements ILoginService {
|
|||
*/
|
||||
private LoginTokenVo __wxLoginHandle(String openId, String unionId, String avatar, String nickname, Integer terminal) {
|
||||
// 查询授权
|
||||
UserAuth userAuth = userAuthMapper.selectOne(new QueryWrapper<UserAuth>()
|
||||
QueryWrapper queryWrapper = new QueryWrapper<UserAuth>();
|
||||
|
||||
if (StringUtils.equals(unionId, "0") == false) {
|
||||
queryWrapper = new QueryWrapper<UserAuth>()
|
||||
.nested(wq->wq
|
||||
.eq("unionid", unionId).or()
|
||||
.eq("openid", openId)
|
||||
).last("limit 1"));
|
||||
).last("limit 1");
|
||||
} else {
|
||||
queryWrapper = new QueryWrapper<UserAuth>()
|
||||
.nested(wq->wq
|
||||
.eq("openid", openId)
|
||||
).last("limit 1");
|
||||
}
|
||||
UserAuth userAuth = userAuthMapper.selectOne(queryWrapper);
|
||||
|
||||
// 查询用户
|
||||
User user = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue