Merge pull request #257 from link2fun/fix-root-org-can-be-delete

fix: 接口需要禁止删除组织 Organizations#ROOT_ORG_ID 否则会导致同步器工作异常
This commit is contained in:
MaxKey 2025-11-05 08:45:04 +08:00 committed by GitHub
commit 4646c679a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -137,6 +137,9 @@ public class OrganizationsController {
@RequestMapping(value={"/delete"}, produces = {MediaType.APPLICATION_JSON_VALUE})
public Message<?> delete(@RequestParam("ids") List<String> ids,@CurrentUser UserInfo currentUser) {
logger.debug("-delete ids : {} " , ids);
if (ids != null && ids.contains(Organizations.ROOT_ORG_ID)) {
return new Message<Organizations>(Message.FAIL, "根组织不允许删除");
}
if (organizationsService.deleteBatch(ids)) {
systemLog.insert(
ConstsEntryType.ORGANIZATION,