bug: 我的收藏 取消收藏

This commit is contained in:
fanlin
2021-07-28 11:30:23 +08:00
parent 61f227c037
commit 305b6da760
@@ -62,7 +62,7 @@
<el-col :span="4" :offset="3">创建时间{{getDate(item.creationTime)}}</el-col> <el-col :span="4" :offset="3">创建时间{{getDate(item.creationTime)}}</el-col>
</div> </div>
<el-col :span="4"> <el-col :span="4">
<el-button size="mini" @click="cancelStandard(item.id)" style="margin-top: -5px; border: 1px dashed #dcdee2">取消收藏</el-button> <el-button size="mini" @click="cancelStandard(item)" style="margin-top: -5px; border: 1px dashed #dcdee2">取消收藏</el-button>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@@ -150,7 +150,7 @@ export default {
}, e => {}) }, e => {})
}, },
// 取消收藏 // 取消收藏
cancelStandard (id) { cancelStandard (item) {
this.$confirm('确定取消收藏此数据?', '提示', { this.$confirm('确定取消收藏此数据?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@@ -158,16 +158,18 @@ export default {
confirmButtonClass: 'common-button-primary', confirmButtonClass: 'common-button-primary',
roundButton: true roundButton: true
}).then(() => { }).then(() => {
var json = {} // var json = {
json.userId = this.$store.getters.userInfo.userId // id: item.collectId
json.id = id // }
this.$http.postData('/sarPersonalCenter/sar-user-star/delete',json, { // json.userId = this.$store.getters.userInfo.userId
this.$http.put('person/personCollect/updateByUserId',{'id': item.id}, {
_this: this _this: this
}, res => { }, res => {
if (res.ok) { if (res.ok) {
this.$message.success('已取消收藏') this.$message.success('已取消收藏')
this.contentOpen = false this.contentOpen = false
this.pageChange(1) this.pageChange(1)
this.selectStandard()
} }
}, e => { }, e => {
}) })