采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
在修改店铺信息的时候没有加载出原来的店铺信息
在debug的过程中

这么设置断点,但是没有进入后台

在登录的时候,先执行一遍这个代码返回true后跳转到shoplist界面,但没有店铺,他会在执行一遍 返回true后显示店铺。
会跟这个有关吗?拦截器不是把shoplist排除了吗
<mvc:interceptor>
<mvc:mapping path="/shopadmin/**" />
<bean id="ShopInterceptor"
class="com.imooc.o2o.interceptor.shopadmin.ShopLoginInterceptor" />
</mvc:interceptor>
<!-- 校验是否对该店铺有操作权限的拦截器 排除一些页面-->
<mvc:interceptor>
<mvc:mapping path="/shopadmin/**" />
<!-- shoplist page -->
<mvc:exclude-mapping path="/shopadmin/shoplist" />
<mvc:exclude-mapping path="/shopadmin/getshoplist" />
<!-- shopregister page -->
<mvc:exclude-mapping path="/shopadmin/registershop" />
<mvc:exclude-mapping path="/shopadmin/shopoperation" />
<!-- shopmanage page -->
<mvc:exclude-mapping path="/shopadmin/shopmanagement" />
<mvc:exclude-mapping path="/shopadmin/getshopmanagementinfo" />
<bean id="ShopPermissionInterceptor"
class="com.imooc.o2o.interceptor.shopadmin.ShopPermissionInterceptor" />
</mvc:interceptor>
好像是没有到ajax这不...直接从$('#submit').click(function() {这行到最后花括号了...
chrome控制台报的错...
Uncaught TypeError: Cannot read property 'success' of null
at shopoperation.js:27
at v (zepto.min.js:2)
at XMLHttpRequest.S.onreadystatechange (zepto.min.js:2)
(anonymous) @ shopoperation.js:27
v @ zepto.min.js:2
S.onreadystatechange @ zepto.min.js:2
XMLHttpRequest.send (async)
t.ajax @ zepto.min.js:2
t.getJSON @ zepto.min.js:2
getShopInfo @ shopoperation.js:26
(anonymous) @ shopoperation.js:21
(anonymous) @ zepto.min.js:2
我把shopoperation.js的文件删了 重新建了一个 代码复制过来,controller中getshopbyid的代码也重新沾了一份过来...依旧这样...同学好,建议改成下列的形式试试
$.ajax({
url: '/cxz/add',
success: function (data) {
alert(data);
},
error: function (xhr, textStatus, errorThrown) { /*错误信息处理*/ alert("进入error---");
alert("状态码:"+xhr.status);
alert("状态:"+xhr.readyState);//当前状态,0-未初始化,1-正在载入,2-已经载入,3-数据进行交互,4-完成。 alert("错误信息:"+xhr.statusText );
alert("返回响应信息:"+xhr.responseText );//这里是详细的信息 alert("请求状态:"+textStatus);
alert(errorThrown);
alert("请求失败");
}
});
// 将数据提交至后台处理相关操作
$.ajax({
url : (isEdit ? editShopUrl : registerShopUrl),
type : 'POST',
data : formData,
contentType : false,
processData : false,
cache : false,
success : function(data) {
if (data.success) {
$.toast('提交成功!');
} else {
$.toast('提交失败!' + data.errMsg);
}
// 点击验证码图片的时候,注册码会改变
$('#captcha_img').click();
这段吗?
登录后可查看更多问答,登录/注册
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
了解课程