更新地理围栏坐标点
为数据库插入操作添加null检查
添加根证书文件
This commit is contained in:
sudomarcma
2025-07-10 11:05:15 +08:00
parent 8ecbd44948
commit 4952f20528
4 changed files with 37 additions and 8 deletions
+6 -6
View File
@@ -200,11 +200,11 @@ async function startServer() {
const geofence = polygon([
[
[113.310, 23.120],
[113.330, 23.120],
[113.310, 23.140],
[113.330, 23.140],
[113.310, 23.120]
[113.35311466293217, 23.161344441258407],
[113.28591534444001, 23.161344441258407],
[113.28591534444001, 23.091366234233973],
[113.35311466293217, 23.091366234233973],
[113.35311466293217, 23.161344441258407]
]
])
@@ -378,7 +378,7 @@ const geofence = polygon([
const timestamp = new Date()
await db.execute(
'INSERT INTO clock_records (worker_id, event_type, timestamp, qr_code_id, latitude, longitude, notes) VALUES (?, ?, ?, ?, ?, ?, ?)',
[userId, eventType, timestamp, qrCodeValue, latitude, longitude, notes],
[userId, eventType, timestamp, qrCodeValue || null, latitude || null, longitude || null, notes || null],
)
res.status(201).json({ message: 'Clock event recorded successfully' })
} catch (error) {