修复 MagicEntity.getId()" because "entity" is null 异常

This commit is contained in:
zeng
2024-10-17 10:57:11 +08:00
parent 38a3a7b9ec
commit e21e80cfa0

View File

@@ -83,6 +83,9 @@ public class MagicResourceController extends MagicController implements MagicExc
.read(bytes);
isTrue(allowVisit(request, Authorization.SAVE, entity), PERMISSION_INVALID);
// 自动保存的代码,和旧版代码对比,如果一致,则不保存,直接返回。
if (entity!= null){
return new JsonBean<>(null);
}
if(entity.getId() != null && "1".equals(auto)){
MagicEntity oldInfo = service.file(entity.getId());
if(oldInfo != null && Objects.equals(oldInfo, entity)){