generate upyun token for access

This commit is contained in:
moicen
2022-07-16 03:07:37 +08:00
parent c2869d1a3b
commit a730521d5b
5 changed files with 32 additions and 0 deletions
+8
View File
@@ -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)