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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

創(chuàng)建商品一直報(bào)錯(cuò)404

https://img1.sycdn.imooc.com//5cbadf23000133ef06780575.jpg

https://img1.sycdn.imooc.com//5cbadf230001bb9410720336.jpg

這是我的前端代碼

<html>
<head>
<meta?charset="UTF-8">
????<link?href="static/assets/global/plugins/bootstrap/css/bootstrap.min.css"?style="stylesheet"?type="text/css"/>
????<link?href="static/assets/global/css/components.css"?rel="stylesheet"?type="text/css"/>
????<link?href="static/assets/admin/pages/css/login.css"?rel="stylesheet"?type="text/css"/>
????<script?src="static/assets/global/plugins/jquery-1.11.0.min.js"?type="text/javascript"></script>
</head>

<body?class="login">
????<div?class="content">
????????<h3?class="form-title">創(chuàng)建商品</h3>
????????<div?class="form-group">
????????????<label?class="control-label">商品名</label>
????????????<div>
????????????????<input?class="form-control"?type="text"?name="title"?id="title"/>
????????????</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">價(jià)格</label>
????????????<div>
????????????????<input?class="form-control"?type="text"?name="price"?id="price"/>
????????????</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="form-actions">
????????????<button?class="btn?blue"?id="create"?type="submit">
????????????????提交創(chuàng)建
????????????</button>
????????</div>
????</div>
</body>
<script>
????jQuery(document).ready(function?()?{

????????$("#create").on("click",function(){
????????????var?title?=?$("#title").val();
????????????var?description?=?$("#description").val();
????????????var?price?=?$("#price").val();
????????????var?imgUrl?=?$("#imgUrl").val();
????????????var?stock?=?$("#stock").val();

????????????if(title?==?null?||?title?==""){
????????????????alert("商品名不能為空");
????????????????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",
????????????????datatype:'json',
????????????????contendType:"application/x-www-form-urlencoded",
????????????????url:"http://localhost:8090/user/create",
????????????????data:JSON.stringify({
???????????????"title":title,
???????????????"description":description,
???????????????"price":price,
???????????????"imgUrl":imgUrl,
???????????????"stock":stock
????????????????}),
????????????xhrFields:{withCredentials:true},
????????????????success:function?(data)?{
????????????????????if(data.status?==??"success"){
????????????????????????alert("創(chuàng)建成功");
????????????????????}
????????????????????else{
????????????????????????alert("創(chuàng)建失敗1,原因?yàn)?+data.data.errMsg)
????????????????????}
????????????????},
????????????????error:function?(data)?{
????????????????????alert("創(chuàng)建失敗2,原因?yàn)?+data.responseText);??????????????????
????????????????}
????????????})
????????})
????????return?false;
????});
</script>


</html>

犯了很蠢的錯(cuò)誤,鏈接寫(xiě)錯(cuò)了,應(yīng)該是localhost:8090/item/create,我給寫(xiě)成了localhost:8090/user/create

簡(jiǎn)直蠢驢??!

正在回答

1 回答

新手日常-------

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

創(chuàng)建商品一直報(bào)錯(cuò)404

我要回答 關(guān)注問(wèn)題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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