update(server): connect api to erp and add func remove user
This commit is contained in:
parent
8ad0ba9c25
commit
2675a60ffc
|
|
@ -8,6 +8,7 @@ from dotenv import load_dotenv
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
HOST = os.getenv("MS_HOST", "http://10.20.2.26:3002")
|
HOST = os.getenv("MS_HOST", "http://10.20.2.26:3002")
|
||||||
|
AUTH_TOKEN = os.getenv("MS_AUTH_TOKEN", "")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,9 +31,10 @@ def sync_checkin(email: str, timestamp_ms: int, image_data: bytes, student_name:
|
||||||
"image": image_b64,
|
"image": image_b64,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
|
||||||
print("[sync_checkin] payload:", {k: v for k, v in payload.items() if k != "image"})
|
print("[sync_checkin] payload:", {k: v for k, v in payload.items() if k != "image"})
|
||||||
try:
|
try:
|
||||||
response = requests.post(HOST + "/api/log-time/check-in-out", json=payload)
|
response = requests.post(HOST + "/api/log-time/check-in-out", json=payload, headers=headers)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
res = response.json()
|
res = response.json()
|
||||||
print("[sync_checkin] response:", res)
|
print("[sync_checkin] response:", res)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue