|
@@ -17,7 +17,7 @@ import cn.com.qmth.examcloud.commons.base.util.StringUtil;
|
|
import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
|
|
import cn.com.qmth.examcloud.commons.web.cloud.api.OuterService;
|
|
import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
import cn.com.qmth.examcloud.commons.web.redis.RedisClient;
|
|
import cn.com.qmth.examcloud.commons.web.support.ServletUtil;
|
|
import cn.com.qmth.examcloud.commons.web.support.ServletUtil;
|
|
-import cn.com.qmth.examcloud.commons.web.support.StatusResponseEntity;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.StatusResponse;
|
|
import cn.com.qmth.examcloud.core.basic.api.CommonCloudService;
|
|
import cn.com.qmth.examcloud.core.basic.api.CommonCloudService;
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.ThirdPartyAccessBean;
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.ThirdPartyAccessBean;
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetThirdPartyAccessInfoReq;
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetThirdPartyAccessInfoReq;
|
|
@@ -67,7 +67,7 @@ public final class ThirdPartyAccessInterceptor implements HandlerInterceptor {
|
|
|| StringUtils.isBlank(appId) || StringUtils.isBlank(timestamp)) {
|
|
|| StringUtils.isBlank(appId) || StringUtils.isBlank(timestamp)) {
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
ServletUtil.returnJson(
|
|
ServletUtil.returnJson(
|
|
- new StatusResponseEntity("403",
|
|
|
|
|
|
+ new StatusResponse("403",
|
|
"第三方接入请求必须包含请求头['access_token','rootOrgId','appId','timestamp']"),
|
|
"第三方接入请求必须包含请求头['access_token','rootOrgId','appId','timestamp']"),
|
|
response);
|
|
response);
|
|
return false;
|
|
return false;
|
|
@@ -81,7 +81,7 @@ public final class ThirdPartyAccessInterceptor implements HandlerInterceptor {
|
|
if (!(StringUtil.isLong(rootOrgId) && StringUtil.isLong(timestamp))) {
|
|
if (!(StringUtil.isLong(rootOrgId) && StringUtil.isLong(timestamp))) {
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
ServletUtil.returnJson(
|
|
ServletUtil.returnJson(
|
|
- new StatusResponseEntity("403", "第三方接入请求头['rootOrgId','timestamp']必须是整数"),
|
|
|
|
|
|
+ new StatusResponse("403", "第三方接入请求头['rootOrgId','timestamp']必须是整数"),
|
|
response);
|
|
response);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
@@ -96,11 +96,11 @@ public final class ThirdPartyAccessInterceptor implements HandlerInterceptor {
|
|
thirdPartyAccessBean = getThirdPartyAccessInfo(rootOrgId, appId);
|
|
thirdPartyAccessBean = getThirdPartyAccessInfo(rootOrgId, appId);
|
|
} catch (StatusException e) {
|
|
} catch (StatusException e) {
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
- ServletUtil.returnJson(new StatusResponseEntity("403", e.getDesc()), response);
|
|
|
|
|
|
+ ServletUtil.returnJson(new StatusResponse("403", e.getDesc()), response);
|
|
return false;
|
|
return false;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
|
|
response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
|
|
- ServletUtil.returnJson(new StatusResponseEntity("500", "获取第三方接入信息异常"), response);
|
|
|
|
|
|
+ ServletUtil.returnJson(new StatusResponse("500", "获取第三方接入信息异常"), response);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
redisClient.set(key, thirdPartyAccessBean, 60000);
|
|
redisClient.set(key, thirdPartyAccessBean, 60000);
|
|
@@ -121,7 +121,7 @@ public final class ThirdPartyAccessInterceptor implements HandlerInterceptor {
|
|
|
|
|
|
if (!hexAscii.equalsIgnoreCase(accessToken)) {
|
|
if (!hexAscii.equalsIgnoreCase(accessToken)) {
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
response.setStatus(HttpStatus.FORBIDDEN.value());
|
|
- ServletUtil.returnJson(new StatusResponseEntity("403", "access_token校验失败"), response);
|
|
|
|
|
|
+ ServletUtil.returnJson(new StatusResponse("403", "access_token校验失败"), response);
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|