第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

商品創(chuàng)建時(shí)頁(yè)面報(bào)錯(cuò)創(chuàng)建失敗,失敗原因undefined。

商品創(chuàng)建時(shí)頁(yè)面報(bào)錯(cuò)創(chuàng)建失敗,失敗原因undefined。

北飛魚 2020-07-07 11:53:28
頁(yè)面<html><head><meta charset="UTF-8"><link href="media/css/bootstrap.min.css" rel="stylesheet" type="text/css"/><link href="media/css/login.css" rel="stylesheet" type="text/css"/></head><body class="login"> <div class="content"> <h3 class="form-title">商品錄入</h3> <div class="form-group"> <label class="control-label">商品名稱</label> <div> <input class="form-control" type="text" placeholder="商品名稱" name="title" id="title"> </div> </div> <div class="form-group"> <label class="control-label">商品價(jià)格</label> <div> <input class="form-control" type="text" placeholder="商品價(jià)格" name="price" id="price"> </div> </div> <div class="form-group"> <label class="control-label">商品描述</label> <div> <input class="form-control" type="text" name="description" id="description"> </div> </div> <div class="form-group"> <label class="control-label">圖片</label> <div> <input class="form-control" type="text"? name="imgUrl" id="imgUrl"> </div> </div> <div class="form-group"> <label class="control-label">庫(kù)存</label> <div> <input class="form-control" type="text" name="stock" id="stock"> </div> </div> <div class="btn-cont"> <button class="btn blue" id="createItem" type="submit"> 提交 </button> </div> </div></body><script src="media/js/jquery-1.10.1.min.js" type="text/javascript"></script><script type="text/javascript"> jQuery(document).ready(function(){ $("#createItem").on("click",function(){ var title = $("#title").val(); var price = $("#price").val(); var description = $("#description").val(); var imgUrl = $("#imgUrl").val(); var stock = $("#stock").val(); if(title == null || title == ""){ alert("商品名不能為空"); return false; } if(price == null || price == ""){ alert("價(jià)格不能為空"); return false; } if(description == null || description == ""){ alert("描述不能為空"); return false; } if(imgUrl == null || imgUrl == ""){ alert("圖片不能為空"); return false; } if(stock == null || stock == ""){ alert("庫(kù)存不能為空"); return false; } $.ajax({ type:"POST", contentType:"application/x-www-form-urlencoded", url:"http://127.0.0.1:8090/item/createItem", xhrFields:{withCredentials:true}, data:{ "title":title, "price":price, "description":description, "imgUrl":imgUrl, "stock":stock }, success:function(data){ if(data.status == "success"){ alert("錄入成功"); }else{ alert("錄入失敗,失敗原因:"+data.data.errMsg); } }, error:function(data){ alert("錄入失敗,原因是:"+data.responseText); } }); return false; }); })</script></html>Controller@Controller("item")@RequestMapping("/item")@CrossOrigin(origins= {"*"},allowCredentials="true")public class ItemController extends BaseController{ @Autowired private ItemService itemService; @RequestMapping(value = "/createItem",method = {RequestMethod.POST},consumes = {CONSTANT_TYPE_FORMED})? ? @ResponseBody public CommonReturnType createItem(@RequestParam(name = "title") String title, @RequestParam(name = "price") BigDecimal price, @RequestParam(name = "description") String description, @RequestParam(name = "sales") Integer sales, @RequestParam(name = "imgUrl") String imgUrl, @RequestParam(name = "stock") Integer stock ) throws BusinessException { ItemVo itemVo = null; try { ItemModel itemModel = new ItemModel(); itemModel.setTitle(title); itemModel.setPrice(price); itemModel.setStock(stock); itemModel.setDescription(description); itemModel.setSales(sales); itemModel.setImgUrl(imgUrl); ItemModel model = itemService.createItem(itemModel); itemVo = converVOFromItemModel(model); } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return CommonReturnType.create(itemVo); } private ItemVo converVOFromItemModel(ItemModel itemModel) { if(itemModel == null) { return null; } ItemVo itemVo = new ItemVo(); BeanUtils.copyProperties(itemModel, itemVo); return itemVo; } }頁(yè)面和Controller都是復(fù)制的User的,進(jìn)不了斷點(diǎn),也沒思路怎么排查。各位大佬給看看有沒有遇到過(guò)這樣的問(wèn)題。
查看完整描述

目前暫無(wú)任何回答

  • 0 回答
  • 0 關(guān)注
  • 1597 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)