ajax 前后端交互例子
前端:
$.ajax({
type: 'post',
url: "/system/dept/selectExcelTask",
success: function (result) {
console.log("result.task_id:"+result.dept_excel_path);
}
})
后端:
@PostMapping("/selectExcelTask")
@ResponseBody
public AjaxResult getUploadPath(){
Map<String, Object> paramMap = new HashMap<String, Object>();
String dept_excel_path = "123";
paramMap.put("dept_excel_path", dept_excel_path);
return success().put("dept_excel_path", dept_excel_path);
}