update 优化 错误的方法命名
This commit is contained in:
parent
f51f96d01c
commit
a2e9a4e899
@ -109,7 +109,7 @@ public class AuthController {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/social/callback")
|
@PostMapping("/social/callback")
|
||||||
public R<LoginVo> socialCallback(@RequestBody LoginBody loginBody) {
|
public R<Void> socialCallback(@RequestBody LoginBody loginBody) {
|
||||||
// 获取第三方登录信息
|
// 获取第三方登录信息
|
||||||
AuthResponse<AuthUser> response = SocialUtils.loginAuth(loginBody, socialProperties);
|
AuthResponse<AuthUser> response = SocialUtils.loginAuth(loginBody, socialProperties);
|
||||||
AuthUser authUserData = response.getData();
|
AuthUser authUserData = response.getData();
|
||||||
@ -117,7 +117,8 @@ public class AuthController {
|
|||||||
if (!response.ok()) {
|
if (!response.ok()) {
|
||||||
return R.fail(response.getMsg());
|
return R.fail(response.getMsg());
|
||||||
}
|
}
|
||||||
return loginService.sociaRegister(authUserData);
|
loginService.socialRegister(authUserData);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import me.zhyd.oauth.model.AuthUser;
|
|||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.constant.GlobalConstants;
|
import org.dromara.common.core.constant.GlobalConstants;
|
||||||
import org.dromara.common.core.constant.TenantConstants;
|
import org.dromara.common.core.constant.TenantConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
|
||||||
import org.dromara.common.core.domain.dto.RoleDTO;
|
import org.dromara.common.core.domain.dto.RoleDTO;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.enums.LoginType;
|
import org.dromara.common.core.enums.LoginType;
|
||||||
@ -35,7 +34,6 @@ import org.dromara.system.mapper.SysUserMapper;
|
|||||||
import org.dromara.system.service.ISysPermissionService;
|
import org.dromara.system.service.ISysPermissionService;
|
||||||
import org.dromara.system.service.ISysSocialService;
|
import org.dromara.system.service.ISysSocialService;
|
||||||
import org.dromara.system.service.ISysTenantService;
|
import org.dromara.system.service.ISysTenantService;
|
||||||
import org.dromara.web.domain.vo.LoginVo;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -73,7 +71,7 @@ public class SysLoginService {
|
|||||||
* @param authUserData 授权响应实体
|
* @param authUserData 授权响应实体
|
||||||
* @return 统一响应实体
|
* @return 统一响应实体
|
||||||
*/
|
*/
|
||||||
public R<LoginVo> sociaRegister(AuthUser authUserData) {
|
public void socialRegister(AuthUser authUserData) {
|
||||||
SysSocialBo bo = new SysSocialBo();
|
SysSocialBo bo = new SysSocialBo();
|
||||||
bo.setUserId(LoginHelper.getUserId());
|
bo.setUserId(LoginHelper.getUserId());
|
||||||
bo.setAuthId(authUserData.getSource() + authUserData.getUuid());
|
bo.setAuthId(authUserData.getSource() + authUserData.getUuid());
|
||||||
@ -82,7 +80,6 @@ public class SysLoginService {
|
|||||||
BeanUtils.copyProperties(authUserData, bo);
|
BeanUtils.copyProperties(authUserData, bo);
|
||||||
BeanUtils.copyProperties(authUserData.getToken(), bo);
|
BeanUtils.copyProperties(authUserData.getToken(), bo);
|
||||||
sysSocialService.insertByBo(bo);
|
sysSocialService.insertByBo(bo);
|
||||||
return R.ok();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user