fix: 【ID1004129】【仪表板】一个用户取消收藏后其他收藏的用户也没有了

This commit is contained in:
fit2cloud-chenyw 2021-06-04 16:58:50 +08:00
parent d2ac09d60e
commit 03f43fde95
3 changed files with 7 additions and 11 deletions

View File

@ -26,12 +26,7 @@ public class StoreServer implements StoreApi {
}
@Override
public void remove(String storeId) {
try {
Long id = Long.parseLong(storeId);
storeService.remove(id);
} catch (Exception e) {
storeService.removeByPanelId(storeId);
}
public void remove(String panelId) {
storeService.removeByPanelId(panelId);
}
}

View File

@ -34,14 +34,15 @@ public class StoreService {
}
public void removeByPanelId(String panelId) {
Long userId = AuthUtils.getUser().getUserId();
PanelStoreExample panelStoreExample = new PanelStoreExample();
panelStoreExample.createCriteria().andPanelGroupIdEqualTo(panelId);
panelStoreExample.createCriteria().andPanelGroupIdEqualTo(panelId).andUserIdEqualTo(userId);
panelStoreMapper.deleteByExample(panelStoreExample);
}
public void remove(Long storeId) {
/*public void remove(Long storeId) {
panelStoreMapper.deleteByPrimaryKey(storeId);
}
}*/
/**
* 按照当前用户ID查询收藏仪表板

View File

@ -67,7 +67,7 @@ export default {
return data
},
remove(row) {
deleteEnshrine(row.storeId).then(res => {
deleteEnshrine(row.panelGroupId).then(res => {
this.initData()
this.panelInfo && this.panelInfo.id && row.panelGroupId === this.panelInfo.id && this.setMainNull()
})