联网api略微调整,http请求处理规范化

This commit is contained in:
MrZ626
2021-01-29 00:45:35 +08:00
parent 8d3910b7a0
commit c8f4faaa95
6 changed files with 35 additions and 15 deletions

View File

@@ -11,9 +11,9 @@ local function task_fetchRooms(task)
coroutine.yield()
local response,request_error=client.poll(task)
if response then
local res=json.decode(response.body)
if res then
if response.code==200 then
if response.code==200 then
local res=json.decode(response.body)
if res.message=="OK"then
rooms=res.room_list
else
LOG.print(text.netErrorCode..response.code..": "..res.message,"warn")