diff --git a/conf/nginx.conf b/conf/nginx.conf index 1e93213..bbb2128 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -56,9 +56,9 @@ http { access_by_lua_block { ngx.header["Access-Control-Allow-Origin"] = "*"; ngx.header["Access-Control-Allow-Methods"] = "GET, POST, DELETE, PUT"; - ngx.header["Access-Control-Allow-Headers"] = "DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"; + ngx.header["Access-Control-Allow-Headers"] = "*"; ngx.header["Access-Control-Max-Age"] = 1728000; - ngx.header["Access-Control-Expose-Headers"] = "Content-Length,Content-Range"; + ngx.header["Access-Control-Expose-Headers"] = "*"; if ngx.var.request_method == "OPTIONS" then ngx.status = 204 ngx.exit(ngx.OK) diff --git a/src/test/test.lua b/src/test/test.lua index 1a1c493..2665e70 100644 --- a/src/test/test.lua +++ b/src/test/test.lua @@ -20,6 +20,18 @@ local id = snow:generateUniqueId()-- 生成ID --max =a and b or c--a?b:c +local STATUS_CODE = { + -- 成功状态码 + SUCCESS = { code = 200, message = "操作成功" }, + UNKNOWN_ERROR = { code = 9999, message = "未知错误" } +} + +local val = STATUS_CODE.SUCCESS +local status = val or STATUS_CODE.UNKNOWN_ERROR +local msg = status.message +ngx.say("message:"..msg) + + --local openssl = require("openssl") -- ---- 生成RSA密钥对