sniper-xx commented on issue #4193:
URL: https://github.com/apache/apisix/issues/4193#issuecomment-834050995


   ```lua
   local function wrap_result(conf, ctx)
       local result = {
           msg="ok",
           code= resp_code,
           elapsed = ngx.time()-elapsed,
           data = "__placeholder__",
           success=true
       }
   
       --如果完成后台数据读取,重新进行Json结果封装
       result['data'] = cjson_decode(data_buffer)
       ngx.arg[1] = cjson_encode(result)
       --local wrap_string = cjson_encode(result)
       --local ret_content = 
ngx.re.sub(wrap_string,'"__placeholder__"',data_buffer,'jo')
       --ngx.arg[1] = ret_content
       ngx.arg[2] = true
   end
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to