shop
shop copied to clipboard
ssm新手:项目成功启动后index页面图片无法加载,浏览器控制台报错
提示data里没有id,是因为redies吗?这个我还没学到
index.js:6
Uncaught TypeError: Cannot read properties of undefined (reading 'id')
at Object.success (index.js:6:90)
at i (jquery.min.js:2:28017)
at Object.fireWith [as resolveWith] (jquery.min.js:2:28783)
at A (jquery.min.js:4:14017)
at XMLHttpRequest.<anonymous> (jquery.min.js:4:16305)
index.js:96
Uncaught TypeError: Cannot read properties of undefined (reading 'id')
at Object.success (index.js:96:68)
at i (jquery.min.js:2:28017)
at Object.fireWith [as resolveWith] (jquery.min.js:2:28783)
at A (jquery.min.js:4:14017)
at XMLHttpRequest.<anonymous> (jquery.min.js:4:16305)
看起来是前端代码想读 "id" 这个字段但是没没读到,可能是前端代码问题,也可能是后端没有返回相应的信息,可以使用 chrome 控制台看下 http 请求的结果是否符合预期
@lemon5227 如果你不是想复用这个项目二次开发,只是想学习 Java Web 相关技术,可以看这个项目,使用的 SpringBoot,上手更快