暂时先注释掉权限管理验证,修改组织结构不使用分页进行数据返回

This commit is contained in:
wanglei 2025-11-12 09:58:02 +08:00
parent bdf2d82a37
commit 697762157e
4 changed files with 10 additions and 12 deletions

View File

@ -31,8 +31,8 @@ local function isExistDepartment(id)
end
-- 查询数据表中的所有组织架构信息
function _M.getSystemDepartments(pageNum, pageSize)
return departmentModel:paginate(pageNum, pageSize)
function _M.getSystemDepartments()
return departmentModel:all()
end
--根据组织架构id获取组织架构信息

View File

@ -20,10 +20,7 @@ function _M.getSystemDepartments()
if perm:hasPermission(role, perms) == false then
ngx.exit(ngx.HTTP_FORBIDDEN)
end
--获取页码和请求的数据量
local pageNum = ngx.var.pagenum or 1
local pageSize = ngx.var.pagesize or 10
local code,ret = departmentDao.getSystemDepartments(pageNum, pageSize)
local code,ret = departmentDao.getSystemDepartments()
local result = resp:json(code, ret)
resp:send(result)
end

View File

@ -18,6 +18,7 @@ end
-- 检查角色是否拥有指定权限
function _M:hasPermission(role_name, permission)
do return true end
if role_name == nil or permission == nil then
return false
end

View File

@ -1,15 +1,14 @@
local cjson = require('cjson')
local conf = require('config')
local error_code = require('util.status')
local ngx = ngx
local _M = {}
function _M:json(status, message, data, http_status)
-- you can modify this response struct as you favor
if status == 0 then status = ngx.ok end
if status == 0 then status = ngx.HTTP_OK end
local msg = message
local response_status = http_status or ngx.OK
local response_status = http_status or ngx.HTTP_OK
if msg == nil or msg == '' then
--local locale = ngx.ctx.locale or conf.locale
--if error_code[locale] ~= nil then
@ -17,7 +16,7 @@ function _M:json(status, message, data, http_status)
--end
msg = error_code[status]
end
local response = {code=status, msg=msg, result=data,timestamp=ngx.time()}
local response = {code = status, msg = msg, result = data,timestamp = ngx.time()}
if not response.code then
response.code = -1
response.message = 'not find status code'
@ -31,11 +30,12 @@ end
function _M:json(status, data, http_status)
-- you can modify this response struct as you favor
if status == 0 then status = ngx.HTTP_OK end
local msg = ''
local response_status = http_status or ngx.OK
local response_status = http_status or ngx.HTTP_OK
msg = error_code[status]
local response = {code=status, msg=msg, result=data,timestamp=ngx.time()}
local response = {code = status, msg = msg, result = data,timestamp = ngx.time()}
if not response.code then
response.code = -1
response.message = 'not find status code'