|
@@ -27,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.File;
|
|
|
+import java.util.Locale;
|
|
|
|
|
|
/**
|
|
|
* @author Xiewj
|
|
@@ -105,11 +106,17 @@ public class OfflineController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- String result2 = HttpRequest.post(localNetworkUrl + dto.getAction())
|
|
|
- .body(JSONObject.parseObject(dto.getParams()).toJSONString())
|
|
|
- .header("Content-Type", "application/json")
|
|
|
- .execute().body();
|
|
|
- return JSONObject.parseObject(result2);
|
|
|
-
|
|
|
+ if (dto.getMapping().toUpperCase(Locale.ROOT).equals(RequestMethod.POST)) {
|
|
|
+ String result2 = HttpRequest.post(localNetworkUrl + dto.getAction())
|
|
|
+ .body(JSONObject.parseObject(dto.getParams()).toJSONString())
|
|
|
+ .header("Content-Type", "application/json")
|
|
|
+ .execute().body();
|
|
|
+ return JSONObject.parseObject(result2);
|
|
|
+ } else if (dto.getMapping().toUpperCase(Locale.ROOT).equals(RequestMethod.GET)) {
|
|
|
+ String result2 = HttpRequest.get(localNetworkUrl + dto.getAction())
|
|
|
+ .execute().body();
|
|
|
+ return JSONObject.parseObject(result2);
|
|
|
+ }
|
|
|
+ return JSONObject.parseObject(String.valueOf(Result.failure()));
|
|
|
}
|
|
|
}
|