json库使用方式调整

This commit is contained in:
MrZ626
2020-12-14 18:34:35 +08:00
parent f17724c7ef
commit 2381dca463
6 changed files with 69 additions and 90 deletions

View File

@@ -118,19 +118,17 @@ function Tmr.load()
VOC.play("welcome_voc")
httpRequest(TICK.httpREQ_launch,"/tech/api/v1/app/info")
if ACCOUNT.auth_token then
local success,data=json.encode({
local res=json.encode{
email=ACCOUNT.email,
auth_token=ACCOUNT.auth_token,
})
if not success then
LOG.print(text.jsonError,"warn")
else
}
if res then
httpRequest(
TICK.httpREQ_autoLogin,
"/tech/api/v1/users",
"GET",
{["Content-Type"]="application/json"},
data
res
)
end
end