38,ajax model类型交互

1,前台

  function submit(){
   
           // debugger;
            var id=$("#managementid").val();
           var appType=$("#appType").val();
         var fileId=$("#fileId").val();
            var appName=$("#appName").val();
            var version=$("#version").val();
            var olaFile=$("#olaFile").val();
            var remark=$("#remark").val();
    var url = '/api/managementadd';//数据显示
            $.ajax({
                type: "POST",
                async: false,
                url: url,
                dataType: "json",
         contentType:'application/json',
                data:JSON.stringify({id:id,type:appType,bundleid:fileId,name:appName,version:version,appfile:olaFile,remark:remark }),
                success: function (response) {
               if(response.code==1){
                          setTimeout("alert('保存成功')",100);
                          var index = parent.layer.getFrameIndex(window.name);
                          parent.layer.close(index);
                      }

                }, error: function (err) {
                    alert("系统正忙,请稍后....");
                }
            })
        };

后台

    @RequestMapping("/managementadd")
    public String ManagementAdd(@RequestBody ManagementModel managementModel){
        APIResultModel result = new APIResultModel();
  return userService.ManagementAdd(managementModel,result).toString();

    }

你可能感兴趣的:(38,ajax model类型交互)