add log
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ function _M.upt(uri)
|
|||||||
local duration = ngx.var.upt_duration
|
local duration = ngx.var.upt_duration
|
||||||
local etime = os.time() + duration
|
local etime = os.time() + duration
|
||||||
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
||||||
ngx.log(ngx.ERR, 'sign...' .. sign .. ' etime..' .. etime)
|
ngx.log(ngx.INFO, 'sign...' .. sign .. ' etime..' .. etime)
|
||||||
local upt = string.sub(sign, 13, 13 + 7) .. etime
|
local upt = string.sub(sign, 13, 13 + 7) .. etime
|
||||||
return (upt)
|
return (upt)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
|
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
|
||||||
local Upt = require("lib.upt")
|
local Upt = require("lib.upt")
|
||||||
local uri = ngx.unescape_uri(ngx.var.arg_uri)
|
local uri = ngx.unescape_uri(ngx.var.arg_uri)
|
||||||
|
ngx.log(ngx.INFO, 'URI -> ' .. uri)
|
||||||
ngx.say(Upt.upt(uri))
|
ngx.say(Upt.upt(uri))
|
||||||
Reference in New Issue
Block a user