generate upyun token for access
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
local uri = ngx.var.arg_uri
|
||||
local secret = ngx.var.upt_secret
|
||||
local duration = ngx.var.upt_duration
|
||||
local etime = os.time() + duration
|
||||
local sign = ngx.md5(secret .. '&' .. etime .. '&' .. uri)
|
||||
ngx.log(ngx.ERR, 'sign...' .. sign .. ' etime..' .. etime)
|
||||
local upt = string.sub(sign, 13, 13 + 7) .. etime
|
||||
ngx.say(upt)
|
||||
Reference in New Issue
Block a user