更新 target/fwutils/request_config.lua
This commit is contained in:
@@ -29,8 +29,15 @@ M.init = function(website_config)
|
|||||||
if M.__url_param ~= nil then
|
if M.__url_param ~= nil then
|
||||||
M.__action = M.__url_param["action"]
|
M.__action = M.__url_param["action"]
|
||||||
end
|
end
|
||||||
-- 获取TOKEN
|
-- 获取TOKEN
|
||||||
local token = string.match(request.header("Cookie"),"token=(%w+)")
|
local token = string.match(request.header("Cookie"),"token=(%w+)")
|
||||||
|
if token == nil or token == "" then
|
||||||
|
token = M.__url_param["token"]
|
||||||
|
if token ~= nil then
|
||||||
|
response.header("Set-Cookie","token="..token..";Path=/")
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
if token ~= nil and token ~= "" then
|
if token ~= nil and token ~= "" then
|
||||||
local result,user_data = token_module.get(token)
|
local result,user_data = token_module.get(token)
|
||||||
-- print("TOKEN_DATA:",cjson.encode(user_data))
|
-- print("TOKEN_DATA:",cjson.encode(user_data))
|
||||||
|
|||||||
Reference in New Issue
Block a user