Files
tlmall-v5-single/doc/nginx/lua/product.lua

14 lines
641 B
Lua
Raw Permalink Normal View History

2022-11-01 12:14:54 +08:00
-- 导入lua-resty-template函数库
local template = require('resty.template')
local flashPromotionId = ngx.var.arg_flashPromotionId
ngx.log(ngx.ERR, "秒杀活动ID: ", flashPromotionId)
local promotionProductId = ngx.var.arg_promotionProductId
ngx.log(ngx.ERR, "秒杀产品ID: ", promotionProductId)
local templateName = "seckill_"..flashPromotionId.."_"..promotionProductId..".html"
local context = {
memberId = ngx.var.arg_memberId,
productId = promotionProductId,
flashPromotionId = flashPromotionId
}
ngx.log(ngx.ERR, "渲染页面输出获得当前用户ID: ", context.memberId)
template.render(templateName, context)