From 3b5c522aad27543ea3cdddf43ff963c14c06adf2 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 12 十月 2026 13:17:19 +0800
Subject: [PATCH] fix(cache): 修复权限缓存清理脚本并更新公司配置
---
scripts/clear_unit_permission_cache.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/scripts/clear_unit_permission_cache.py b/scripts/clear_unit_permission_cache.py
index 615405d..34b1571 100644
--- a/scripts/clear_unit_permission_cache.py
+++ b/scripts/clear_unit_permission_cache.py
@@ -1,6 +1,7 @@
import socket
import re
import json
+import sys
from pathlib import Path
source = Path('yudao-server/src/main/resources/application-local.yaml').read_text(encoding='utf-8')
@@ -44,6 +45,14 @@
keys.extend(key for key in batch if key.decode().endswith(suffixes))
if cursor == b'0':
break
+menu_suffixes = tuple(':' + str(int(value)) for value in sys.argv[1:])
+if menu_suffixes:
+ cursor = b'0'
+ while True:
+ cursor, batch = command('SCAN', cursor, 'MATCH', '*menu_role_ids*', 'COUNT', 100)
+ keys.extend(key for key in batch if key.decode().endswith(menu_suffixes))
+ if cursor == b'0':
+ break
print('Target permission cache keys:', [key.decode() for key in keys])
if keys:
print('Deleted permission cache entries:', command('DEL', *keys))
--
Gitblit v1.9.3