Skip to content

Commit ad35c09

Browse files
author
rain
committed
通过火焰图优化pack组返回报文部分代码
1 parent d3b81d9 commit ad35c09

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lua_ad/libs/pack.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ function _M.pack(data, bid_price, stageid, result, paymode)
3333
bid_dict['nurl'] = nurl
3434

3535
--{"600x600": "http://click.bangzhumai.com/static/picture/ymjy-cp-600-600.jpg"}
36-
local m, err = ngx.re.match(bid_imp_orig.pic_images, '.*"(.*)".*:.*"(.*)"')
37-
local img_url = m[2]
36+
--local m, err = ngx.re.match(bid_imp_orig.pic_images, '.*"(.*)".*:.*"(.*)"')
37+
--local img_url = m[2]
38+
local s_from, _ = string.find(bid_imp_orig.pic_images, 'http')
39+
local s_to, _ = string.find(bid_imp_orig.pic_images, '"}')
40+
local img_url = string.sub(bid_imp_orig.pic_images, s_from, s_to - 1)
3841
if bid_imp_orig.orig_type == 1 then
3942
bid_dict['adi'] = img_url
4043
bid_dict['adh'] = tonumber(bid_imp_orig.pic_h)

0 commit comments

Comments
 (0)