发表于: 2020-03-24 21:50:47

1 1642



今天完成的事情:

1.推进任务


明天计划的事情:

1.推进任务



遇到的问题和收获:

//新增接口上线
onlineNew() {
   console.log('新增上线!');
   this.article.status = 2
   this.$http({
       method: 'post',
       url: '/api/a/u/article',
       data: this.$qs.stringify(this.article)
   }).then(res => {
       console.log(res);
       if (res.data.code === 0) {
           console.log(res);
           this.$message.success('操作成功')
           this.$router.push({
               path: '/home/admin'
           })
       }
   })
},

新增里面的草稿和上线可以正常返回数据,请求。



编辑里的草稿能点击

//编辑接口存为草稿
edit() {
   console.log('编辑接口存为草稿');
   this.article.status = 1
   this.$http({
       method: 'put',
       url: '/api/a/u/article/' + this.$route.query.id,
       data: this.$qs.stringify(this.article),
       headers: {'Content-Type': 'application/x-www-form-urlencoded'}
   }).then(res => {
       if (res.data.code === 0) {
           this.$message.success('编辑成功!');
           this.$router.push({
               path: '/home/admin'
           })
       }
   })
},

不过没有请求




编辑里的上线则是可以点击,有请求,不过返回的是-100000


暂不知哪里的问题,这里的代码没有改动过。 = =






返回列表 返回列表
评论

    分享到