Commit bef7ae86 by zhoupeng

提交导入组织架构openapi接口

parent f9d38a8c
......@@ -35,7 +35,7 @@ public class QiDianController {
@GetMapping("/toSSOCallback")
@ApiOperation(value = "跳转至企点鉴权地址")
public void toSSOCallback(HttpServletRequest request, HttpServletResponse response) throws IOException {
public void toSSOCallback(HttpServletRequest request, HttpServletResponse response) throws Exception {
String token = request.getParameter("token");
log.info("-------跳转至企点鉴权地址token入参信息-------:{}", token);
// 参数非空校验
......
......@@ -8,6 +8,7 @@ import com.rome.order.api.dto.empManage.req.QiDianGenerateAccountReqDTO;
import com.rome.order.infrastructure.dataobject.SyncOrgDO;
import com.rome.order.infrastructure.remote.dto.res.EmpMainDataResDTO;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
......@@ -29,7 +30,7 @@ public interface QiDianService {
* @param code
* @return
*/
String getSSOCallback(String code);
String getSSOCallback(String code) throws Exception;
/**
......
......@@ -37,6 +37,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -94,13 +96,13 @@ public class QiDianServiceImpl implements QiDianService {
}
@Override
public String getSSOCallback(String code) {
public String getSSOCallback(String code) throws Exception {
//三方sso登录
// String result = this.login(code);
Map<String, String> headers = HttpUtil.getOpenApiHeaderMap(corporationId, secret);
String timestamp = headers.get("timestamp");
String sign = headers.get("sign");
String signEncode = ServletUtils.urlEncode(sign);
String signEncode=URLDecoder.decode(sign, "UTF-8");
String url = String.format(beidouOpenapiUrl+RemoteConstant.SSO_LOGIN_API_URL, code,consoleUrl,corporationId,timestamp,signEncode);
log.info("---getSSOCallback地址信息-----:{}",url);
return url;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment