feat: 增加机器位置手动编辑功能及公开查看界面
This commit is contained in:
+17
-16
@@ -776,23 +776,24 @@ local function backgroundTicketUploadTask()
|
||||
end
|
||||
|
||||
local function backgroundLocationSyncTask()
|
||||
while true do
|
||||
if gps and type(gps.locate) == "function" then
|
||||
local x, y, z = gps.locate(2)
|
||||
if x and y and z then
|
||||
local payload = {
|
||||
device_id = currentDeviceId(),
|
||||
type = "TicketMachine",
|
||||
station = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or state.stationName,
|
||||
station_code = state.stationCode or CURRENT_STATION_CODE,
|
||||
x = x,
|
||||
y = y,
|
||||
z = z
|
||||
}
|
||||
postJSONResult(API_BASE .. '/machine-location', payload)
|
||||
end
|
||||
sleep(5)
|
||||
if gps and type(gps.locate) == "function" then
|
||||
local x, y, z = gps.locate(2)
|
||||
if x and y and z then
|
||||
local payload = {
|
||||
device_id = currentDeviceId(),
|
||||
type = "TicketMachine",
|
||||
station = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or state.stationName,
|
||||
station_code = state.stationCode or CURRENT_STATION_CODE,
|
||||
x = x,
|
||||
y = y,
|
||||
z = z
|
||||
}
|
||||
postJSONResult(API_BASE .. '/machine-location', payload)
|
||||
end
|
||||
sleep(60)
|
||||
end
|
||||
while true do
|
||||
sleep(86400)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user