1 前端聯調的時候,反饋自己的參數沒有生效,無論傳遞任何參數都是一樣的結果
盯了一下日志發現
postman請求的是 :{"getParameter":{"provinceCode":["11"],"cityCode":["00"],"chargingType":["1"],"date":["1566835200000"]},"method":"POST","postParameter":"","requestURI":"//charging/heat/map/station/count","requestUUID":"3cc9c870938444429942a0c490f9756a”}
前端請求的是:
[請求攔截日志信息]:{"getParameter":{},"method":"POST","postParameter":"{\"date\":\"\",\"cityCode\":\"00\",\"provinceCode\":\"11\",\"chargingType\":\"\",\"operator\":\"\",\"t\":1567132526495}","requestURI":"//charging/heat/map/station/count","requestUUID":"05b9828002d94091b0f00a322e78a2e5"}
2 發現了區別 一個是類似數組,一個是json串
原來自己后端接口寫的是form表單提交,postman請求的就是表單提交,但是前端請求是body中嵌套json請求的
3 修改一下Controller
加上 @RequestBody注解,支持json方式提交參數解決問題