提交 d9d9b375 authored 作者: zhanrongzhen's avatar zhanrongzhen

修复锐速云验证码图片显示的bug

上级 dbe912c3
......@@ -64,10 +64,10 @@ http {
local current_uri = ngx.var.uri
-- 判断是不是蒙城网站的验证码
local filepath
if filename ~= "1710935454" then -- 如果不是蒙城验证码图片
filepath = ngx.var.root_path .. "/resources/default/" .. filename
else
if filename == "1710935454" or filename == "3568918852.aspx" then
filepath = ngx.var.root_path .. current_uri
else
filepath = ngx.var.root_path .. "/resources/default/" .. filename
end
local max_retries = 30 -- 重试次数(含首次检查)
......@@ -173,8 +173,12 @@ http {
ngx.header["Cache-Control"] = "max-age=86400"
ngx.say(content)
os.remove(filepath)
local ok, err = os.remove(filepath)
if ok then
ngx.log(ngx.INFO, "File deleted after serving: ", filepath)
else
ngx.log(ngx.WARN, "Failed to delete file: ", filepath, ", error: ", err)
end
return ngx.exit(ngx.HTTP_OK)
else
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论