Files
sc-lktx-mp/sc-lktx-backend/scripts/_check_depts.py
huangjin fe3ad20fe2 'init'
2026-06-29 17:34:59 +08:00

11 lines
322 B
Python

import requests, os
token = os.environ.get("ADMIN_TOKEN", "")
if not token:
token = input("ADMIN_TOKEN: ").strip()
resp = requests.get("http://localhost:28175/v1/admin/departments-all",
headers={"Authorization": f"Bearer {token}"})
for d in resp.json().get("data", []):
print(f'{d["id"]:>3d} | {d["name"]}')