Older/Server/lua/profile.lua

21 lines
553 B
Lua
Raw Normal View History

2023-11-05 19:01:15 +08:00
local cjson = require "cjson"
local session = require"resty.session".open()
local response = {}
if (session == nil or session.data.identify == nil) then
response.code = 1
response.message = "未登录,session is nil."
ngx.say(cjson.encode(response));
return
else
if (session.data.identify ~= "myself") then
response.code = 1
response.message = "未登录,identify:" .. session.data.identify
else
response.code = 0
response.user = user_infomation
end
ngx.say(cjson.encode(response));
end