请问一下,lua对接易如意登陆验证,这样写对吗?
function tbLogin:Alogin(self)if self.nState == STATE_UNLOGIN then
local szAccount = self.InputAccount:GetText()
if szAccount == "" then
Ui:OpenWindow("MessageBox", "请输入账号")
return
end
local NetworkSet = Login.ClientSet.Network
local szToken = Ui.FTDebug.szToken == "" and NetworkSet.Token or Ui.FTDebug.szToken
local szPassword = self.InputPassword:GetText()
if szPassword == "" then
Ui:OpenWindow("MessageBox", "请输入密码")
return
end
local szUrl = "http://yz.xmdpay.cn/api.php?act=user_logon&app=10000&"..szAccount.."&password="..szPassword..""
Sdk:DoHttpRequest(szUrl, "", function(szResult)
if szResult == "NoAccount" then
Ui:OpenWindow("MessageBox", "账号不存在")
return
end
if szResult == "LoginFail" then
Ui:OpenWindow("MessageBox", "账号密码错误")
return
end
if szResult == "Accountban" then
Ui:OpenWindow("MessageBox", "您的帐号因违反协议已经被封停!")
return
end
if szResult == "LoginOK" then
Login:ConnectGateWay(szAccount, szToken)
end
end)
end
end
不懂 不会lua 可以看我帖子哦 6666666666666666666666666666666 能拿走源码吗{:4_110:}
页:
[1]