发表于: 2020-02-22 23:10:20
1 1777
今天完成的事情:
1.任务推进
明天计划的事情:
1.任务推进
遇到的问题和收获:
1.
this.$router.push({
path: '/home/details'
})
// const {data: res} = await this.$http.put('/api/a/u/article/' + row.id, this.editInfo)
this.$http({
method: 'put',
url: '/api/a/u/article/' + row.id,
data: this.$qs.stringify(this.editInfo)
}).then(res => {
// console.log(res);
if (res.data.code === 0) {
console.log(res);
this.$http.get('/api/a/article'+row.id,this.editInfo)
// this.$router.push({
// path: '/home/details'
// })
}
})
点了编辑,调用编辑接口,再跳转到
里面。那这个界面也是一个组件,怎么获取到id。id是传过来的时候加到了路由地址里面,然后再获取是吗。
另外请求的时候,数据为何不能直接用this.article对象,需要将其用stringify转化一下
this.$http({
method: 'post',
url: '/api/a/u/article',
data: this.$qs.stringify(this.article),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
评论