初步完成merchant和admin不同role的展示内容逻辑2
This commit is contained in:
35
process.py
Normal file
35
process.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import re
|
||||
|
||||
with open(r'c:\Users\黄镇堡\AppData\Roaming\Code\User\workspaceStorage\51c4c3615fa7807ba1c5a788ca077b83\GitHub.copilot-chat\chat-session-resources\18954447-db08-4bea-a5c4-72e8c9aaf171\call_MHxIMm13YmUwWkdUcjI5b3pueHM__vscode-1773276031647\content.txt', 'r', encoding='utf-8') as f:
|
||||
text = f.read()
|
||||
|
||||
auth_lines = []
|
||||
bz_lines = []
|
||||
|
||||
auth_kw = ['token', 'user', 'role', 'merchant', 'admin', 'auth', 'id']
|
||||
|
||||
for line in text.split('\n'):
|
||||
if not line.strip(): continue
|
||||
|
||||
match = re.match(r'^([a-zA-Z]:\\.*?):(\d+):\s*(.*)$', line)
|
||||
if match:
|
||||
path = match.group(1)
|
||||
lineno = match.group(2)
|
||||
content = match.group(3)
|
||||
fname = path.split(r'\\')[-1]
|
||||
|
||||
is_auth = any(k in content.lower() for k in auth_kw)
|
||||
output = f'{fname}:{lineno}: {content}'
|
||||
if is_auth:
|
||||
auth_lines.append(output)
|
||||
else:
|
||||
bz_lines.append(output)
|
||||
|
||||
print(f'=== AUTH CACHE USAGES ===')
|
||||
for l in auth_lines:
|
||||
if 'ak-req.uts' not in l and 'aksupa.uts' not in l:
|
||||
print(l[:100])
|
||||
|
||||
print(f'\n=== BZ CACHE USAGES (first 20) ===')
|
||||
for l in bz_lines[:20]:
|
||||
print(l[:100])
|
||||
Reference in New Issue
Block a user