import {
HTTP
} from '../util/http.js'
class LikeModel extends HTTP {
like(behavior, artID, category) {
let url = behavior == 'like' ? 'like' : 'like/cancel'
this.request({
url:url,
method:'POST',
data:{
art_id:artID,
type:category
}
})
}
}
export {LikeModel}
onLoad: function(options) {
clsssicModel.getLastest((res)=>{
//数据更新
this.setData({
classic:res
})
})
},
onLike: function(event) {
let behavior = event.detail.behavior
console.log(behavior)
likeModel.like(behavior,this.data.classic.id,this.data.classic.type)
},
点赞老是报400错误,请问这是什么原因,是按老师的方法写的,