|
@@ -4,8 +4,10 @@ import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.teachcloud.common.config.DictionaryConfig;
|
|
|
+import com.qmth.teachcloud.common.entity.BasicSchool;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.teachcloud.common.service.CacheService;
|
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -31,6 +33,9 @@ public class WudaOpenApiController {
|
|
|
@Resource
|
|
|
DictionaryConfig dictionaryConfig;
|
|
|
|
|
|
+ @Resource
|
|
|
+ CacheService cacheService;
|
|
|
+
|
|
|
@ApiOperation(value = "cas鉴权接口")
|
|
|
@RequestMapping(value = "/authentication", method = RequestMethod.GET)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回消息", response = Result.class)})
|
|
@@ -40,19 +45,19 @@ public class WudaOpenApiController {
|
|
|
if (Objects.isNull(uid)) {
|
|
|
throw ExceptionResultEnum.NOT_LOGIN.exception();
|
|
|
}
|
|
|
- SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ BasicSchool basicSchool = cacheService.schoolCache("wdfx");
|
|
|
response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
- response.sendRedirect(dictionaryConfig.sysDomain().getReportUrl() + sysUser.getSchoolId() + "/" + uid);
|
|
|
+ response.sendRedirect(dictionaryConfig.sysDomain().getReportUrl() + basicSchool.getId() + "/" + uid);
|
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "cas鉴权接口")
|
|
|
-// @RequestMapping(value = "/authentication/{studentCode}", method = RequestMethod.GET)
|
|
|
-// @ApiResponses({@ApiResponse(code = 200, message = "返回消息", response = Result.class)})
|
|
|
-// @Aac(auth = BOOL.FALSE)
|
|
|
-// public void authenticationStudentCode(HttpServletRequest request, HttpServletResponse response, @PathVariable String studentCode
|
|
|
-// ) throws IOException {
|
|
|
-//// SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
-// response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
-// response.sendRedirect(dictionaryConfig.sysDomain().getReportUrl() + "2" + "/" + studentCode);
|
|
|
-// }
|
|
|
+ @ApiOperation(value = "cas鉴权接口")
|
|
|
+ @RequestMapping(value = "/authentication/{studentCode}", method = RequestMethod.GET)
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "返回消息", response = Result.class)})
|
|
|
+ @Aac(auth = BOOL.FALSE)
|
|
|
+ public void authenticationStudentCode(HttpServletRequest request, HttpServletResponse response, @PathVariable String studentCode
|
|
|
+ ) throws IOException {
|
|
|
+ BasicSchool basicSchool = cacheService.schoolCache("wdfx");
|
|
|
+ response.setHeader("Access-Control-Allow-Origin", "*");
|
|
|
+ response.sendRedirect(dictionaryConfig.sysDomain().getReportUrl() + basicSchool.getId() + "/" + studentCode);
|
|
|
+ }
|
|
|
}
|