From 348938eb96dc60ed40c8fc7ae64500f1c5cfdee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 31 Jul 2023 17:41:35 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=20=E5=AE=9E=E4=BD=93=E7=B1=BBcopy=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/web/service/SysLoginService.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index b91452cd..c2392d38 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -4,7 +4,6 @@ import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import me.zhyd.oauth.model.AuthUser; @@ -15,7 +14,6 @@ import org.dromara.common.core.domain.dto.RoleDTO; import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.LoginType; import org.dromara.common.core.enums.TenantStatus; -import org.dromara.common.core.enums.UserStatus; import org.dromara.common.core.exception.user.UserException; import org.dromara.common.core.utils.DateUtils; import org.dromara.common.core.utils.MessageUtils; @@ -34,7 +32,6 @@ import org.dromara.system.mapper.SysUserMapper; import org.dromara.system.service.ISysPermissionService; import org.dromara.system.service.ISysSocialService; import org.dromara.system.service.ISysTenantService; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -72,13 +69,13 @@ public class SysLoginService { * @return 统一响应实体 */ public void socialRegister(AuthUser authUserData) { - SysSocialBo bo = new SysSocialBo(); + SysSocialBo bo = BeanUtil.toBean(authUserData, SysSocialBo.class); + BeanUtil.copyProperties(authUserData.getToken(), bo); bo.setUserId(LoginHelper.getUserId()); bo.setAuthId(authUserData.getSource() + authUserData.getUuid()); bo.setOpenId(authUserData.getUuid()); bo.setUserName(authUserData.getUsername()); - BeanUtils.copyProperties(authUserData, bo); - BeanUtils.copyProperties(authUserData.getToken(), bo); + bo.setNickName(authUserData.getNickname()); sysSocialService.insertByBo(bo); }