diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java b/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java index 11aea73f..6952d6cb 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/tool/BaiduController.java @@ -1,14 +1,17 @@ package com.ghy.web.controller.tool; +import com.alibaba.fastjson.JSONObject; import com.ghy.common.config.BaiduConfig; import com.ghy.common.core.controller.BaseController; import com.ghy.common.core.domain.AjaxResult; import com.ghy.common.utils.ExceptionUtil; import com.ghy.common.utils.http.HttpUtils; +import com.google.gson.JsonObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -21,8 +24,9 @@ public class BaiduController extends BaseController { @PostMapping("/getLocation") @ResponseBody - public AjaxResult getLocationByLot(String location){ + public AjaxResult getLocationByLot(@RequestBody JSONObject jsonObject){ try { + String location = jsonObject.getString("location"); String url = baiduConfig.getUrl().replace("#AK#", baiduConfig.getAk()) + location; String result = HttpUtils.sendGet(url); return AjaxResult.success(result);