Main.py:WHITE_HOSTS 增 rollcall/viper/venom 主机,STATIC_SITES 增 rollcall/venom 静态根,静态站点路由下 /API/ 前缀请求转交 Django 处理。 gvsds:settings.py 注册 gvsds.apps.rollcall,urls.py 挂载 API/RollCall/;新增 rollcall 应用(模型/视图/路由/迁移 + RollCallManager 数据访问层)与 TempLate/rollcall 前端站点。 .gitignore:排除 Viper/Venom 前端工程与部署产物、TempLate/FTP 二进制分发目录。
17 lines
726 B
Python
17 lines
726 B
Python
import re, subprocess, tempfile, os
|
|
|
|
js = open(r'D:\SMANAGE\TempLate\rollcall\script.js', encoding='utf-8').read()
|
|
with tempfile.NamedTemporaryFile('w', suffix='.js', delete=False, encoding='utf-8') as f:
|
|
f.write(js)
|
|
tmp = f.name
|
|
r = subprocess.run(['node', '--check', tmp], capture_output=True, text=True)
|
|
os.unlink(tmp)
|
|
print('script.js 语法:', 'OK' if r.returncode == 0 else r.stderr)
|
|
|
|
html = open(r'D:\SMANAGE\TempLate\rollcall\index.html', encoding='utf-8').read()
|
|
html_ids = set(re.findall(r'id="([\w-]+)"', html))
|
|
js_ids = set(re.findall(r"\$\('([\w-]+)'\)", js))
|
|
missing = js_ids - html_ids
|
|
print('引用但未定义 id:', missing if missing else '无')
|
|
print('refreshBtn 存在:', 'refreshBtn' in html_ids)
|