|
|
@ -2,14 +2,13 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.epmet.commons.thirdplat.apiservice.AbstractApiService; |
|
|
|
import com.epmet.commons.thirdplat.apiservice.jcet.JcetApiService; |
|
|
|
import com.epmet.commons.thirdplat.constants.ApiServiceBeansConstants; |
|
|
|
import com.epmet.commons.thirdplat.dto.result.jcet.UserInfoResultDTO; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.commons.tools.utils.HttpClientManager; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.constant.SsoConstant; |
|
|
|
import com.epmet.dto.PaCustomerDTO; |
|
|
|
import com.epmet.dto.UserDTO; |
|
|
@ -23,6 +22,8 @@ import com.epmet.redis.SsoRedis; |
|
|
|
import com.epmet.service.SsoService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -38,6 +39,8 @@ import java.util.Map; |
|
|
|
@Slf4j |
|
|
|
public class SsoServiceImpl implements SsoService { |
|
|
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SsoRedis ssoRedis; |
|
|
|
|
|
|
@ -47,9 +50,6 @@ public class SsoServiceImpl implements SsoService { |
|
|
|
@Autowired |
|
|
|
private JwtTokenProperties jwtTokenProperties; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private JcetApiService jcetApiService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
@ -65,8 +65,10 @@ public class SsoServiceImpl implements SsoService { |
|
|
|
if (formDTO.getAppId().equals(SsoConstant.WINE_CITY_E_OPEN_APP_ID)) { |
|
|
|
UserInfoResultDTO userInfo = null; |
|
|
|
try { |
|
|
|
userInfo = jcetApiService.getUserInfoByTicket(formDTO.getTicket()); |
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(ApiServiceBeansConstants.JCET_API_SERVICE); |
|
|
|
userInfo = apiService.getUserInfoByTicket(formDTO.getTicket()); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("调用第三方平台,根据用户ticket查询用户信息失败,错误信息"); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
if (null == userInfo){ |
|
|
|