|
|
@ -1,5 +1,7 @@ |
|
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.thirdplat.apiservice.jcet.JcetApiService; |
|
|
|
import com.epmet.commons.thirdplat.dto.result.jcet.UserInfoResultDTO; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.SsoLoginFormDTO; |
|
|
@ -11,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author zxc |
|
|
|
* @DateTime 2021/1/18 下午4:33 |
|
|
@ -22,6 +26,9 @@ public class SsoController { |
|
|
|
@Autowired |
|
|
|
private SsoService ssoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private JcetApiService jcetApiService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 0、入口:得到token |
|
|
|
* @Param formDTO |
|
|
@ -34,4 +41,15 @@ public class SsoController { |
|
|
|
return new Result<SsoLoginResultDTO>().ok(ssoService.ssoLogin(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("testlogin") |
|
|
|
public Result<UserInfoResultDTO> testssoLogin(){ |
|
|
|
UserInfoResultDTO userInfoByTicket = null; |
|
|
|
try { |
|
|
|
userInfoByTicket = jcetApiService.getUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui"); |
|
|
|
} catch (UnsupportedEncodingException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
return new Result<UserInfoResultDTO>().ok(userInfoByTicket); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|