This commit is contained in:
吕金泽 2022-03-05 10:31:35 +08:00
parent 84b4df338b
commit 5b2e870ce6
6 changed files with 132 additions and 248 deletions

View File

@ -5,7 +5,7 @@
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "登录",
"createTime" : null,
"updateTime" : 1643710774934,
"updateTime" : 1646400972875,
"lock" : "0",
"method" : "POST",
"path" : "/login",
@ -17,7 +17,7 @@
"responseBody" : "{\n \"code\": 0,\n \"message\": \"用户名或密码错误\",\n \"data\": null,\n \"timestamp\": 1643710761990,\n \"executeTime\": 6\n}",
"description" : null,
"requestBodyDefinition" : {
"name" : "",
"name" : "root",
"value" : "",
"description" : "",
"required" : false,

View File

@ -5,7 +5,7 @@
"groupId" : "1952f25c81084e24b55b11385767dc38",
"name" : "获取当前用户权限code",
"createTime" : null,
"updateTime" : 1644121674755,
"updateTime" : 1645715502500,
"lock" : "0",
"method" : "POST",
"path" : "/permissions",
@ -14,7 +14,7 @@
"requestBody" : "{\n\n}",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [\"sys:test:aaa\", \"menu:save\", \"menu:delete\", \"office:office:list\", \"office:office:save\", \"office:office:delete\", \"role:view\", \"role:save\", \"role:delete\", \"user:save\", \"user:delete\", \"dict:view\", \"dict:save\", \"dict:delete\", \"dict:items\", \"dict:items:save\", \"dict:items:delete\"],\n \"timestamp\": 1641199273283,\n \"executeTime\": 1\n}",
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": [\"menu:view\", \"menu:save\", \"menu:delete\", \"office:save\", \"office:delete\", \"role:save\", \"role:delete\", \"role:permission\", \"user:save\", \"user:delete\", \"dict:save\", \"dict:delete\", \"dict:items:save\", \"dict:items:delete\", \"office:view\", \"role:view\", \"user:view\", \"dict:view\", \"dict:items:view\"],\n \"timestamp\": 1645715342825,\n \"executeTime\": 2\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -65,7 +65,7 @@
"expression" : "",
"children" : [ {
"name" : "",
"value" : "sys:test:aaa",
"value" : "menu:view",
"description" : "",
"required" : false,
"dataType" : "String",
@ -78,7 +78,7 @@
} ]
}, {
"name" : "timestamp",
"value" : "1641199273283",
"value" : "1645715342825",
"description" : "",
"required" : false,
"dataType" : "Long",
@ -90,7 +90,7 @@
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "1",
"value" : "2",
"description" : "",
"required" : false,
"dataType" : "Object",
@ -115,11 +115,12 @@ return db.cache(`permissions:${userId}`).select("""
sm.permission
FROM
sys_menu sm
right JOIN sys_role_menu srm ON sm.id = srm.menu_id
right JOIN sys_user_role sur ON sur.role_id = srm.role_id
right JOIN sys_user su ON su.id = sur.user_id
?{userId != '1', AND su.id = #{userId}}
AND su.is_del = 0
?{userId != '1',
right JOIN sys_role_menu srm ON sm.id = srm.menu_id
right JOIN sys_user_role sur ON sur.role_id = srm.role_id
right JOIN sys_user su ON su.id = sur.user_id
AND su.id = #{userId} AND su.is_del = 0
}
WHERE
sm.is_del = 0
AND sm.permission != ''

View File

@ -5,7 +5,7 @@
"groupId" : "8295fc13678d4144bf7363c465247a50",
"name" : "列表",
"createTime" : null,
"updateTime" : 1644121676212,
"updateTime" : 1645694064991,
"lock" : "0",
"method" : "GET",
"path" : "/tree",
@ -14,7 +14,7 @@
"requestBody" : "{\n\n}",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"list\": [{\n \"id\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"name\": \"<font color=\\\"yellow\\\">马小东公司</font>\",\n \"pid\": \"0\",\n \"type\": \"2\",\n \"sort\": 10,\n \"code\": \"mxd\",\n \"children\": [{\n \"id\": \"81b5493cdb31477f9ceea85b2cd08f15\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"mxdz\",\n \"children\": []\n }, {\n \"id\": \"31b365008f994e93850186126fce87cb\",\n \"name\": \"<font color=\\\"yellow\\\">马小东子公司2</font>\",\n \"pid\": \"4c37a80226134bce8bc91c8fc04a7d2f\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"mxdzz\",\n \"children\": []\n }]\n }, {\n \"id\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽公司</font>\",\n \"pid\": \"0\",\n \"type\": null,\n \"sort\": 20,\n \"code\": \"ljz\",\n \"children\": [{\n \"id\": \"1ae0299fc79b43c6b0ae2e14756ec41a\",\n \"name\": \"<font color=\\\"yellow\\\">吕金泽子公司</font>\",\n \"pid\": \"935126327e2a4f90b3f485f818f61ea5\",\n \"type\": null,\n \"sort\": 10,\n \"code\": \"ljzz\",\n \"children\": []\n }]\n }],\n \"total\": 2\n },\n \"timestamp\": 1642134812650,\n \"executeTime\": 9\n}",
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1645694060610,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -30,7 +30,7 @@
"expression" : "",
"children" : [ {
"name" : "code",
"value" : "200",
"value" : "402",
"description" : "",
"required" : false,
"dataType" : "Integer",
@ -42,7 +42,7 @@
"children" : [ ]
}, {
"name" : "message",
"value" : "success",
"value" : "凭证已过期",
"description" : "",
"required" : false,
"dataType" : "String",
@ -54,7 +54,7 @@
"children" : [ ]
}, {
"name" : "data",
"value" : "",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
@ -63,226 +63,10 @@
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "list",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "id",
"value" : "4c37a80226134bce8bc91c8fc04a7d2f",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "name",
"value" : "<font color=\\\"yellow\\\">马小东公司</font>",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "pid",
"value" : "0",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "type",
"value" : "2",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "sort",
"value" : "10",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "code",
"value" : "mxd",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "children",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ {
"name" : "id",
"value" : "81b5493cdb31477f9ceea85b2cd08f15",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "name",
"value" : "<font color=\\\"yellow\\\">马小东子公司</font>",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "pid",
"value" : "4c37a80226134bce8bc91c8fc04a7d2f",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "type",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "sort",
"value" : "10",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "code",
"value" : "mxdz",
"description" : "",
"required" : false,
"dataType" : "String",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
}, {
"name" : "children",
"value" : "",
"description" : "",
"required" : false,
"dataType" : "Array",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
} ]
} ]
} ]
}, {
"name" : "total",
"value" : "2",
"description" : "",
"required" : false,
"dataType" : "Integer",
"type" : null,
"defaultValue" : null,
"validateType" : "",
"error" : "",
"expression" : "",
"children" : [ ]
} ]
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1642134812650",
"value" : "1645694060610",
"description" : "",
"required" : false,
"dataType" : "Long",
@ -294,10 +78,10 @@
"children" : [ ]
}, {
"name" : "executeTime",
"value" : "9",
"value" : "null",
"description" : "",
"required" : false,
"dataType" : "Integer",
"dataType" : "Object",
"type" : null,
"defaultValue" : null,
"validateType" : "",

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
"groupId" : "67b2ce258e24491194b74992958c74aa",
"name" : "获取菜单tree",
"createTime" : null,
"updateTime" : 1644121674088,
"updateTime" : 1646402874965,
"lock" : "0",
"method" : "GET",
"path" : "/tree",
@ -96,7 +96,7 @@
}
================================
var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid
var list = toTree(db.select('select id,name,pid,is_show,url,sort,permission,desc_ribe,icon,keep_alive from sys_menu where is_del = 0 order by sort'),'0')
var list = toTree(db.select('select id,name,pid,is_show,url,sort,permission,desc_ribe,icon,keep_alive,component_id from sys_menu where is_del = 0 order by sort'),'0')
return {
list: list,

View File

@ -5,7 +5,7 @@
"groupId" : "5c36bdc1de454d6e9d1a464d87c96091",
"name" : "获取所有配置",
"createTime" : null,
"updateTime" : 1635576982955,
"updateTime" : 1646391487051,
"lock" : "0",
"method" : "GET",
"path" : "/list",
@ -14,7 +14,7 @@
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1635043795053,\n \"executeTime\": null\n}",
"responseBody" : "{\n \"code\": 402,\n \"message\": \"凭证已过期\",\n \"data\": null,\n \"timestamp\": 1646391479074,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : {
@ -66,7 +66,7 @@
"children" : [ ]
}, {
"name" : "timestamp",
"value" : "1635043795053",
"value" : "1646391479074",
"description" : "",
"required" : false,
"dataType" : "Long",