【sdk】登录参数空值处理

dev_chengFeng
gaoxin 2021-06-09 17:13:37 +08:00
parent 8bdda8e1a8
commit 930a16b2e7
2 changed files with 13 additions and 7 deletions

View File

@ -1938,10 +1938,16 @@ end
-- 网络url转码
function decodeURI(s)
if not s then
return ""
end
s = string.gsub(s, '%%(%x%x)', function(h) return string.char(tonumber(h, 16)) end)
return s
end
function encodeURI(s)
if not s then
return ""
end
s = string.gsub(s, "([^%w%.%- ])", function(c) return string.format("%%%02X", string.byte(c)) end)
return string.gsub(s, " ", "+")
end

View File

@ -37,13 +37,13 @@ function this.Initialize()
local result = string.split(loginResp, "#")
result[1] = tonumber(result[1])
if result[1] == SDK_RESULT.SUCCESS then
AppConst.SdkId = result[2]
AppConst.OpenId = result[2]
this.SdkLoginTimeStamp = result[3]
AppConst.TokenStr = result[4]
AppConst.SdkChannel = result[5]
this.extData = result[6]
this.p_appId = result[7]
AppConst.SdkId = result[2] or ""
AppConst.OpenId = result[2] or ""
this.SdkLoginTimeStamp = result[3] or ""
AppConst.TokenStr = result[4] or ""
AppConst.SdkChannel = result[5] or ""
this.extData = result[6] or ""
this.p_appId = result[7] or ""
AppConst.SdkPackageName = AndroidDeviceInfo.Instance:GetPackageName()
end
-- 判断是否是注册并登录