如下是nginx的配置
#前端界面
location / {
root D:/ant-design-pro-master/dist;
index index.html index.htm;
}
#后端接口
location ^~ /api/ {
proxy_pass http://127.0.0.1:8085;
}
axios传参代码如下
axios.get(url, { params: { ID: 12345 }, })
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
后台代码如下
@RequestMapping(value = "${adminPath}/login", method = {RequestMethod.GET, RequestMethod.HEAD})
public String login(HttpServletRequest request, HttpServletResponse response, Model model) {
Map m = request.getParameterMap();
String id = (String) request.getAttribute("ID");