axios请求接口
1.非json格式
var me=this;
let fd = new FormData()
fd.append(‘file’, f.file)
fd.append(‘fid’,this.axios.post(me.url+"/file/uploadfile", fd)
.then(function (result) {
if(result.data.resulttrue){
me.KaTeX parse error: Expected 'EOF', got '}' at position 167: … }̲
…message({
message: result.data.msg,
type: ‘error’
})
}
})
2**.json格式的**
var para = {
tid:this.tid,
title: this.title,
content: this.content,
page:this.radio,
score:this.score
};
var me=this;
me.KaTeX parse error: Expected '}', got 'EOF' at end of input: … me.message({
message: ‘发帖成功’,
type: ‘success’
})
me.KaTeX parse error: Expected '}', got 'EOF' at end of input: …th: `/noteList/{me.tid}`
})
}
if(result.data.resultfalse){
me.router.push({path: ‘/login’});
}
})