|
|
@@ -29,8 +29,15 @@ M.init = function(website_config)
|
|
|
if M.__url_param ~= nil then
|
|
|
M.__action = M.__url_param["action"]
|
|
|
end
|
|
|
- -- 获取TOKEN
|
|
|
+ -- 获取TOKEN
|
|
|
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
|
|
|
local result,user_data = token_module.get(token)
|
|
|
-- print("TOKEN_DATA:",cjson.encode(user_data))
|