|
@@ -7,7 +7,6 @@ import com.qmth.boot.tools.signature.SignatureType;
|
|
import com.qmth.distributed.print.business.bean.result.DictionaryResult;
|
|
import com.qmth.distributed.print.business.bean.result.DictionaryResult;
|
|
import com.qmth.distributed.print.business.service.SsoService;
|
|
import com.qmth.distributed.print.business.service.SsoService;
|
|
import com.qmth.distributed.print.business.service.TeachCourseService;
|
|
import com.qmth.distributed.print.business.service.TeachCourseService;
|
|
-import com.qmth.teachcloud.common.bean.params.OpenParams;
|
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
@@ -15,7 +14,6 @@ import com.qmth.teachcloud.common.enums.OrgTypeEnum;
|
|
import com.qmth.teachcloud.common.enums.RoleTypeEnum;
|
|
import com.qmth.teachcloud.common.enums.RoleTypeEnum;
|
|
import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
|
|
import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
import com.qmth.teachcloud.common.service.*;
|
|
-import com.qmth.teachcloud.common.util.JacksonUtil;
|
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -239,35 +237,38 @@ public class SsoServiceImpl implements SsoService {
|
|
questionLoginUrl = questionLoginUrl.replace(SystemConstant.PATH_MATCH, basicSchool.getCode());
|
|
questionLoginUrl = questionLoginUrl.replace(SystemConstant.PATH_MATCH, basicSchool.getCode());
|
|
}
|
|
}
|
|
questionLoginUrl = questionLoginUrl + SystemConstant.TIKU_CAS_ADMIN_LOGIN_OPEN_API;
|
|
questionLoginUrl = questionLoginUrl + SystemConstant.TIKU_CAS_ADMIN_LOGIN_OPEN_API;
|
|
- String path = SystemConstant.TIKU_CAS_ADMIN_LOGIN_OPEN_API;
|
|
|
|
|
|
+ String path = SystemConstant.TIKU_SSO_LOGIN_API;
|
|
|
|
+
|
|
String signature = SignatureEntity.build(SignatureType.SECRET, SystemConstant.GET, path, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
String signature = SignatureEntity.build(SignatureType.SECRET, SystemConstant.GET, path, timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
|
|
signature = URLEncoder.encode(signature, SystemConstant.CHARSET_NAME);
|
|
signature = URLEncoder.encode(signature, SystemConstant.CHARSET_NAME);
|
|
|
|
|
|
|
|
+ Long userId = sysUser.getId();
|
|
|
|
+ List<DictionaryResult> dictionaryResultList = teachCourseService.findTeacherCourseInfo(userId);
|
|
|
|
+
|
|
StringJoiner stringJoiner = new StringJoiner("")
|
|
StringJoiner stringJoiner = new StringJoiner("")
|
|
.add(questionLoginUrl)
|
|
.add(questionLoginUrl)
|
|
.add(SystemConstant.GET_UNKNOWN).add(SystemConstant.HEADER_TIME).add(SystemConstant.GET_EQUAL).add(String.valueOf(timestamp))
|
|
.add(SystemConstant.GET_UNKNOWN).add(SystemConstant.HEADER_TIME).add(SystemConstant.GET_EQUAL).add(String.valueOf(timestamp))
|
|
- .add(SystemConstant.GET_SYMBOL).add(SystemConstant.SIGNATURE).add(SystemConstant.GET_EQUAL).add(signature)
|
|
|
|
- .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(loginName);
|
|
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.HEADER_AUTHORIZATION).add(SystemConstant.GET_EQUAL).add(signature)
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add(SystemConstant.USER).add(SystemConstant.GET_EQUAL).add(loginName)
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add("name").add(SystemConstant.GET_EQUAL).add(realName)
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add("roleCode").add(SystemConstant.GET_EQUAL).add(role.name())
|
|
|
|
+ .add(SystemConstant.GET_SYMBOL).add("courses").add(SystemConstant.GET_EQUAL).add(JSON.toJSONString(dictionaryResultList));
|
|
|
|
|
|
if (Objects.nonNull(returnUrl) && !Objects.equals(returnUrl, "")) {
|
|
if (Objects.nonNull(returnUrl) && !Objects.equals(returnUrl, "")) {
|
|
stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(returnUrl);
|
|
stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.RETURN_URL).add(SystemConstant.GET_EQUAL).add(returnUrl);
|
|
}
|
|
}
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
- if (Objects.nonNull(params) && !Objects.equals(params, "")) {
|
|
|
|
- OpenParams openParams = JacksonUtil.readJson(params, OpenParams.class);
|
|
|
|
- stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(JacksonUtil.parseJson(openParams));
|
|
|
|
- map.computeIfAbsent(SystemConstant.PARAMS, v -> JacksonUtil.parseJson(openParams));
|
|
|
|
- }
|
|
|
|
- Long userId = sysUser.getId();
|
|
|
|
- List<DictionaryResult> dictionaryResultList = teachCourseService.findTeacherCourseInfo(userId);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- map.computeIfAbsent("loginName", v -> loginName);
|
|
|
|
- map.computeIfAbsent("realName", v -> realName);
|
|
|
|
- map.computeIfAbsent("roleCode", v -> role);
|
|
|
|
|
|
+// if (Objects.nonNull(params) && !Objects.equals(params, "")) {
|
|
|
|
+// OpenParams openParams = JacksonUtil.readJson(params, OpenParams.class);
|
|
|
|
+// stringJoiner = stringJoiner.add(SystemConstant.GET_SYMBOL).add(SystemConstant.PARAMS).add(SystemConstant.GET_EQUAL).add(JacksonUtil.parseJson(openParams));
|
|
|
|
+// map.computeIfAbsent(SystemConstant.PARAMS, v -> JacksonUtil.parseJson(openParams));
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// map.computeIfAbsent("loginName", v -> loginName);
|
|
|
|
+// map.computeIfAbsent("realName", v -> realName);
|
|
|
|
+// map.computeIfAbsent("roleCode", v -> role);
|
|
map.computeIfAbsent("returnUrl", v -> returnUrl);
|
|
map.computeIfAbsent("returnUrl", v -> returnUrl);
|
|
- map.computeIfAbsent("courses", v -> dictionaryResultList);
|
|
|
|
map.put("redirectUrl", stringJoiner.toString());
|
|
map.put("redirectUrl", stringJoiner.toString());
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|