| | |
| | | } |
| | | AuthRequest authRequest = SocialUtils.getAuthRequest(source, socialProperties); |
| | | String authorizeUrl = authRequest.authorize(AuthStateUtils.createState()); |
| | | return R.ok(authorizeUrl); |
| | | return R.ok("操作成功", authorizeUrl); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return 结果 |
| | | */ |
| | | @PostMapping("/social/callback") |
| | | public R<LoginVo> socialCallback(@RequestBody LoginBody loginBody) { |
| | | public R<Void> socialCallback(@RequestBody LoginBody loginBody) { |
| | | // 获取第三方登录信息 |
| | | AuthResponse<AuthUser> response = SocialUtils.loginAuth(loginBody, socialProperties); |
| | | AuthUser authUserData = response.getData(); |
| | |
| | | if (!response.ok()) { |
| | | return R.fail(response.getMsg()); |
| | | } |
| | | return loginService.sociaRegister(authUserData); |
| | | loginService.socialRegister(authUserData); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |