| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | * @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); |
| | | } |
| | | |