|
|
@ -179,18 +179,13 @@ end |
|
|
|
|
|
|
|
|
|
|
|
function _M.return_message(self, status, msg) |
|
|
|
function _M.return_message(self, status, msg) |
|
|
|
ngx.header.content_type = "application/json" |
|
|
|
ngx.header.content_type = "application/json" |
|
|
|
|
|
|
|
|
|
|
|
self:D("return_message:"..tostring(status)..tostring(msg)) |
|
|
|
|
|
|
|
local data = self:return_state(status, msg) |
|
|
|
local data = self:return_state(status, msg) |
|
|
|
|
|
|
|
|
|
|
|
self:D("return_message[data]:"..tostring(data)) |
|
|
|
|
|
|
|
ngx.say(json.encode(data)) |
|
|
|
ngx.say(json.encode(data)) |
|
|
|
ngx.exit(200) |
|
|
|
ngx.exit(200) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function _M.return_html(self,status, html) |
|
|
|
function _M.return_html(self, status, html) |
|
|
|
ngx.header.content_type = "text/html" |
|
|
|
ngx.header.content_type = "text/html" |
|
|
|
ngx.status = status |
|
|
|
|
|
|
|
ngx.say(html) |
|
|
|
ngx.say(html) |
|
|
|
ngx.exit(status) |
|
|
|
ngx.exit(status) |
|
|
|
end |
|
|
|
end |
|
|
|