Files
tlmall-v5-single/doc/nginx/lua/product.lua
USER-20221017CE\Administrator d31fad2aa9 初始化提交
2022-11-01 12:14:54 +08:00

14 lines
641 B
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 导入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)