www下载错误卡死修改
(cherry picked from commit 8c146837d826d97820a4eef73f1a125bf448dd39)dev_chengFeng
parent
021de51a59
commit
f07b92346a
|
|
@ -20,7 +20,7 @@ function this.SetTaiChuMiJuanData(msg,fun)
|
||||||
local datas
|
local datas
|
||||||
if not msg or not msg.secretvolume or #msg.secretvolume < 1 then
|
if not msg or not msg.secretvolume or #msg.secretvolume < 1 then
|
||||||
---------------------------------------------测试数据
|
---------------------------------------------测试数据
|
||||||
-- datas = {[1] = {id = 1,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=eed09eaec41c4d18abc08ddbb3452fdc_s&infoId=II003LYBG9XPE7A",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-e1fd1cf39f6abfc1cdb35be92b6bc3d0.jpg?time=1628668135&signature=89DFF74746F289F5ED404A0BC627387A"},
|
--datas = {[1] = {id = 1,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=eed09eaec41c4d18abc08ddbb3452fdc_s&infoId=II00",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-e1fd1cf39f6abfc1cdb35be92b6bc3d0.jpg?time=1628668135&signature=89DFF74746F289F5ED404A0B"},
|
||||||
-- [2] = {id = 2,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=b5f830ada8a04ab2bac07efa621ba453_s&infoId=IT00TLAILJ9X7KZ",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-8e07612db47c17ec56fbba613d31cc7b.jpg?time=1628668250&signature=CA7856DD83E45651B5E2274D76D8BF48"},
|
-- [2] = {id = 2,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=b5f830ada8a04ab2bac07efa621ba453_s&infoId=IT00TLAILJ9X7KZ",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-8e07612db47c17ec56fbba613d31cc7b.jpg?time=1628668250&signature=CA7856DD83E45651B5E2274D76D8BF48"},
|
||||||
-- [3] = {id = 3,strategyLink = "https://mini.eastday.com/nsa/210811133830637498814.html?qid=02034",windowLink = "https://lupic.cdn.bcebos.com/20191203/3016121736_23.jpg"},
|
-- [3] = {id = 3,strategyLink = "https://mini.eastday.com/nsa/210811133830637498814.html?qid=02034",windowLink = "https://lupic.cdn.bcebos.com/20191203/3016121736_23.jpg"},
|
||||||
-- [4] = {id = 4,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=b5f830ada8a04ab2bac07efa621ba453_s&infoId=IT003LL8LJF1X9E",windowLink = "https://lupic.cdn.bcebos.com/20210629/938550_23.jpg"},
|
-- [4] = {id = 4,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=b5f830ada8a04ab2bac07efa621ba453_s&infoId=IT003LL8LJF1X9E",windowLink = "https://lupic.cdn.bcebos.com/20210629/938550_23.jpg"},
|
||||||
|
|
@ -28,7 +28,7 @@ function this.SetTaiChuMiJuanData(msg,fun)
|
||||||
-- [6] = {id = 6,strategyLink = "http://ex.chinadaily.com.cn/exchange/partners/82/rss/channel/cn/columns/sz8srm/stories/WS6111cd6fa3101e7ce975deae.html",windowLink = "http://cn.chinadaily.com.cn/image/2018/j-2.jpg"},
|
-- [6] = {id = 6,strategyLink = "http://ex.chinadaily.com.cn/exchange/partners/82/rss/channel/cn/columns/sz8srm/stories/WS6111cd6fa3101e7ce975deae.html",windowLink = "http://cn.chinadaily.com.cn/image/2018/j-2.jpg"},
|
||||||
-- [7] = {id = 7,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=bdba7a24fe304b598695dbd25219f8e4_s&infoId=II003JLZ9IT187M",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-9987eceb8e5181eadb24778c05d9195b.jpg?time=1628668882&signature=842592897E6CE7C3DB594FAFC515B22E"},
|
-- [7] = {id = 7,strategyLink = "https://pc.yiyouliao.com/msn/article.html?recId=bdba7a24fe304b598695dbd25219f8e4_s&infoId=II003JLZ9IT187M",windowLink = "https://img-nos.yiyouliao.com/inforec-20210811-9987eceb8e5181eadb24778c05d9195b.jpg?time=1628668882&signature=842592897E6CE7C3DB594FAFC515B22E"},
|
||||||
-- [8] = {id = 8,strategyLink = "https://mini.eastday.com/nsa/210811065335765353208.html?qid=02034",windowLink = "https://lupic.cdn.bcebos.com/20200412/3062717289_23_800_349.jpg"},
|
-- [8] = {id = 8,strategyLink = "https://mini.eastday.com/nsa/210811065335765353208.html?qid=02034",windowLink = "https://lupic.cdn.bcebos.com/20200412/3062717289_23_800_349.jpg"},
|
||||||
-- }
|
--}
|
||||||
if fun then
|
if fun then
|
||||||
fun(msg)
|
fun(msg)
|
||||||
end
|
end
|
||||||
|
|
@ -65,12 +65,12 @@ function this.GetATaiChuMiJuanData(data)
|
||||||
local www = WWW.New(str)
|
local www = WWW.New(str)
|
||||||
coroutine.www(www)
|
coroutine.www(www)
|
||||||
local m_sprite
|
local m_sprite
|
||||||
local tex2d = www.texture
|
if www.error then
|
||||||
if not tex2d then
|
|
||||||
Log("data.windowLink:"..str)
|
Log("data.windowLink:"..str)
|
||||||
LogError("data.windowLink:下载失败"..www.error)
|
LogError(string.format("data.windowLink:%s下载失败error:%s",data.windowLink,www.error))
|
||||||
m_sprite = Util.LoadSprite("taichuMiJuanDefaultBanner")
|
m_sprite = Util.LoadSprite("taichuMiJuanDefaultBanner")
|
||||||
else
|
else
|
||||||
|
local tex2d = www.texture
|
||||||
m_sprite = Sprite.Create(tex2d, Rect.New(0, 0, tex2d.width, tex2d.height), Vector2.New(0, 0));
|
m_sprite = Sprite.Create(tex2d, Rect.New(0, 0, tex2d.width, tex2d.height), Vector2.New(0, 0));
|
||||||
end
|
end
|
||||||
if not this.TaiChuMiJuanData[data.id] then
|
if not this.TaiChuMiJuanData[data.id] then
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,12 @@ function coroutine.www(www, co)
|
||||||
local timer = nil
|
local timer = nil
|
||||||
|
|
||||||
local action = function()
|
local action = function()
|
||||||
if not www.isDone then
|
if www.error then
|
||||||
return
|
LogError("www.error:"..www.error)
|
||||||
end
|
elseif not www.isDone then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
comap[co] = nil
|
comap[co] = nil
|
||||||
timer:Stop()
|
timer:Stop()
|
||||||
timer.func = nil
|
timer.func = nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue