# -*- coding: utf-8 -*-
"""扫主 demo index.html 的 /api 调用面(票 03 审计用,E 盘路径版)。"""
import io
import re
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
DEMO = r'e:\code\crm-backend-matt\.scratch\customer-e2e\demo\index.html'
txt = open(DEMO, encoding='utf-8').read()
calls = re.findall(r'[\'"](/api/[a-zA-Z0-9/_?=&.\-]+)[\'"]', txt)
seen = []
for c in calls:
c2 = re.sub(r'\?.*', '', c)
if c2 not in seen:
seen.append(c2)
print(len(calls), 'calls,', len(seen), 'unique paths:')
for s in seen:
print(' ', s)