|
@@ -97,9 +97,10 @@ public class OpenApiController {
|
|
|
if (Objects.isNull(teachcloudLoginUrl) || Objects.equals(teachcloudLoginUrl, "")) {
|
|
|
throw ExceptionResultEnum.PARAMS_ERROR.exception("知学登录跳转地址不存在");
|
|
|
}
|
|
|
- String[] strs = teachcloudLoginUrl.split(SystemConstant.PATH_SUBSTR);
|
|
|
- if (strs[0].contains(SystemConstant.PATH_MATCH)) {
|
|
|
- strs[0] = strs[0].replace(SystemConstant.PATH_MATCH, SCHOOL_CODE);
|
|
|
+ int index = teachcloudLoginUrl.lastIndexOf(SystemConstant.PATH_SUBSTR);
|
|
|
+ String hostUrl = teachcloudLoginUrl.substring(0, index);
|
|
|
+ if (hostUrl.contains(SystemConstant.PATH_MATCH)) {
|
|
|
+ hostUrl = hostUrl.replace(SystemConstant.PATH_MATCH, SCHOOL_CODE);
|
|
|
}
|
|
|
|
|
|
QueryWrapper<BasicSchool> basicSchoolQueryWrapper = new QueryWrapper<>();
|
|
@@ -110,7 +111,7 @@ public class OpenApiController {
|
|
|
Long timestamp = System.currentTimeMillis();
|
|
|
String signature = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, LOGIN_BEFORE_XJU_LOGIC_API, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
|
|
|
|
- String callResult = HttpUtil.postJson(strs[0] + LOGIN_BEFORE_XJU_LOGIC_API, JacksonUtil.parseJson(employeeNo), signature, timestamp);
|
|
|
+ String callResult = HttpUtil.postJson(hostUrl + LOGIN_BEFORE_XJU_LOGIC_API, JacksonUtil.parseJson(employeeNo), signature, timestamp);
|
|
|
// String schoolCodeParam = null;
|
|
|
if (!StringUtils.isBlank(callResult)) {
|
|
|
log.info("callbackResult:{}", JacksonUtil.parseJson(callResult));
|