【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转码 -- 网络url转码
function decodeURI(s) function decodeURI(s)
if not s then
return ""
end
s = string.gsub(s, '%%(%x%x)', function(h) return string.char(tonumber(h, 16)) end) s = string.gsub(s, '%%(%x%x)', function(h) return string.char(tonumber(h, 16)) end)
return s return s
end end
function encodeURI(s) function encodeURI(s)
if not s then
return ""
end
s = string.gsub(s, "([^%w%.%- ])", function(c) return string.format("%%%02X", string.byte(c)) end) s = string.gsub(s, "([^%w%.%- ])", function(c) return string.format("%%%02X", string.byte(c)) end)
return string.gsub(s, " ", "+") return string.gsub(s, " ", "+")
end end

View File

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