
`
在学习黑马前端的VUE电商后台管理系统时,老师所讲的内容已经基本完成了,但是项目剩下的一些功能还没有实现,在实现过程中出现了一些bug,不知道有没有小伙伴完成了该项目的全部功能呢?
希望各大前端程序员能够帮忙下,解决问题
问题描述
在编写商品列表的编辑功能时,需要向服务器提交相应数据,但是状态码是400也就是出错了。
// 修改商品信息并提交
editListInfo() {
this.$refs.editFormRef.validate(async valid => {
if (!valid) return
// 发起修改商品信息的数据请求
const { data: res } = await this.$http.put(`goods/` + this.editForm.goods_id, { goods_name: this.editForm.goods_name, goods_price: this.editForm.goods_price, goods_number: this.editForm.goods_number, goods_weight: this.editForm.goods_weight, goods_introduce: this.editForm.goods_introduce, pics: this.editForm.pics, attrs: this.editForm.attrs })
// , goods_introduce: this.editForm.goods_introduce
if (res.meta.status !== 200) {
return this.$message.error('更新用户信息失败!')
}
原因分析:
原因是 商品分类没有所属内容, 目前没有解决,api文档的相应参数也已经添加了,就是不知道为什么出错。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)