字典详情编辑、删除优化修复,https://github.com/elunez/eladmin-mp/issues/15

close https://github.com/elunez/eladmin-mp/issues/15
This commit is contained in:
Zheng Jie 2023-08-02 23:44:35 +08:00
parent a102ae49d0
commit 277a17cbd3

View File

@ -63,9 +63,10 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
public void update(DictDetail resources) {
DictDetail dictDetail = getById(resources.getId());
resources.setId(dictDetail.getId());
// 更新数据
saveOrUpdate(resources);
// 清理缓存
delCaches(resources);
delCaches(dictDetail);
}
@Override
@ -84,7 +85,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
}
public void delCaches(DictDetail dictDetail){
Dict dict = dictMapper.selectById(dictDetail.getDict().getId());
Dict dict = dictMapper.selectById(dictDetail.getDictId());
redisUtils.del(CacheKey.DICT_NAME + dict.getName());
}
}