|
@@ -24,9 +24,9 @@ import java.util.Map;
|
|
|
@Component
|
|
|
public class CheckExecuteInterceptor extends HandlerInterceptorAdapter {
|
|
|
|
|
|
- private static final String PATH = "http://localhost:8082";
|
|
|
+ private static final String PATH = "http://iot.usky.cn";
|
|
|
|
|
|
- private static final String CHECK_URL = String.format("%s%s",PATH,"/check");
|
|
|
+ private static final String CHECK_URL = String.format("%s%s",PATH,"/ytapi/admin/Manage/wooGiJavaApi");
|
|
|
|
|
|
private static final String JWT_KEY = "U0JBUElKV1RkV2FuZzkyNjQ1NA==";
|
|
|
|
|
@@ -38,13 +38,13 @@ public class CheckExecuteInterceptor extends HandlerInterceptorAdapter {
|
|
|
map.put("loginName","wj");
|
|
|
String token = createToken(map);
|
|
|
String wj = String.format("%s?token=%s", CHECK_URL, token);
|
|
|
- boolean result;
|
|
|
+ Integer result;
|
|
|
try {
|
|
|
- result = Boolean.parseBoolean(HttpUtils.get(wj, null));
|
|
|
+ result = Integer.parseInt(HttpUtils.get(wj, null));
|
|
|
}catch (Exception e){
|
|
|
- result = false;
|
|
|
+ result = 0;
|
|
|
}
|
|
|
- if (!result){
|
|
|
+ if (result != 1){
|
|
|
ApiResult<Object> error = ApiResult.error(SystemErrorCode.SYS_SYSTEM_ERROR.getCode(), "系统异常请联系管理员");
|
|
|
ServletUtils.renderString(response, JsonUtils.toJson(error));
|
|
|
return false;
|