implemented register and login function

This commit is contained in:
Particle_G
2020-11-24 02:18:35 +08:00
committed by MrZ626
parent 9265101025
commit 8f2b62ccc0
15 changed files with 106 additions and 52 deletions

View File

@@ -7,15 +7,19 @@ function keyDown.login(key)
elseif #password==0 then
LOG.print(text.noPassword)return
end
local data=urlencode.encode{
local success,data=json.encode({
username=username,
password=password,
}
})
if not success then
LOG.print(text.jsonError,"warn")
return
end
httpRequest(
TICK.httpREQ_register,
"api/account/register",
"POST",
{["Content-Type"]="application/x-www-form-urlencoded"},
TICK.httpREQ_login,
"/tech/api/v1/users",
"GET",
{["Content-Type"]="application/json"},
data
)
elseif key=="escape"then