From 2efc05d570d23d86b02b6fd8f73491b3d520bde0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 10:47:31 +0800
Subject: [PATCH] fix(mes-dv): 设备模块列表查询补充按创建时间降序排序
---
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