|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.ccsens.ptos_tall.service; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.lang.Snowflake; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
@ -440,12 +441,10 @@ public class UserService implements IUserService { |
|
|
|
if(ObjectUtil.isNull(sysUser)){ |
|
|
|
throw new BaseException(CodeEnum.NOT_LOGIN); |
|
|
|
} |
|
|
|
userInfo.setId(sysUser.getId()); |
|
|
|
|
|
|
|
//获取用户信息
|
|
|
|
userInfo.setAvatarUrl(sysUser.getAvatarUrl()); |
|
|
|
BeanUtil.copyProperties(sysUser,userInfo); |
|
|
|
userInfo.setUserName(sysUser.getName()); |
|
|
|
userInfo.setAuthType(sysUser.getAuthType()); |
|
|
|
|
|
|
|
//查找手机号
|
|
|
|
userInfo.setPhone(sysAuthDao.getPhoneByUserId(Long.valueOf(claims.getSubject()))); |
|
|
|
|
|
|
@ -467,8 +466,7 @@ public class UserService implements IUserService { |
|
|
|
SysUser sysUser = sysUserDao.getVisitorUser(params.getDeviceId()); |
|
|
|
log.info("查找deviceId用户:{}" ,sysUser); |
|
|
|
if(ObjectUtil.isNotNull(sysUser)){ |
|
|
|
userInfo.setId(sysUser.getId()); |
|
|
|
userInfo.setAvatarUrl(sysUser.getAvatarUrl()); |
|
|
|
BeanUtil.copyProperties(sysUser,userInfo); |
|
|
|
userInfo.setUserName(sysUser.getName()); |
|
|
|
}else { |
|
|
|
//以前没有关联用户则新建一个
|
|
|
@ -479,7 +477,7 @@ public class UserService implements IUserService { |
|
|
|
sysUserDao.insertSelective(sysUser); |
|
|
|
userInfo.setId(sysUser.getId()); |
|
|
|
} |
|
|
|
userInfo.setAuthType(sysUser.getAuthType()); |
|
|
|
// userInfo.setAuthType(sysUser.getAuthType());
|
|
|
|
//添加登录记录
|
|
|
|
saveSigninLog(sysUser.getId(), 0L,params.getDeviceId(), params.getClientType(),params.getClientIp()); |
|
|
|
//重新生成token
|
|
|
|