fix conditional bug
This commit is contained in:
+9
-5
@@ -15,11 +15,15 @@ end
|
|||||||
function _M.upt(uri)
|
function _M.upt(uri)
|
||||||
local hostname = host(uri)
|
local hostname = host(uri)
|
||||||
|
|
||||||
local upt_table = {}
|
local secret;
|
||||||
upt_table["moicen.com"] = ngx.var.upt_moicen_secret,
|
if (hostname == 'moicen.com') then
|
||||||
upt_table["alchemy-studio.cn"] = ngx.var.upt_alchemy_secret,
|
secret = ngx.var.upt_moicen_secret
|
||||||
upt_table["huiwings.cn"] = ngx.var.upt_huiwings_secret
|
else if hostname == "alchemy-studio.cn" then
|
||||||
local secret = upt_table[hostname]
|
secret = ngx.var.upt_alchemy_secret
|
||||||
|
else if hostname == "huiwings.cn" then
|
||||||
|
secret = ngx.var.upt_huiwings_secret
|
||||||
|
end
|
||||||
|
|
||||||
ngx.log(ngx.INFO, 'url...' .. uri .. ' host...' .. hostname .. 'secret...' .. secret)
|
ngx.log(ngx.INFO, 'url...' .. uri .. ' host...' .. hostname .. 'secret...' .. secret)
|
||||||
local duration = ngx.var.upt_duration
|
local duration = ngx.var.upt_duration
|
||||||
local etime = os.time() + duration
|
local etime = os.time() + duration
|
||||||
|
|||||||
Reference in New Issue
Block a user