|
@@ -7,6 +7,8 @@ import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.teachcloud.exchange.common.bean.params.OpenParams;
|
|
|
import com.qmth.teachcloud.exchange.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.exchange.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.teachcloud.exchange.common.service.AuthInfoService;
|
|
|
import com.qmth.teachcloud.exchange.common.service.CommonService;
|
|
|
import com.qmth.teachcloud.exchange.common.util.HttpUtil;
|
|
|
import com.qmth.teachcloud.exchange.common.util.JacksonUtil;
|
|
@@ -48,6 +50,9 @@ public class OpenApiController {
|
|
|
@Resource
|
|
|
CommonService commonService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ AuthInfoService authInfoService;
|
|
|
+
|
|
|
@ApiOperation(value = "西安交通大学cas鉴权接口")
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "返回消息", response = Result.class)})
|
|
|
@RequestMapping(value = "/authentication", method = RequestMethod.GET)
|
|
@@ -57,7 +62,8 @@ public class OpenApiController {
|
|
|
@ApiParam(value = "用户类型") @RequestParam(required = false) String userType,
|
|
|
@ApiParam(value = "员工工号") @RequestParam(required = false) String employeeNo,
|
|
|
@ApiParam(value = "返回url") @RequestParam(required = false) String returnUrl) throws IOException {
|
|
|
- String schoolCode = "test-school-2";
|
|
|
+ String schoolCode = "xjtu";
|
|
|
+ authInfoService.appHasExpired(schoolCode);
|
|
|
|
|
|
Map<String, Object> accessTokenParams = new LinkedHashMap<>();
|
|
|
accessTokenParams.put("code", code);
|
|
@@ -73,6 +79,8 @@ public class OpenApiController {
|
|
|
if (Objects.nonNull(object) && Objects.equals(message, "成功")) {
|
|
|
accessToken = object.getString("accessToken");
|
|
|
gsessionId = object.getString("gsessionId");
|
|
|
+ } else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(message);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -105,6 +113,8 @@ public class OpenApiController {
|
|
|
JSONObject deptInfoJsonArrayJsonObject = deptInfoJsonArray.getJSONObject(0);
|
|
|
openParams.setDeptName(deptInfoJsonArrayJsonObject.getString("deptName"));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception(message);
|
|
|
}
|
|
|
}
|
|
|
}
|