@@ -163,6 +163,12 @@ local function checkHotspotShow(data)
163163 commonParam = Native :commonParam ()
164164 }
165165
166+ local videoInfo = Native :getVideoInfo ()
167+
168+ if videoInfo [" extendDict" ] ~= nil then
169+ paramData [" videoInfo" ] = videoInfo [" extendDict" ]
170+ end
171+
166172 local paramDataString = Native :tableToJson (paramData )
167173 -- local OS_HTTP_POST_CHECK_HOTSPOT = OS_HTTP_HOST .. "/api/notice"
168174
@@ -177,10 +183,15 @@ local function checkHotspotShow(data)
177183 }, function (response , errorInfo )
178184 -- print("luaview getVoteCountInfo")
179185
186+ if (errorInfo ~= nil ) then
187+ Native :logReport (" [http request failed], url:" .. OS_HTTP_POST_CHECK_HOTSPOT .. " , msg:" .. errorInfo , 1 , true )
188+ return
189+ end
190+
180191 local requestType = 0
181192 local playStatus = 0
182193 local isShow = 0
183- if (response ~= nil ) then
194+ if (response ~= nil and response . encryptData ~= nil ) then
184195 requestType = 1
185196 -- print("luaview getVoteCountInfo 11"..Native:tableToJson(response))
186197 responseData = Native :aesDecrypt (response .encryptData , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
@@ -197,7 +208,11 @@ local function checkHotspotShow(data)
197208 isShow = 1
198209 end
199210 end
211+ else
212+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_POST_CHECK_HOTSPOT .. " , msg:" .. " Response data code failed, code:" .. tostring (response .resCode ) .. " , msg:" .. tostring (response .resMsg ), 1 , true )
200213 end
214+ else
215+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_POST_CHECK_HOTSPOT .. " , msg:Response data parsing failure" , 1 , true )
201216 end
202217 trackNotice (data , requestType , playStatus , isShow )
203218 end )
@@ -365,6 +380,13 @@ local function getTaglist()
365380 title = Native :getVideoTitle (),
366381 commonParam = Native :commonParam ()
367382 }
383+
384+ local videoInfo = Native :getVideoInfo ()
385+
386+ if videoInfo [" extendDict" ] ~= nil then
387+ paramData [" videoInfo" ] = videoInfo [" extendDict" ]
388+ end
389+
368390 local paramDataString = Native :tableToJson (paramData )
369391 -- print("[LuaView] "..paramDataString)
370392 -- print("[LuaView] "..Native:aesEncrypt(paramDataString, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY))
@@ -374,13 +396,22 @@ local function getTaglist()
374396 data = Native :aesEncrypt (paramDataString , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
375397 }, function (response , errorInfo )
376398 -- print("luaview getTaglist")
377- if (response == nil ) then
399+
400+ if (errorInfo ~= nil ) then
401+ Native :logReport (" [http request failed], url:" .. OS_HTTP_GET_TAG_LIST .. " , msg:" .. errorInfo , 1 , true )
402+ return
403+ end
404+
405+ if (response == nil or response .encryptData == nil ) then
406+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_POST_CHECK_HOTSPOT .. " , msg:Response data parsing failure" , 1 , true )
378407 return
379408 end
380409 responseData = Native :aesDecrypt (response .encryptData , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
410+ print (" luaview " .. responseData )
381411
382412 response = toTable (responseData )
383413 if (response .resCode ~= " 00" ) then
414+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_TAG_LIST .. " , msg:" .. " Response data code failed, code:" .. tostring (response .resCode ) .. " , msg:" .. tostring (response .resMsg ), 1 , true )
384415 return
385416 end
386417 local dataTable = response .launchInfoList
@@ -428,8 +459,15 @@ local function getSimulationTag()
428459 videoId = Native :nativeVideoID (),
429460 commonParam = Native :commonParam ()
430461 }
431- local extendJson = Native :getConfigExtendJSONString ()
432- local extendTable = toTable (extendJson )
462+
463+ local extendTable = nil
464+
465+ local videoInfo = Native :getVideoInfo ()
466+
467+ if videoInfo [" extendDict" ] ~= nil then
468+ paramData [" videoInfo" ] = videoInfo [" extendDict" ]
469+ extendTable = videoInfo [" extendDict" ]
470+ end
433471
434472 if extendTable [" creativeName" ] ~= nil then
435473 paramData [" creativeName" ] = extendTable [" creativeName" ]
@@ -443,13 +481,22 @@ local function getSimulationTag()
443481 data = Native :aesEncrypt (paramDataString , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
444482 }, function (response , errorInfo )
445483 -- print("luaview getSimulationTag")
446- if (response == nil ) then
484+
485+ if (errorInfo ~= nil ) then
486+ Native :logReport (" [http request failed], url:" .. OS_HTTP_GET_SIMULATION_TAG .. " , msg:" .. errorInfo , 1 , true )
447487 return
448488 end
489+
490+ if (response == nil or response .encryptData == nil ) then
491+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_SIMULATION_TAG .. " , msg:Response data parsing failure" , 1 , true )
492+ return
493+ end
494+
449495 responseData = Native :aesDecrypt (response .encryptData , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
450496 -- print("luaview "..responseData)
451497 response = toTable (responseData )
452498 if (response .resCode ~= " 00" ) then
499+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_SIMULATION_TAG .. " , msg:" .. " Response data code failed, code:" .. tostring (response .resCode ) .. " , msg:" .. tostring (response .resMsg ), 1 , true )
453500 return
454501 end
455502 local dataTable = response .launchInfoList
@@ -486,6 +533,13 @@ local function getResourcelist()
486533 videoId = Native :nativeVideoID (),
487534 commonParam = Native :commonParam ()
488535 }
536+
537+ local videoInfo = Native :getVideoInfo ()
538+
539+ if videoInfo [" extendDict" ] ~= nil then
540+ paramData [" videoInfo" ] = videoInfo [" extendDict" ]
541+ end
542+
489543 local paramDataString = Native :tableToJson (paramData )
490544 -- print("[LuaView] getResourcelist")
491545 -- print("[LuaView] "..Native:aesEncrypt(paramDataString, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY))
@@ -494,7 +548,15 @@ local function getResourcelist()
494548 device_type = deviceType ,
495549 data = Native :aesEncrypt (paramDataString , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
496550 }, function (response , errorInfo )
497- if (response == nil ) then
551+
552+ if (errorInfo ~= nil ) then
553+ Native :logReport (" [http request failed], url:" .. OS_HTTP_GET_RESOURCE_LIST .. " , msg:" .. errorInfo , 1 , true )
554+ reloadGetResourcelist ()
555+ return
556+ end
557+
558+ if (response == nil or response .encryptData == nil ) then
559+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_RESOURCE_LIST .. " , msg:Response data parsing failure" , 1 , true )
498560 reloadGetResourcelist ()
499561 return
500562 end
@@ -503,11 +565,13 @@ local function getResourcelist()
503565 -- print("luaview "..responseData)
504566
505567 response = toTable (responseData )
568+
506569 if (response == nil ) then
507570 reloadGetResourcelist ()
508571 return
509572 end
510573 if (response .resCode ~= " 00" ) then
574+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_RESOURCE_LIST .. " , msg:" .. " Response data code failed, code:" .. tostring (response .resCode ) .. " , msg:" .. tostring (response .resMsg ), 1 , true )
511575 reloadGetResourcelist ()
512576 return
513577 end
@@ -561,6 +625,13 @@ function show(args)
561625 videoId = Native :nativeVideoID (),
562626 commonParam = Native :commonParam ()
563627 }
628+
629+ local videoInfo = Native :getVideoInfo ()
630+
631+ if videoInfo [" extendDict" ] ~= nil then
632+ paramData [" videoInfo" ] = videoInfo [" extendDict" ]
633+ end
634+
564635 local paramDataString = Native :tableToJson (paramData )
565636 -- print("luaview "..Native:aesEncrypt(paramDataString, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY))
566637 mainNode .request :post (OS_HTTP_GET_CONFIG , {
@@ -569,13 +640,22 @@ function show(args)
569640 target_id = roomId ,
570641 data = Native :aesEncrypt (paramDataString , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
571642 }, function (response , errorInfo )
572- if (response == nil ) then
643+
644+ if (errorInfo ~= nil ) then
645+ Native :logReport (" [http request failed], url:" .. OS_HTTP_GET_CONFIG .. " , msg:" .. errorInfo , 1 , true )
646+ return
647+ end
648+
649+ if (response == nil or response .encryptData == nil ) then
650+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_CONFIG .. " , msg:Response data parsing failure" , 1 , true )
573651 return
574652 end
653+
575654 responseData = Native :aesDecrypt (response .encryptData , OS_HTTP_PUBLIC_KEY , OS_HTTP_PUBLIC_KEY )
576655 -- print("luaview "..responseData)
577656 response = toTable (responseData )
578657 if (response .resCode ~= " 00" ) then
658+ Native :logReport (" [HTTP response incorrect], url:" .. OS_HTTP_GET_CONFIG .. " , msg:" .. " Response data code failed, code:" .. tostring (response .resCode ) .. " , msg:" .. tostring (response .resMsg ), 1 , true )
579659 return
580660 end
581661
0 commit comments