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

@@ -13,16 +13,20 @@ function keyDown.register(key)
elseif password~=password2 then
LOG.print(text.diffPassword)return
end
local data=urlencode.encode{
local success,data=json.encode({
username=username,
email=email,
password=password,
}
})
if not success then
LOG.print(text.jsonError,"warn")
return
end
httpRequest(
TICK.httpREQ_register,
"api/account/register",
"/tech/api/v1/users",
"POST",
{["Content-Type"]="application/x-www-form-urlencoded"},
{["Content-Type"]="application/json"},
data
)
elseif key=="escape"then