发表于: 2020-02-13 21:49:27
1 1421
今天完成的事情:
1.推进任务
明天计划的事情:
1.推进任务
遇到的问题和收获:
1.
article: {
title: '`',
type: 1,//0-首页banner 1-找职位banner 2-找精英banner 3-行业大图
status: 1,//1-草稿 2-上线
img: '`',
content: '`',
url: '`',
industry: 1//type为3行业大图时为必填,0-移动互联网 1-电子商务 2-企业服务 3-O2O 4-教育 5-金融 6-游戏
},
先把添加编辑等功能都搞定
draft() {
console.log('存为草稿!');
this.article.status = 1
// const {data: res} = await this.$http.post('/api/a/u/article', this.article)
// const {data: res} = this.$http.post('/api/a/u/article', this.article)
this.$http({
method: 'post',
url: '/api/a/u/article',
data: this.$qs.stringify(this.article),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).then(res => {
console.log(res);
if (res.data.code === 0) {
console.log(res);
this.$message.success('添加成功!');
// await this.$router.push({
this.$router.push({
path: '/home/admin'
})
}
})
},
评论