Commit f93c18ad by 庄欣

完成

parent bc76441e
......@@ -75,6 +75,7 @@ http {
for i, value in pairs(data) do
table.insert(tempTable, i .. "=" .. value)
end
table.sort(tempTable)
local waitToEncoded = "GETcaptcha.tencentcloudapi.com/?" .. table.concat(tempTable, "&");
local encodeStr = ngx.encode_base64(ngx.hmac_sha1(apiSecretKey, waitToEncoded));
data["Signature"] = encodeStr;
......
local data = {
["Action"] = "DescribeCaptchaResult",
["AppSecretKey"] = "secretKey",
["CaptchaAppId"] = "appId",
["CaptchaType"] = 9,
["Nonce"] = tostring(math.random(1000, 9000)),
["Randstr"] = "randomStr",
["SecretId"] = "apiSecretId",
["Ticket"] = "ticket",
["Timestamp"] = "12121212",
["UserIp"] = "12121212",
["Version"] = "2019-07-22",
}
local str = "";
local tempTable = {};
for i, value in pairs(data) do
table.insert(tempTable, i .. "=" .. value)
end
table.sort(tempTable)
print(table.concat(tempTable, "&"));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment