修正一些新登录界面小问题

This commit is contained in:
MrZ_26
2023-01-15 00:47:24 +08:00
parent 8aac152ee6
commit 88d05c2354
6 changed files with 22 additions and 22 deletions

View File

@@ -487,9 +487,9 @@ return {
}, },
login={ login={
title="Sign In", title="Sign In",
-- ticket="Auth Ticket", ticket="***",
-- authorize="Open Authorizing Page", authorize="**?",
-- submit="Submit", submit="<!>",
}, },
reset_password={ reset_password={
title="R ***", title="R ***",

View File

@@ -746,9 +746,9 @@ return {
}, },
login={ login={
title="登录", title="登录",
ticket="授权令牌", ticket="登录口令",
authorize="打开授权页面", authorize="去官网获取口令",
submit="提交", submit="登录",
}, },
reset_password={ reset_password={
title="重置密码", title="重置密码",

View File

@@ -746,9 +746,9 @@ return {
}, },
login={ login={
title="登錄", title="登錄",
-- ticket="Auth Ticket", ticket="登錄口令",
-- authorize="Open Authorizing Page", authorize="去官網獲取口令",
-- submit="Submit", submit="登錄",
}, },
reset_password={ reset_password={
title="重設密碼", title="重設密碼",

View File

@@ -120,20 +120,20 @@ local function getMsg(request,timeout)
end end
end end
function NET.autoLogin() function NET.login(auto)
if not TASK.lock('autoLogin') then return end if not TASK.lock('login') then return end
TASK.new(function() TASK.new(function()
WAIT{ WAIT{
quit=function() quit=function()
TASK.unlock('autoLogin') TASK.unlock('login')
HTTP.deletePool('autoLogin') HTTP.deletePool('login')
end, end,
timeout=12.6, timeout=12.6,
} }
if USER.aToken then if USER.aToken then
local res=getMsg({ local res=getMsg({
pool='autoLogin', pool='login',
url='cafuuchino1.3322.org:8081', url='cafuuchino1.3322.org:8081',
path='/studio26f/api/v1/auth/check', path='/studio26f/api/v1/auth/check',
headers={["x-access-token"]=USER.aToken}, headers={["x-access-token"]=USER.aToken},
@@ -146,12 +146,12 @@ function NET.autoLogin()
end end
saveUser() saveUser()
NET.ws_connect() NET.ws_connect()
if not auto then-- Quit login menu
SCN.pop()
end
SCN.go('net_menu') SCN.go('net_menu')
WAIT.interrupt() WAIT.interrupt()
return return
else
WAIT.interrupt()
return
end end
end end

View File

@@ -10,7 +10,7 @@ local function _submit()
else else
USER.aToken=tickets:sub(1,64) USER.aToken=tickets:sub(1,64)
USER.oToken=tickets:sub(65) USER.oToken=tickets:sub(65)
NET.autoLogin() NET.login()
end end
end end
local function _paste() local function _paste()
@@ -50,9 +50,9 @@ scene.widgetList={
WIDGET.newInputBox{name='ticket', x=280, y=200,w=730,h=320,font=30,regex="[0-9A-Z]",limit=128}, WIDGET.newInputBox{name='ticket', x=280, y=200,w=730,h=320,font=30,regex="[0-9A-Z]",limit=128},
WIDGET.newKey{name='authorize', x=430, y=640,w=300,h=80,font=40,code=_authorize}, WIDGET.newKey{name='authorize', x=430, y=600,w=300,h=80,font=40,code=_authorize},
WIDGET.newKey{name='submit', x=755, y=640,w=300,h=80,font=40,code=_submit}, WIDGET.newKey{name='submit', x=755, y=600,w=300,h=80,font=40,code=_submit},
WIDGET.newKey{name='paste', x=970, y=640,w=80,font=40,fText=CHAR.icon.import,code=_paste}, WIDGET.newKey{name='paste', x=970, y=600,w=80,font=40,fText=CHAR.icon.import,code=_paste},
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'}, WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=pressKey'escape'},
} }

View File

@@ -76,7 +76,7 @@ function scene.keyDown(key,isRep)
end end
elseif key=='a' then elseif key=='a' then
if _testButton(3) then if _testButton(3) then
NET.autoLogin() NET.login(true)
end end
elseif key=='z' then elseif key=='z' then
if _testButton(4) then if _testButton(4) then