save image to uuid name

This commit is contained in:
moicen
2022-06-26 17:49:50 +08:00
parent 46f27ba9d5
commit 6648a4f1ee
6 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -3,6 +3,7 @@
package.path = package.path .. ';<SCRIPT_PATH>/?.lua';
local cjson = require "cjson"
local uuid = require "resty.jit-uuid"
local upyun_upload = require("upyun_upload")
local get_wx_media = require("wx_download")
@@ -20,7 +21,7 @@ local function run()
local downloaded_file = get_wx_media(req_body["media_id"]);
upyun_upload.upload(downloaded_file)
upyun_upload.upload(downloaded_file, uuid.generate_v4() .. ".jpg")
end
run();