|
|
@ -22,6 +22,7 @@ import com.epmet.jwt.JwtTokenUtils; |
|
|
|
import com.epmet.redis.SsoRedis; |
|
|
|
import com.epmet.service.SsoService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -79,10 +80,17 @@ public class SsoServiceImpl implements SsoService { |
|
|
|
} |
|
|
|
userId = userDTOResult.getData().getId(); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(userId)){ |
|
|
|
throw new RenException(SsoConstant.USER_ID_IS_NULL); |
|
|
|
} |
|
|
|
//生成业务token
|
|
|
|
String token = this.generateToken(formDTO.getApp(),formDTO.getClient(), userId); |
|
|
|
//存放Redis
|
|
|
|
this.disposeTokenDto(formDTO, userId, token, getCustomerId(formDTO.getAppId())); |
|
|
|
String customerId = getCustomerId(formDTO.getAppId()); |
|
|
|
if (StringUtils.isBlank(customerId)){ |
|
|
|
throw new RenException(SsoConstant.CUSTOMER_ID_IS_NULL); |
|
|
|
} |
|
|
|
this.disposeTokenDto(formDTO, userId, token, customerId); |
|
|
|
return new SsoLoginResultDTO(token); |
|
|
|
} |
|
|
|
|
|
|
|