From d743d7c95bc1af9715b7e6f2a3fa2bea40956c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E9=87=91=E6=B3=BD?= <1098696801@qq.com> Date: Sat, 5 Mar 2022 22:30:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7magic-api=202.0=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E3=80=81=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/magic-api/api/后台/group.json | 2 +- data/magic-api/api/后台/安全/group.json | 2 +- data/magic-api/api/后台/安全/登录.ms | 37 ++- .../api/后台/安全/获取当前用户权限code.ms | 23 +- data/magic-api/api/后台/安全/退出登录.ms | 23 +- data/magic-api/api/后台/安全/验证token.ms | 23 +- data/magic-api/api/后台/富文本/group.json | 2 +- data/magic-api/api/后台/富文本/上传图片.ms | 11 +- data/magic-api/api/后台/富文本/上传文件.ms | 11 +- data/magic-api/api/后台/富文本/入口get.ms | 11 +- data/magic-api/api/后台/富文本/入口post.ms | 13 +- data/magic-api/api/后台/富文本/配置.ms | 24 +- data/magic-api/api/后台/数据字典/group.json | 2 +- data/magic-api/api/后台/数据字典/保存.ms | 38 ++- data/magic-api/api/后台/数据字典/列表.ms | 23 +- data/magic-api/api/后台/数据字典/删除.ms | 25 +- .../api/后台/数据字典/字典项/group.json | 2 +- .../api/后台/数据字典/字典项/保存.ms | 38 ++- .../api/后台/数据字典/字典项/列表.ms | 23 +- .../api/后台/数据字典/字典项/删除.ms | 25 +- .../后台/数据字典/字典项/获取所有字典项.ms | 11 +- .../api/后台/数据字典/字典项/获取排序号.ms | 11 +- .../magic-api/api/后台/数据字典/获取排序号.ms | 11 +- data/magic-api/api/后台/文件管理/group.json | 2 +- data/magic-api/api/后台/文件管理/上传.ms | 11 +- data/magic-api/api/后台/文件管理/删除.ms | 11 +- data/magic-api/api/后台/文件管理/排序.ms | 11 +- .../api/后台/文件管理/获取文件列表.ms | 11 +- data/magic-api/api/后台/文件管理/裁剪.ms | 11 +- data/magic-api/api/后台/日志管理/group.json | 10 + data/magic-api/api/后台/日志管理/操作日志.ms | 258 ++++++++++++++++++ data/magic-api/api/后台/日志管理/登录日志.ms | 258 ++++++++++++++++++ data/magic-api/api/后台/测试数据/group.json | 2 +- data/magic-api/api/后台/测试数据/保存.ms | 25 +- data/magic-api/api/后台/测试数据/列表.ms | 11 +- data/magic-api/api/后台/用户管理/group.json | 2 +- .../api/后台/用户管理/个人信息修改.ms | 11 +- data/magic-api/api/后台/用户管理/保存.ms | 25 +- .../api/后台/用户管理/修改登录状态.ms | 11 +- data/magic-api/api/后台/用户管理/列表.ms | 23 +- data/magic-api/api/后台/用户管理/删除.ms | 25 +- data/magic-api/api/后台/用户管理/所有机构.ms | 11 +- .../后台/用户管理/根据用户id获取角色列表.ms | 11 +- .../api/后台/用户管理/获取用户信息.ms | 11 +- data/magic-api/api/后台/组件/group.json | 2 +- data/magic-api/api/后台/组件/保存.ms | 25 +- data/magic-api/api/后台/组件/列表.ms | 11 +- data/magic-api/api/后台/组件/删除.ms | 11 +- data/magic-api/api/后台/组件/详情.ms | 11 +- data/magic-api/api/后台/组件/选择组件.ms | 11 +- data/magic-api/api/后台/组织机构/group.json | 2 +- data/magic-api/api/后台/组织机构/上移.ms | 11 +- data/magic-api/api/后台/组织机构/下移.ms | 11 +- data/magic-api/api/后台/组织机构/保存.ms | 38 ++- data/magic-api/api/后台/组织机构/列表.ms | 23 +- data/magic-api/api/后台/组织机构/删除.ms | 23 +- .../api/后台/组织机构/根据角色获取组织机构.ms | 11 +- .../magic-api/api/后台/组织机构/获取排序号.ms | 11 +- data/magic-api/api/后台/菜单管理/group.json | 2 +- data/magic-api/api/后台/菜单管理/上移.ms | 11 +- data/magic-api/api/后台/菜单管理/下移.ms | 11 +- data/magic-api/api/后台/菜单管理/保存.ms | 38 ++- .../api/后台/菜单管理/修改是否显示.ms | 25 +- data/magic-api/api/后台/菜单管理/删除.ms | 23 +- .../api/后台/菜单管理/当前用户菜单.ms | 11 +- .../api/后台/菜单管理/根据菜单id清除缓存.ms | 11 +- .../api/后台/菜单管理/根据角色获取菜单.ms | 11 +- .../magic-api/api/后台/菜单管理/获取排序号.ms | 11 +- .../api/后台/菜单管理/获取菜单tree.ms | 23 +- data/magic-api/api/后台/角色管理/group.json | 2 +- data/magic-api/api/后台/角色管理/保存.ms | 25 +- data/magic-api/api/后台/角色管理/列表.ms | 23 +- data/magic-api/api/后台/角色管理/删除.ms | 25 +- .../api/后台/角色管理/根据角色id删除缓存.ms | 11 +- data/magic-api/api/后台/配置/group.json | 2 +- data/magic-api/api/后台/配置/获取所有配置.ms | 11 +- data/magic-api/function/权限/group.json | 2 +- data/magic-api/function/权限/组织机构.ms | 6 +- magic-boot-ui/src/assets/css/common.css | 18 ++ .../src/components/magic/mb-search.vue | 10 +- magic-boot-ui/src/icons/component.svg | 1 + magic-boot-ui/src/icons/interface.svg | 1 + magic-boot-ui/src/icons/log.svg | 1 + magic-boot-ui/src/icons/login-log.svg | 1 + magic-boot-ui/src/icons/oper-log.svg | 1 + magic-boot-ui/src/layout/tabs.vue | 2 +- magic-boot-ui/src/main.js | 3 +- magic-boot-ui/src/scripts/request.js | 46 ++-- .../src/views/system/log/login-log.vue | 46 ++++ .../src/views/system/log/oper-log.vue | 58 ++++ .../src/views/system/menu/menu-form.vue | 4 +- .../src/views/system/user/user-form.vue | 2 +- magic-boot/pom.xml | 2 +- .../NamedTableFunctionExtension.java | 2 +- .../extension/ResponseFunctionExtension.java | 7 +- .../NamedTableHandlerInterceptor.java | 9 +- .../interceptor/PermissionInterceptor.java | 44 ++- .../ssssssss/magicboot/model/StatusCode.java | 2 +- magic-boot/src/main/resources/application.yml | 16 +- 99 files changed, 1483 insertions(+), 420 deletions(-) create mode 100644 data/magic-api/api/后台/日志管理/group.json create mode 100644 data/magic-api/api/后台/日志管理/操作日志.ms create mode 100644 data/magic-api/api/后台/日志管理/登录日志.ms create mode 100644 magic-boot-ui/src/icons/component.svg create mode 100644 magic-boot-ui/src/icons/interface.svg create mode 100644 magic-boot-ui/src/icons/log.svg create mode 100644 magic-boot-ui/src/icons/login-log.svg create mode 100644 magic-boot-ui/src/icons/oper-log.svg create mode 100644 magic-boot-ui/src/views/system/log/login-log.vue create mode 100644 magic-boot-ui/src/views/system/log/oper-log.vue diff --git a/data/magic-api/api/后台/group.json b/data/magic-api/api/后台/group.json index 00092ef..939057e 100644 --- a/data/magic-api/api/后台/group.json +++ b/data/magic-api/api/后台/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "02df51e4d7184780a98b632f43dc5848", "name" : "后台", - "type" : "1", + "type" : "api", "parentId" : "0", "path" : "", "paths" : [ ], diff --git a/data/magic-api/api/后台/安全/group.json b/data/magic-api/api/后台/安全/group.json index b4ed4bd..57758fb 100644 --- a/data/magic-api/api/后台/安全/group.json +++ b/data/magic-api/api/后台/安全/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "1952f25c81084e24b55b11385767dc38", "name" : "安全", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/security", "paths" : [ ], diff --git a/data/magic-api/api/后台/安全/登录.ms b/data/magic-api/api/后台/安全/登录.ms index 7f855ba..afd6765 100644 --- a/data/magic-api/api/后台/安全/登录.ms +++ b/data/magic-api/api/后台/安全/登录.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "登录", - "createTime" : null, - "updateTime" : 1646400972875, + "createTime" : 1646490239399, + "updateTime" : 1646482165171, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/login", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"require_login\",\"value\":\"false\",\"description\":\"该接口需要登录才允许访问\"}]", + "options" : [ { + "name" : "require_login", + "value" : "false", + "description" : "该接口需要登录才允许访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\r\n \"username\": \"admin\",\r\n \"password\": \"123456\"\r\n}", "headers" : [ ], "paths" : [ ], @@ -125,16 +139,14 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "require_login" : "false" } } ================================ import log import 'cn.dev33.satoken.secure.SaSecureUtil'; import 'cn.dev33.satoken.stp.StpUtil'; -import env; +import env; +import request; var user if(env.get('super-password') == body.password){ @@ -143,9 +155,18 @@ if(env.get('super-password') == body.password){ user = db.table("sys_user").where().eq("username",body.username).eq("password",SaSecureUtil.sha256(body.password)).selectOne() } +var loginLog = { + username: body.username, + type: '成功', + ip: request.getClientIP() +} + if(!user){ + loginLog.failPassword = body.password + db.table("sys_login_log").primary("id").save(loginLog); exit 0,'用户名或密码错误' } +db.table("sys_login_log").primary("id").save(loginLog); StpUtil.login(user.id) return StpUtil.getTokenValueByLoginId(user.id) \ No newline at end of file diff --git a/data/magic-api/api/后台/安全/获取当前用户权限code.ms b/data/magic-api/api/后台/安全/获取当前用户权限code.ms index 05e7739..d32dcce 100644 --- a/data/magic-api/api/后台/安全/获取当前用户权限code.ms +++ b/data/magic-api/api/后台/安全/获取当前用户权限code.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "获取当前用户权限code", - "createTime" : null, + "createTime" : 1646490239409, "updateTime" : 1645715502500, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/permissions", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"\",\"value\":\"\",\"description\":\"\"}]", + "options" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -101,9 +115,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "" : "" } } ================================ diff --git a/data/magic-api/api/后台/安全/退出登录.ms b/data/magic-api/api/后台/安全/退出登录.ms index 61b5df5..d97a027 100644 --- a/data/magic-api/api/后台/安全/退出登录.ms +++ b/data/magic-api/api/后台/安全/退出登录.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "退出登录", - "createTime" : 1634724871162, + "createTime" : 1646490239413, "updateTime" : 1634724871162, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/logout", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"require_login\",\"value\":\"false\",\"description\":\"该接口需要登录才允许访问\"}]", + "options" : [ { + "name" : "require_login", + "value" : "false", + "description" : "该接口需要登录才允许访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "require_login" : "false" } } ================================ diff --git a/data/magic-api/api/后台/安全/验证token.ms b/data/magic-api/api/后台/安全/验证token.ms index 8f28ece..0f999b8 100644 --- a/data/magic-api/api/后台/安全/验证token.ms +++ b/data/magic-api/api/后台/安全/验证token.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "1952f25c81084e24b55b11385767dc38", "name" : "验证token", - "createTime" : 1634724871160, + "createTime" : 1646490239415, "updateTime" : 1634724871160, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/validateToken", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"require_login\",\"value\":\"false\",\"description\":\"该接口需要登录才允许访问\"}]", + "options" : [ { + "name" : "require_login", + "value" : "false", + "description" : "该接口需要登录才允许访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "require_login" : "false" } } ================================ diff --git a/data/magic-api/api/后台/富文本/group.json b/data/magic-api/api/后台/富文本/group.json index 0160cd6..82c76fb 100644 --- a/data/magic-api/api/后台/富文本/group.json +++ b/data/magic-api/api/后台/富文本/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "富文本", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/ueditor", "paths" : [ ], diff --git a/data/magic-api/api/后台/富文本/上传图片.ms b/data/magic-api/api/后台/富文本/上传图片.ms index c26a094..0a82a67 100644 --- a/data/magic-api/api/后台/富文本/上传图片.ms +++ b/data/magic-api/api/后台/富文本/上传图片.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "上传图片", - "createTime" : null, + "createTime" : 1646490239417, "updateTime" : 1635926424491, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/uploadImage", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ import 'org.ssssssss.magicboot.utils.FileUtils' diff --git a/data/magic-api/api/后台/富文本/上传文件.ms b/data/magic-api/api/后台/富文本/上传文件.ms index 22b744d..fd670e2 100644 --- a/data/magic-api/api/后台/富文本/上传文件.ms +++ b/data/magic-api/api/后台/富文本/上传文件.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "上传文件", - "createTime" : 1635926414330, + "createTime" : 1646490239420, "updateTime" : 1635926414330, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/uploadFile", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{\r\n\t\r\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import 'org.ssssssss.magicboot.utils.FileUtils' diff --git a/data/magic-api/api/后台/富文本/入口get.ms b/data/magic-api/api/后台/富文本/入口get.ms index 3558a2e..e9cb556 100644 --- a/data/magic-api/api/后台/富文本/入口get.ms +++ b/data/magic-api/api/后台/富文本/入口get.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "入口get", - "createTime" : null, + "createTime" : 1646490239422, "updateTime" : 1635927863001, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/main", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], @@ -101,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "require_login" : "false" } } ================================ diff --git a/data/magic-api/api/后台/富文本/入口post.ms b/data/magic-api/api/后台/富文本/入口post.ms index e90c914..a840a7f 100644 --- a/data/magic-api/api/后台/富文本/入口post.ms +++ b/data/magic-api/api/后台/富文本/入口post.ms @@ -5,22 +5,21 @@ "groupId" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "入口post", "createTime" : null, - "updateTime" : 1635927291775, + "updateTime" : 1646490257556, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/main", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "require_login" : "false" - } + "responseBodyDefinition" : null } ================================ import response; diff --git a/data/magic-api/api/后台/富文本/配置.ms b/data/magic-api/api/后台/富文本/配置.ms index b2fad9e..57d8045 100644 --- a/data/magic-api/api/后台/富文本/配置.ms +++ b/data/magic-api/api/后台/富文本/配置.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "7eeba36706c24c1484ee4e84ad829f9b", "name" : "配置", - "createTime" : null, + "createTime" : 1646490239427, "updateTime" : 1635927563365, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/config", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"\",\"value\":\"\",\"description\":\"\"}]", + "options" : [ { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], @@ -485,10 +499,6 @@ "children" : [ ] } ] } ] - }, - "optionMap" : { - "" : "", - "require_login" : "false" } } ================================ diff --git a/data/magic-api/api/后台/数据字典/group.json b/data/magic-api/api/后台/数据字典/group.json index 6d1f016..db56423 100644 --- a/data/magic-api/api/后台/数据字典/group.json +++ b/data/magic-api/api/后台/数据字典/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "name" : "数据字典", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/dict", "paths" : [ ], diff --git a/data/magic-api/api/后台/数据字典/保存.ms b/data/magic-api/api/后台/数据字典/保存.ms index 0fdb815..bb14273 100644 --- a/data/magic-api/api/后台/数据字典/保存.ms +++ b/data/magic-api/api/后台/数据字典/保存.ms @@ -4,24 +4,46 @@ "script" : null, "groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239430, "updateTime" : 1644121671060, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"dict:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + }, { + "name" : "permission", + "value" : "dict:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data", - "permission" : "dict:save" - } + "responseBodyDefinition" : null } ================================ var typeCount = db.selectInt("select count(1) from sys_dict where is_del = 0 and type = #{data.type} ?{id, and id != #{data.id}}") diff --git a/data/magic-api/api/后台/数据字典/列表.ms b/data/magic-api/api/后台/数据字典/列表.ms index ae51619..9f66983 100644 --- a/data/magic-api/api/后台/数据字典/列表.ms +++ b/data/magic-api/api/后台/数据字典/列表.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239432, "updateTime" : 1644121689680, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"dict:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "dict:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "dict:view" } } ================================ diff --git a/data/magic-api/api/后台/数据字典/删除.ms b/data/magic-api/api/后台/数据字典/删除.ms index 2f310e7..a8f2b82 100644 --- a/data/magic-api/api/后台/数据字典/删除.ms +++ b/data/magic-api/api/后台/数据字典/删除.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239434, "updateTime" : 1644121690359, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"dict:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "dict:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "dict:delete" - } + "responseBodyDefinition" : null } ================================ db.table("sys_dict_items").logic().where().eq("dictId",id).delete() diff --git a/data/magic-api/api/后台/数据字典/字典项/group.json b/data/magic-api/api/后台/数据字典/字典项/group.json index 1c3fdbc..ed50741 100644 --- a/data/magic-api/api/后台/数据字典/字典项/group.json +++ b/data/magic-api/api/后台/数据字典/字典项/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "376f26eb43a44a3daeafd27020a96f48", "name" : "字典项", - "type" : "1", + "type" : "api", "parentId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "path" : "/items", "paths" : [ ], diff --git a/data/magic-api/api/后台/数据字典/字典项/保存.ms b/data/magic-api/api/后台/数据字典/字典项/保存.ms index e503248..f088b67 100644 --- a/data/magic-api/api/后台/数据字典/字典项/保存.ms +++ b/data/magic-api/api/后台/数据字典/字典项/保存.ms @@ -4,24 +4,46 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239437, "updateTime" : 1644121691372, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"dict:items:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + }, { + "name" : "permission", + "value" : "dict:items:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data", - "permission" : "dict:items:save" - } + "responseBodyDefinition" : null } ================================ var valueCount = db.selectInt("select count(1) from sys_dict_items where is_del = 0 and dict_id = #{data.dictId} and value = #{data.value} ?{id, and id != #{data.id}}") diff --git a/data/magic-api/api/后台/数据字典/字典项/列表.ms b/data/magic-api/api/后台/数据字典/字典项/列表.ms index 6214561..b6d3f28 100644 --- a/data/magic-api/api/后台/数据字典/字典项/列表.ms +++ b/data/magic-api/api/后台/数据字典/字典项/列表.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239439, "updateTime" : 1644121692556, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"dict:items:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "dict:items:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -197,9 +211,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "dict:items:view" } } ================================ diff --git a/data/magic-api/api/后台/数据字典/字典项/删除.ms b/data/magic-api/api/后台/数据字典/字典项/删除.ms index 87fbfb6..63c10b6 100644 --- a/data/magic-api/api/后台/数据字典/字典项/删除.ms +++ b/data/magic-api/api/后台/数据字典/字典项/删除.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239443, "updateTime" : 1644121693440, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"dict:items:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "dict:items:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "dict:items:delete" - } + "responseBodyDefinition" : null } ================================ return db.table("sys_dict_items").logic().where().eq("id",id).delete(); \ No newline at end of file diff --git a/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms b/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms index 24c0f9d..9cfbdb9 100644 --- a/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms +++ b/data/magic-api/api/后台/数据字典/字典项/获取所有字典项.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "获取所有字典项", - "createTime" : null, + "createTime" : 1646490239446, "updateTime" : 1634735167647, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/all", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{\r\n\t\r\n}", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select(""" diff --git a/data/magic-api/api/后台/数据字典/字典项/获取排序号.ms b/data/magic-api/api/后台/数据字典/字典项/获取排序号.ms index d4b8cd3..299ade8 100644 --- a/data/magic-api/api/后台/数据字典/字典项/获取排序号.ms +++ b/data/magic-api/api/后台/数据字典/字典项/获取排序号.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "376f26eb43a44a3daeafd27020a96f48", "name" : "获取排序号", - "createTime" : 1634735599490, + "createTime" : 1646490239449, "updateTime" : 1634735599490, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.selectInt("""select max(sort) + 10 from sys_dict_items where dict_id = #{dictId} and is_del = '0'""") || 10; \ No newline at end of file diff --git a/data/magic-api/api/后台/数据字典/获取排序号.ms b/data/magic-api/api/后台/数据字典/获取排序号.ms index 920211e..4b71931 100644 --- a/data/magic-api/api/后台/数据字典/获取排序号.ms +++ b/data/magic-api/api/后台/数据字典/获取排序号.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "c7ce65f5b3cf4aaa913f6fec7d35d176", "name" : "获取排序号", - "createTime" : null, + "createTime" : 1646490239435, "updateTime" : 1634735056733, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.selectInt("""select max(sort) + 10 from sys_dict where is_del = '0'""") || 10; \ No newline at end of file diff --git a/data/magic-api/api/后台/文件管理/group.json b/data/magic-api/api/后台/文件管理/group.json index 0b4bf28..52deb7b 100644 --- a/data/magic-api/api/后台/文件管理/group.json +++ b/data/magic-api/api/后台/文件管理/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "文件管理", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/file", "paths" : [ ], diff --git a/data/magic-api/api/后台/文件管理/上传.ms b/data/magic-api/api/后台/文件管理/上传.ms index 89b0c4d..9fb2149 100644 --- a/data/magic-api/api/后台/文件管理/上传.ms +++ b/data/magic-api/api/后台/文件管理/上传.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "上传", - "createTime" : null, + "createTime" : 1646490239451, "updateTime" : 1643706737853, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/upload", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicboot.utils.FileUtils diff --git a/data/magic-api/api/后台/文件管理/删除.ms b/data/magic-api/api/后台/文件管理/删除.ms index b6d93fe..a684929 100644 --- a/data/magic-api/api/后台/文件管理/删除.ms +++ b/data/magic-api/api/后台/文件管理/删除.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239453, "updateTime" : 1643706734133, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import java.net.URLDecoder diff --git a/data/magic-api/api/后台/文件管理/排序.ms b/data/magic-api/api/后台/文件管理/排序.ms index 6d12c69..988e7cd 100644 --- a/data/magic-api/api/后台/文件管理/排序.ms +++ b/data/magic-api/api/后台/文件管理/排序.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "排序", - "createTime" : null, + "createTime" : 1646490239454, "updateTime" : 1643706726137, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/resort", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import java.net.URLDecoder diff --git a/data/magic-api/api/后台/文件管理/获取文件列表.ms b/data/magic-api/api/后台/文件管理/获取文件列表.ms index 73250f9..3fbabca 100644 --- a/data/magic-api/api/后台/文件管理/获取文件列表.ms +++ b/data/magic-api/api/后台/文件管理/获取文件列表.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "获取文件列表", - "createTime" : null, + "createTime" : 1646490239456, "updateTime" : 1635075004674, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/files", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -101,8 +103,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select("select url from sys_file where external_id = #{externalId} and external_type = #{externalType} order by sort").map(it => {return it.url}) \ No newline at end of file diff --git a/data/magic-api/api/后台/文件管理/裁剪.ms b/data/magic-api/api/后台/文件管理/裁剪.ms index 6405b99..2c80e1f 100644 --- a/data/magic-api/api/后台/文件管理/裁剪.ms +++ b/data/magic-api/api/后台/文件管理/裁剪.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "fd3d225a1cf141bf9998c4ec4bf4a6ab", "name" : "裁剪", - "createTime" : null, + "createTime" : 1646490239458, "updateTime" : 1643706719537, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/cropper", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicboot.model.Global diff --git a/data/magic-api/api/后台/日志管理/group.json b/data/magic-api/api/后台/日志管理/group.json new file mode 100644 index 0000000..8577380 --- /dev/null +++ b/data/magic-api/api/后台/日志管理/group.json @@ -0,0 +1,10 @@ +{ + "properties" : { }, + "id" : "9ec6f9ec92d24a369952bb13eddc134f", + "name" : "日志管理", + "type" : "api", + "parentId" : "02df51e4d7184780a98b632f43dc5848", + "path" : "/log", + "paths" : [ ], + "options" : [ ] +} \ No newline at end of file diff --git a/data/magic-api/api/后台/日志管理/操作日志.ms b/data/magic-api/api/后台/日志管理/操作日志.ms new file mode 100644 index 0000000..dba2680 --- /dev/null +++ b/data/magic-api/api/后台/日志管理/操作日志.ms @@ -0,0 +1,258 @@ +{ + "properties" : { }, + "id" : "f3263e9461c94c02b68e722fae921981", + "script" : null, + "groupId" : "9ec6f9ec92d24a369952bb13eddc134f", + "name" : "操作日志", + "createTime" : 1646490239460, + "updateTime" : 1646474005369, + "lock" : "0", + "createBy" : null, + "updateBy" : null, + "path" : "/oper/list", + "method" : "GET", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"total\": 86,\n \"list\": [{\n \"id\": 7947,\n \"apiName\": \"后台-安全-登录\",\n \"apiPath\": \"/security/login\",\n \"apiMethod\": \"POST\",\n \"costTime\": 301,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7948,\n \"apiName\": \"后台-用户管理-获取用户信息\",\n \"apiPath\": \"/user/info\",\n \"apiMethod\": \"GET\",\n \"costTime\": 41,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7949,\n \"apiName\": \"后台-数据字典-字典项-获取所有字典项\",\n \"apiPath\": \"/dict/items/all\",\n \"apiMethod\": \"GET\",\n \"costTime\": 19,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7950,\n \"apiName\": \"后台-配置-获取所有配置\",\n \"apiPath\": \"/config/list\",\n \"apiMethod\": \"GET\",\n \"costTime\": 5,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7951,\n \"apiName\": \"后台-菜单管理-当前用户菜单\",\n \"apiPath\": \"/menu/current/menus\",\n \"apiMethod\": \"POST\",\n \"costTime\": 19,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7952,\n \"apiName\": \"后台-菜单管理-获取菜单tree\",\n \"apiPath\": \"/menu/tree\",\n \"apiMethod\": \"GET\",\n \"costTime\": 34,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:27\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7953,\n \"apiName\": \"后台-组织机构-列表\",\n \"apiPath\": \"/office/tree\",\n \"apiMethod\": \"GET\",\n \"costTime\": 10,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:28\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7954,\n \"apiName\": \"后台-角色管理-列表\",\n \"apiPath\": \"/role/list\",\n \"apiMethod\": \"GET\",\n \"costTime\": 18,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:29\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7955,\n \"apiName\": \"后台-菜单管理-获取排序号\",\n \"apiPath\": \"/menu/sort\",\n \"apiMethod\": \"GET\",\n \"costTime\": 5,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:23:42\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7956,\n \"apiName\": \"后台-组件-选择组件\",\n \"apiPath\": \"/component/select\",\n \"apiMethod\": \"GET\",\n \"costTime\": 4,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:23:43\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }]\n },\n \"timestamp\": 1646472930242,\n \"executeTime\": 19\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "200", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "total", + "value" : "86", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "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" : "7947", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiName", + "value" : "后台-安全-登录", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiPath", + "value" : "/security/login", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiMethod", + "value" : "POST", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "costTime", + "value" : "301", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createBy", + "value" : "1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createDate", + "value" : "2022-03-05 12:22:24", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "userAgent", + "value" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "userIp", + "value" : "0:0:0:0:0:0:0:1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "username", + "value" : "admin", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } ] + } ] + }, { + "name" : "timestamp", + "value" : "1646472930242", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "19", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } +} +================================ +return db.page(""" + select sol.*,su.username from sys_oper_log sol left join sys_user su on sol.create_by = su.id where 1=1 + ?{createDate && createDate.split(',')[0], and sol.create_date >= #{createDate.split(',')[0]}} + ?{createDate && createDate.split(',')[1], and sol.create_date <= #{createDate.split(',')[1]}} + order by create_date desc +""") \ No newline at end of file diff --git a/data/magic-api/api/后台/日志管理/登录日志.ms b/data/magic-api/api/后台/日志管理/登录日志.ms new file mode 100644 index 0000000..5c1b35a --- /dev/null +++ b/data/magic-api/api/后台/日志管理/登录日志.ms @@ -0,0 +1,258 @@ +{ + "properties" : { }, + "id" : "copy3933719533", + "script" : null, + "groupId" : "9ec6f9ec92d24a369952bb13eddc134f", + "name" : "登录日志", + "createTime" : null, + "updateTime" : 1646490406374, + "lock" : "0", + "createBy" : null, + "updateBy" : null, + "path" : "/login/list", + "method" : "GET", + "parameters" : [ ], + "options" : [ ], + "requestBody" : "", + "headers" : [ ], + "paths" : [ ], + "responseBody" : "{\n \"code\": 200,\n \"message\": \"success\",\n \"data\": {\n \"total\": 86,\n \"list\": [{\n \"id\": 7947,\n \"apiName\": \"后台-安全-登录\",\n \"apiPath\": \"/security/login\",\n \"apiMethod\": \"POST\",\n \"costTime\": 301,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7948,\n \"apiName\": \"后台-用户管理-获取用户信息\",\n \"apiPath\": \"/user/info\",\n \"apiMethod\": \"GET\",\n \"costTime\": 41,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7949,\n \"apiName\": \"后台-数据字典-字典项-获取所有字典项\",\n \"apiPath\": \"/dict/items/all\",\n \"apiMethod\": \"GET\",\n \"costTime\": 19,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7950,\n \"apiName\": \"后台-配置-获取所有配置\",\n \"apiPath\": \"/config/list\",\n \"apiMethod\": \"GET\",\n \"costTime\": 5,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7951,\n \"apiName\": \"后台-菜单管理-当前用户菜单\",\n \"apiPath\": \"/menu/current/menus\",\n \"apiMethod\": \"POST\",\n \"costTime\": 19,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:24\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7952,\n \"apiName\": \"后台-菜单管理-获取菜单tree\",\n \"apiPath\": \"/menu/tree\",\n \"apiMethod\": \"GET\",\n \"costTime\": 34,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:27\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7953,\n \"apiName\": \"后台-组织机构-列表\",\n \"apiPath\": \"/office/tree\",\n \"apiMethod\": \"GET\",\n \"costTime\": 10,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:28\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7954,\n \"apiName\": \"后台-角色管理-列表\",\n \"apiPath\": \"/role/list\",\n \"apiMethod\": \"GET\",\n \"costTime\": 18,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:22:29\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7955,\n \"apiName\": \"后台-菜单管理-获取排序号\",\n \"apiPath\": \"/menu/sort\",\n \"apiMethod\": \"GET\",\n \"costTime\": 5,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:23:42\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }, {\n \"id\": 7956,\n \"apiName\": \"后台-组件-选择组件\",\n \"apiPath\": \"/component/select\",\n \"apiMethod\": \"GET\",\n \"costTime\": 4,\n \"createBy\": \"1\",\n \"createDate\": \"2022-03-05 12:23:43\",\n \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36\",\n \"userIp\": \"0:0:0:0:0:0:0:1\",\n \"username\": \"admin\"\n }]\n },\n \"timestamp\": 1646472930242,\n \"executeTime\": 19\n}", + "description" : null, + "requestBodyDefinition" : null, + "responseBodyDefinition" : { + "name" : "", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "code", + "value" : "200", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "message", + "value" : "success", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "data", + "value" : "", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ { + "name" : "total", + "value" : "86", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "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" : "7947", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiName", + "value" : "后台-安全-登录", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiPath", + "value" : "/security/login", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "apiMethod", + "value" : "POST", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "costTime", + "value" : "301", + "description" : "", + "required" : false, + "dataType" : "Integer", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createBy", + "value" : "1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "createDate", + "value" : "2022-03-05 12:22:24", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "userAgent", + "value" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "userIp", + "value" : "0:0:0:0:0:0:0:1", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "username", + "value" : "admin", + "description" : "", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } ] + } ] + }, { + "name" : "timestamp", + "value" : "1646472930242", + "description" : "", + "required" : false, + "dataType" : "Long", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + }, { + "name" : "executeTime", + "value" : "19", + "description" : "", + "required" : false, + "dataType" : "Object", + "type" : null, + "defaultValue" : null, + "validateType" : "", + "error" : "", + "expression" : "", + "children" : [ ] + } ] + } +} +================================ +return db.page(""" + select * from sys_login_log where 1=1 + ?{createDate && createDate.split(',')[0], and create_date >= #{createDate.split(',')[0]}} + ?{createDate && createDate.split(',')[1], and create_date <= #{createDate.split(',')[1]}} + order by create_date desc +""") \ No newline at end of file diff --git a/data/magic-api/api/后台/测试数据/group.json b/data/magic-api/api/后台/测试数据/group.json index 2f33a55..f15f827 100644 --- a/data/magic-api/api/后台/测试数据/group.json +++ b/data/magic-api/api/后台/测试数据/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "42d241c0bb18476f8dabf92c2e4e2324", "name" : "测试数据", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/test", "paths" : [ ], diff --git a/data/magic-api/api/后台/测试数据/保存.ms b/data/magic-api/api/后台/测试数据/保存.ms index 53603bf..d601660 100644 --- a/data/magic-api/api/后台/测试数据/保存.ms +++ b/data/magic-api/api/后台/测试数据/保存.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "42d241c0bb18476f8dabf92c2e4e2324", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239463, "updateTime" : 1642312068428, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data" - } + "responseBodyDefinition" : null } ================================ return db.table("sys_test_data").primary("id").saveOrUpdate(data) \ No newline at end of file diff --git a/data/magic-api/api/后台/测试数据/列表.ms b/data/magic-api/api/后台/测试数据/列表.ms index 58e1fb4..9386692 100644 --- a/data/magic-api/api/后台/测试数据/列表.ms +++ b/data/magic-api/api/后台/测试数据/列表.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "42d241c0bb18476f8dabf92c2e4e2324", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239464, "updateTime" : 1642327645651, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ /** diff --git a/data/magic-api/api/后台/用户管理/group.json b/data/magic-api/api/后台/用户管理/group.json index 0161058..0f0c572 100644 --- a/data/magic-api/api/后台/用户管理/group.json +++ b/data/magic-api/api/后台/用户管理/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "用户管理", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/user", "paths" : [ ], diff --git a/data/magic-api/api/后台/用户管理/个人信息修改.ms b/data/magic-api/api/后台/用户管理/个人信息修改.ms index 327df88..aaf7083 100644 --- a/data/magic-api/api/后台/用户管理/个人信息修改.ms +++ b/data/magic-api/api/后台/用户管理/个人信息修改.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "个人信息修改", - "createTime" : null, + "createTime" : 1646490239466, "updateTime" : 1643713357950, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/center/update", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{\r\n\t\r\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import cn.dev33.satoken.secure.SaSecureUtil; diff --git a/data/magic-api/api/后台/用户管理/保存.ms b/data/magic-api/api/后台/用户管理/保存.ms index 4e41ee6..be4242b 100644 --- a/data/magic-api/api/后台/用户管理/保存.ms +++ b/data/magic-api/api/后台/用户管理/保存.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239467, "updateTime" : 1644121682487, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"user:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "user:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "user:save" - } + "responseBodyDefinition" : null } ================================ import cn.dev33.satoken.secure.SaSecureUtil; diff --git a/data/magic-api/api/后台/用户管理/修改登录状态.ms b/data/magic-api/api/后台/用户管理/修改登录状态.ms index 1b99d17..5632777 100644 --- a/data/magic-api/api/后台/用户管理/修改登录状态.ms +++ b/data/magic-api/api/后台/用户管理/修改登录状态.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "修改登录状态", - "createTime" : null, + "createTime" : 1646490239469, "updateTime" : 1634729738648, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/change/login/status", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.table("sys_user").column("isLogin", isLogin).where().eq("id",id).update() \ No newline at end of file diff --git a/data/magic-api/api/后台/用户管理/列表.ms b/data/magic-api/api/后台/用户管理/列表.ms index 1939ca9..c02dff1 100644 --- a/data/magic-api/api/后台/用户管理/列表.ms +++ b/data/magic-api/api/后台/用户管理/列表.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239471, "updateTime" : 1644121683184, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"user:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "user:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "user:view" } } ================================ diff --git a/data/magic-api/api/后台/用户管理/删除.ms b/data/magic-api/api/后台/用户管理/删除.ms index 4aed604..8c7a57d 100644 --- a/data/magic-api/api/后台/用户管理/删除.ms +++ b/data/magic-api/api/后台/用户管理/删除.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239473, "updateTime" : 1644121688496, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"user:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "user:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "user:delete" - } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicapi.cache.SqlCache diff --git a/data/magic-api/api/后台/用户管理/所有机构.ms b/data/magic-api/api/后台/用户管理/所有机构.ms index a7f10a8..5c9e1d6 100644 --- a/data/magic-api/api/后台/用户管理/所有机构.ms +++ b/data/magic-api/api/后台/用户管理/所有机构.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "所有机构", - "createTime" : null, + "createTime" : 1646490239474, "updateTime" : 1642134606249, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/offices", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -233,8 +235,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ var toTree = (list,pid) => select t.*,toTree(list,t.id) children from list t where t.pid = pid diff --git a/data/magic-api/api/后台/用户管理/根据用户id获取角色列表.ms b/data/magic-api/api/后台/用户管理/根据用户id获取角色列表.ms index 2d99d2e..2f44853 100644 --- a/data/magic-api/api/后台/用户管理/根据用户id获取角色列表.ms +++ b/data/magic-api/api/后台/用户管理/根据用户id获取角色列表.ms @@ -4,11 +4,13 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "根据用户id获取角色列表", - "createTime" : null, + "createTime" : 1646490239476, "updateTime" : 1642773983120, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/roles", + "method" : "GET", "parameters" : [ { "name" : "userId", "value" : "674a3aa6b1ea4d91a1f72e7879d415c3", @@ -22,7 +24,7 @@ "expression" : null, "children" : null } ], - "option" : "[]", + "options" : [ ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -101,8 +103,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select(""" diff --git a/data/magic-api/api/后台/用户管理/获取用户信息.ms b/data/magic-api/api/后台/用户管理/获取用户信息.ms index 6d11342..bfd4ca5 100644 --- a/data/magic-api/api/后台/用户管理/获取用户信息.ms +++ b/data/magic-api/api/后台/用户管理/获取用户信息.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "4f0230049d7e4f39b1e0897cc0f46f9a", "name" : "获取用户信息", - "createTime" : null, + "createTime" : 1646490239479, "updateTime" : 1643710783720, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/info", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ import 'cn.dev33.satoken.stp.StpUtil'; diff --git a/data/magic-api/api/后台/组件/group.json b/data/magic-api/api/后台/组件/group.json index d06de0a..9ba1e2a 100644 --- a/data/magic-api/api/后台/组件/group.json +++ b/data/magic-api/api/后台/组件/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "6f106ebdee21489db34b956f7770ff03", "name" : "组件", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/component", "paths" : [ ], diff --git a/data/magic-api/api/后台/组件/保存.ms b/data/magic-api/api/后台/组件/保存.ms index 44eaead..ae0abee 100644 --- a/data/magic-api/api/后台/组件/保存.ms +++ b/data/magic-api/api/后台/组件/保存.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239481, "updateTime" : 1646401456776, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data" - } + "responseBodyDefinition" : null } ================================ return db.table("sys_component").primary("id").saveOrUpdate(data) \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/列表.ms b/data/magic-api/api/后台/组件/列表.ms index baef38d..e0f01d1 100644 --- a/data/magic-api/api/后台/组件/列表.ms +++ b/data/magic-api/api/后台/组件/列表.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239482, "updateTime" : 1646401619732, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.page(""" diff --git a/data/magic-api/api/后台/组件/删除.ms b/data/magic-api/api/后台/组件/删除.ms index 91f5abd..0a65589 100644 --- a/data/magic-api/api/后台/组件/删除.ms +++ b/data/magic-api/api/后台/组件/删除.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239484, "updateTime" : 1646401575406, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.table("sys_component").logic().where().eq("id",id).delete() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/详情.ms b/data/magic-api/api/后台/组件/详情.ms index 50f36b9..61604ef 100644 --- a/data/magic-api/api/后台/组件/详情.ms +++ b/data/magic-api/api/后台/组件/详情.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "详情", - "createTime" : null, + "createTime" : 1646490239485, "updateTime" : 1646401567689, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/get", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -185,8 +187,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.table("sys_component").where().eq("id",id).selectOne() \ No newline at end of file diff --git a/data/magic-api/api/后台/组件/选择组件.ms b/data/magic-api/api/后台/组件/选择组件.ms index d6d111a..1cdb869 100644 --- a/data/magic-api/api/后台/组件/选择组件.ms +++ b/data/magic-api/api/后台/组件/选择组件.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "6f106ebdee21489db34b956f7770ff03", "name" : "选择组件", - "createTime" : null, + "createTime" : 1646490239487, "updateTime" : 1646402724502, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/select", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select(""" diff --git a/data/magic-api/api/后台/组织机构/group.json b/data/magic-api/api/后台/组织机构/group.json index e5af983..d3491dc 100644 --- a/data/magic-api/api/后台/组织机构/group.json +++ b/data/magic-api/api/后台/组织机构/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "8295fc13678d4144bf7363c465247a50", "name" : "组织机构", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/office", "paths" : [ ], diff --git a/data/magic-api/api/后台/组织机构/上移.ms b/data/magic-api/api/后台/组织机构/上移.ms index 301c62f..9d4095b 100644 --- a/data/magic-api/api/后台/组织机构/上移.ms +++ b/data/magic-api/api/后台/组织机构/上移.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "上移", - "createTime" : null, + "createTime" : 1646490239489, "updateTime" : 1641732205207, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort/up", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ var top = db.selectOne(""" diff --git a/data/magic-api/api/后台/组织机构/下移.ms b/data/magic-api/api/后台/组织机构/下移.ms index f0efa49..c037bc7 100644 --- a/data/magic-api/api/后台/组织机构/下移.ms +++ b/data/magic-api/api/后台/组织机构/下移.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "下移", - "createTime" : null, + "createTime" : 1646490239491, "updateTime" : 1641737498723, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort/down", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ var top = db.selectOne(""" diff --git a/data/magic-api/api/后台/组织机构/保存.ms b/data/magic-api/api/后台/组织机构/保存.ms index 77de662..12f01ae 100644 --- a/data/magic-api/api/后台/组织机构/保存.ms +++ b/data/magic-api/api/后台/组织机构/保存.ms @@ -4,24 +4,46 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239492, "updateTime" : 1644121675551, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"office:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + }, { + "name" : "permission", + "value" : "office:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data", - "permission" : "office:save" - } + "responseBodyDefinition" : null } ================================ var codeCount = db.selectInt("select count(1) from sys_office where is_del = 0 and code = #{code} ?{id, and id != #{id}}") diff --git a/data/magic-api/api/后台/组织机构/列表.ms b/data/magic-api/api/后台/组织机构/列表.ms index b6d21fa..de612b7 100644 --- a/data/magic-api/api/后台/组织机构/列表.ms +++ b/data/magic-api/api/后台/组织机构/列表.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239494, "updateTime" : 1645694064991, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/tree", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"office:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "office:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "office:view" } } ================================ diff --git a/data/magic-api/api/后台/组织机构/删除.ms b/data/magic-api/api/后台/组织机构/删除.ms index 4569083..208c278 100644 --- a/data/magic-api/api/后台/组织机构/删除.ms +++ b/data/magic-api/api/后台/组织机构/删除.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239496, "updateTime" : 1644121676877, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"office:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "office:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "office:delete" } } ================================ diff --git a/data/magic-api/api/后台/组织机构/根据角色获取组织机构.ms b/data/magic-api/api/后台/组织机构/根据角色获取组织机构.ms index 7d4ea1b..c5778b8 100644 --- a/data/magic-api/api/后台/组织机构/根据角色获取组织机构.ms +++ b/data/magic-api/api/后台/组织机构/根据角色获取组织机构.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "根据角色获取组织机构", - "createTime" : null, + "createTime" : 1646490239498, "updateTime" : 1642080922495, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/by/role", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select(""" diff --git a/data/magic-api/api/后台/组织机构/获取排序号.ms b/data/magic-api/api/后台/组织机构/获取排序号.ms index 32ecc29..fdcf1c6 100644 --- a/data/magic-api/api/后台/组织机构/获取排序号.ms +++ b/data/magic-api/api/后台/组织机构/获取排序号.ms @@ -4,11 +4,13 @@ "script" : null, "groupId" : "8295fc13678d4144bf7363c465247a50", "name" : "获取排序号", - "createTime" : null, + "createTime" : 1646490239501, "updateTime" : 1641732159522, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort", + "method" : "GET", "parameters" : [ { "name" : "pid", "value" : "", @@ -22,15 +24,14 @@ "expression" : null, "children" : null } ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.selectInt(""" diff --git a/data/magic-api/api/后台/菜单管理/group.json b/data/magic-api/api/后台/菜单管理/group.json index 5a634a3..9f9aa20 100644 --- a/data/magic-api/api/后台/菜单管理/group.json +++ b/data/magic-api/api/后台/菜单管理/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "67b2ce258e24491194b74992958c74aa", "name" : "菜单管理", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/menu", "paths" : [ ], diff --git a/data/magic-api/api/后台/菜单管理/上移.ms b/data/magic-api/api/后台/菜单管理/上移.ms index 5ab9b14..c6f433e 100644 --- a/data/magic-api/api/后台/菜单管理/上移.ms +++ b/data/magic-api/api/后台/菜单管理/上移.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "上移", - "createTime" : null, + "createTime" : 1646490239503, "updateTime" : 1641564601649, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort/up", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ var top = db.selectOne(""" diff --git a/data/magic-api/api/后台/菜单管理/下移.ms b/data/magic-api/api/后台/菜单管理/下移.ms index a3ac1c7..713d7a9 100644 --- a/data/magic-api/api/后台/菜单管理/下移.ms +++ b/data/magic-api/api/后台/菜单管理/下移.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "下移", - "createTime" : null, + "createTime" : 1646490239505, "updateTime" : 1641564596885, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort/down", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ var top = db.selectOne(""" diff --git a/data/magic-api/api/后台/菜单管理/保存.ms b/data/magic-api/api/后台/菜单管理/保存.ms index b69f489..440de74 100644 --- a/data/magic-api/api/后台/菜单管理/保存.ms +++ b/data/magic-api/api/后台/菜单管理/保存.ms @@ -4,24 +4,46 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239506, "updateTime" : 1644121672548, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"},{\"name\":\"permission\",\"value\":\"menu:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + }, { + "name" : "permission", + "value" : "menu:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data", - "permission" : "menu:save" - } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicapi.cache.SqlCache; diff --git a/data/magic-api/api/后台/菜单管理/修改是否显示.ms b/data/magic-api/api/后台/菜单管理/修改是否显示.ms index 3f37ad9..5c3c790 100644 --- a/data/magic-api/api/后台/菜单管理/修改是否显示.ms +++ b/data/magic-api/api/后台/菜单管理/修改是否显示.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "修改是否显示", - "createTime" : null, + "createTime" : 1646490239508, "updateTime" : 1641482987357, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/change", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"wrap_request_parameter\",\"value\":\"data\",\"description\":\"包装请求参数到一个变量中\"}]", + "options" : [ { + "name" : "wrap_request_parameter", + "value" : "data", + "description" : "包装请求参数到一个变量中", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "wrap_request_parameter" : "data" - } + "responseBodyDefinition" : null } ================================ return db.table("sys_menu").primary("id").update(data) \ No newline at end of file diff --git a/data/magic-api/api/后台/菜单管理/删除.ms b/data/magic-api/api/后台/菜单管理/删除.ms index 0f387ba..2bf401b 100644 --- a/data/magic-api/api/后台/菜单管理/删除.ms +++ b/data/magic-api/api/后台/菜单管理/删除.ms @@ -4,11 +4,13 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239510, "updateTime" : 1644121673352, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ { "name" : "id", "value" : "b1851d1b13594e71840103c11a37a669", @@ -22,7 +24,19 @@ "expression" : null, "children" : null } ], - "option" : "[{\"name\":\"permission\",\"value\":\"menu:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "menu:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -101,9 +115,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "menu:delete" } } ================================ diff --git a/data/magic-api/api/后台/菜单管理/当前用户菜单.ms b/data/magic-api/api/后台/菜单管理/当前用户菜单.ms index 9dda019..658f228 100644 --- a/data/magic-api/api/后台/菜单管理/当前用户菜单.ms +++ b/data/magic-api/api/后台/菜单管理/当前用户菜单.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "当前用户菜单", - "createTime" : null, + "createTime" : 1646490239513, "updateTime" : 1646450734459, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/current/menus", + "method" : "POST", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -533,8 +535,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ import 'cn.dev33.satoken.stp.StpUtil'; diff --git a/data/magic-api/api/后台/菜单管理/根据菜单id清除缓存.ms b/data/magic-api/api/后台/菜单管理/根据菜单id清除缓存.ms index 17405ff..f961a26 100644 --- a/data/magic-api/api/后台/菜单管理/根据菜单id清除缓存.ms +++ b/data/magic-api/api/后台/菜单管理/根据菜单id清除缓存.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "根据菜单id清除缓存", - "createTime" : null, + "createTime" : 1646490239517, "updateTime" : 1641218495832, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/cache/delete", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicapi.cache.SqlCache diff --git a/data/magic-api/api/后台/菜单管理/根据角色获取菜单.ms b/data/magic-api/api/后台/菜单管理/根据角色获取菜单.ms index 19567a4..d30d76d 100644 --- a/data/magic-api/api/后台/菜单管理/根据角色获取菜单.ms +++ b/data/magic-api/api/后台/菜单管理/根据角色获取菜单.ms @@ -4,11 +4,13 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "根据角色获取菜单", - "createTime" : null, + "createTime" : 1646490239520, "updateTime" : 1642080927004, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/by/role", + "method" : "GET", "parameters" : [ { "name" : "roleId", "value" : "4d80f40315f747768d5b14095a0a7336", @@ -22,7 +24,7 @@ "expression" : null, "children" : null } ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -113,8 +115,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ return db.select(""" diff --git a/data/magic-api/api/后台/菜单管理/获取排序号.ms b/data/magic-api/api/后台/菜单管理/获取排序号.ms index 6ca6a71..8d28403 100644 --- a/data/magic-api/api/后台/菜单管理/获取排序号.ms +++ b/data/magic-api/api/后台/菜单管理/获取排序号.ms @@ -4,11 +4,13 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "获取排序号", - "createTime" : null, + "createTime" : 1646490239522, "updateTime" : 1641732167291, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/sort", + "method" : "GET", "parameters" : [ { "name" : "pid", "value" : "", @@ -22,15 +24,14 @@ "expression" : null, "children" : null } ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ return db.selectInt(""" diff --git a/data/magic-api/api/后台/菜单管理/获取菜单tree.ms b/data/magic-api/api/后台/菜单管理/获取菜单tree.ms index 4a48f5b..d29169b 100644 --- a/data/magic-api/api/后台/菜单管理/获取菜单tree.ms +++ b/data/magic-api/api/后台/菜单管理/获取菜单tree.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "67b2ce258e24491194b74992958c74aa", "name" : "获取菜单tree", - "createTime" : null, + "createTime" : 1646490239523, "updateTime" : 1646402874965, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/tree", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"menu:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "menu:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -89,9 +103,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "menu:view" } } ================================ diff --git a/data/magic-api/api/后台/角色管理/group.json b/data/magic-api/api/后台/角色管理/group.json index 01c2069..dd9840a 100644 --- a/data/magic-api/api/后台/角色管理/group.json +++ b/data/magic-api/api/后台/角色管理/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "89130d496f6f467c88b22ae4a7f688eb", "name" : "角色管理", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/role", "paths" : [ ], diff --git a/data/magic-api/api/后台/角色管理/保存.ms b/data/magic-api/api/后台/角色管理/保存.ms index 3aa1387..5dd2bdb 100644 --- a/data/magic-api/api/后台/角色管理/保存.ms +++ b/data/magic-api/api/后台/角色管理/保存.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "89130d496f6f467c88b22ae4a7f688eb", "name" : "保存", - "createTime" : null, + "createTime" : 1646490239526, "updateTime" : 1644121680268, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/save", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"role:save\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "role:save", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "role:save" - } + "responseBodyDefinition" : null } ================================ import '@get:/role/cache/delete' as cacheDelete diff --git a/data/magic-api/api/后台/角色管理/列表.ms b/data/magic-api/api/后台/角色管理/列表.ms index 8619fdd..17c0edc 100644 --- a/data/magic-api/api/后台/角色管理/列表.ms +++ b/data/magic-api/api/后台/角色管理/列表.ms @@ -4,13 +4,27 @@ "script" : null, "groupId" : "89130d496f6f467c88b22ae4a7f688eb", "name" : "列表", - "createTime" : null, + "createTime" : 1646490239527, "updateTime" : 1644121680976, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"role:view\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "role:view", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], @@ -149,9 +163,6 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { - "permission" : "role:view" } } ================================ diff --git a/data/magic-api/api/后台/角色管理/删除.ms b/data/magic-api/api/后台/角色管理/删除.ms index baad4d7..c522ed3 100644 --- a/data/magic-api/api/后台/角色管理/删除.ms +++ b/data/magic-api/api/后台/角色管理/删除.ms @@ -4,23 +4,34 @@ "script" : null, "groupId" : "89130d496f6f467c88b22ae4a7f688eb", "name" : "删除", - "createTime" : null, + "createTime" : 1646490239530, "updateTime" : 1644121681716, "lock" : "0", - "method" : "POST", + "createBy" : null, + "updateBy" : null, "path" : "/delete", + "method" : "POST", "parameters" : [ ], - "option" : "[{\"name\":\"permission\",\"value\":\"role:delete\",\"description\":\"允许拥有该权限的访问\"}]", + "options" : [ { + "name" : "permission", + "value" : "role:delete", + "description" : "允许拥有该权限的访问", + "required" : false, + "dataType" : "String", + "type" : null, + "defaultValue" : null, + "validateType" : null, + "error" : null, + "expression" : null, + "children" : null + } ], "requestBody" : "{\n\n}", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { - "permission" : "role:delete" - } + "responseBodyDefinition" : null } ================================ import '@get:/role/cache/delete' as cacheDelete diff --git a/data/magic-api/api/后台/角色管理/根据角色id删除缓存.ms b/data/magic-api/api/后台/角色管理/根据角色id删除缓存.ms index b6c0ae3..c8fbecf 100644 --- a/data/magic-api/api/后台/角色管理/根据角色id删除缓存.ms +++ b/data/magic-api/api/后台/角色管理/根据角色id删除缓存.ms @@ -4,21 +4,22 @@ "script" : null, "groupId" : "89130d496f6f467c88b22ae4a7f688eb", "name" : "根据角色id删除缓存", - "createTime" : null, + "createTime" : 1646490239532, "updateTime" : 1641218346505, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/cache/delete", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], "responseBody" : null, "description" : null, "requestBodyDefinition" : null, - "responseBodyDefinition" : null, - "optionMap" : { } + "responseBodyDefinition" : null } ================================ import org.ssssssss.magicapi.cache.SqlCache diff --git a/data/magic-api/api/后台/配置/group.json b/data/magic-api/api/后台/配置/group.json index b22eebc..25eef8f 100644 --- a/data/magic-api/api/后台/配置/group.json +++ b/data/magic-api/api/后台/配置/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "5c36bdc1de454d6e9d1a464d87c96091", "name" : "配置", - "type" : "1", + "type" : "api", "parentId" : "02df51e4d7184780a98b632f43dc5848", "path" : "/config", "paths" : [ ], diff --git a/data/magic-api/api/后台/配置/获取所有配置.ms b/data/magic-api/api/后台/配置/获取所有配置.ms index d122ddc..1936724 100644 --- a/data/magic-api/api/后台/配置/获取所有配置.ms +++ b/data/magic-api/api/后台/配置/获取所有配置.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "5c36bdc1de454d6e9d1a464d87c96091", "name" : "获取所有配置", - "createTime" : null, + "createTime" : 1646490239534, "updateTime" : 1646391487051, "lock" : "0", - "method" : "GET", + "createBy" : null, + "updateBy" : null, "path" : "/list", + "method" : "GET", "parameters" : [ ], - "option" : "[]", + "options" : [ ], "requestBody" : "", "headers" : [ ], "paths" : [ ], @@ -89,8 +91,7 @@ "expression" : "", "children" : [ ] } ] - }, - "optionMap" : { } + } } ================================ import 'org.ssssssss.magicboot.utils.WebUtils' diff --git a/data/magic-api/function/权限/group.json b/data/magic-api/function/权限/group.json index 415fcae..89aea2e 100644 --- a/data/magic-api/function/权限/group.json +++ b/data/magic-api/function/权限/group.json @@ -2,7 +2,7 @@ "properties" : { }, "id" : "41922e26ef57421f8819fe6c59f14d63", "name" : "权限", - "type" : "2", + "type" : "function", "parentId" : "0", "path" : "/permission", "paths" : [ ], diff --git a/data/magic-api/function/权限/组织机构.ms b/data/magic-api/function/权限/组织机构.ms index f29c0e0..78ec679 100644 --- a/data/magic-api/function/权限/组织机构.ms +++ b/data/magic-api/function/权限/组织机构.ms @@ -4,13 +4,15 @@ "script" : null, "groupId" : "41922e26ef57421f8819fe6c59f14d63", "name" : "组织机构", - "createTime" : null, + "createTime" : 1646490239535, "updateTime" : 1642327198030, "lock" : "0", + "createBy" : null, + "updateBy" : null, "path" : "/office", "description" : null, "returnType" : null, - "mappingPath" : null, + "mappingPath" : "/permission/office", "parameters" : [ ] } ================================ diff --git a/magic-boot-ui/src/assets/css/common.css b/magic-boot-ui/src/assets/css/common.css index bf6524a..c273240 100644 --- a/magic-boot-ui/src/assets/css/common.css +++ b/magic-boot-ui/src/assets/css/common.css @@ -4,6 +4,24 @@ font-weight: 100; font-style: normal; } +::-webkit-scrollbar { + width: 6px; + height: 6px; + overflow: auto +} + +::-webkit-scrollbar-thumb { + background-color: #e6e6e6; + min-height: 25px; + min-width: 25px; + border: 1px solid #e0e0e0; + border-radius: 99px +} + +::-webkit-scrollbar-track { + background-color: #f7f7f7; + border: 1px solid #efefef +} body{ --el-dialog__wrapper-bottom: 15vh; --el-dialog__wrapper-top: 15vh; diff --git a/magic-boot-ui/src/components/magic/mb-search.vue b/magic-boot-ui/src/components/magic/mb-search.vue index 6fa7200..f80f396 100644 --- a/magic-boot-ui/src/components/magic/mb-search.vue +++ b/magic-boot-ui/src/components/magic/mb-search.vue @@ -8,12 +8,12 @@ v-else-if="it.type == 'date' || it.type == 'datetime' || it.type == 'daterange' || it.type == 'datetimerange'" v-model="it.value" align="right" - :format="it.type.startsWith('datetime') ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'" - :value-format="it.type.startsWith('datetime') ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'" + :format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'" + :value-format="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'" :type="it.type" - :start-placeholder="it.type.startsWith('datetime') ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'" - :end-placeholder="it.type.startsWith('datetime') ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'" - :placeholder="it.type.startsWith('datetime') ? 'yyyy-MM-dd HH:mm:ss' : 'yyyy-MM-dd'" + start-placeholder="开始时间" + end-placeholder="结束时间" + :placeholder="it.type.startsWith('datetime') ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'" > diff --git a/magic-boot-ui/src/icons/component.svg b/magic-boot-ui/src/icons/component.svg new file mode 100644 index 0000000..dd829bf --- /dev/null +++ b/magic-boot-ui/src/icons/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/interface.svg b/magic-boot-ui/src/icons/interface.svg new file mode 100644 index 0000000..182c616 --- /dev/null +++ b/magic-boot-ui/src/icons/interface.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/log.svg b/magic-boot-ui/src/icons/log.svg new file mode 100644 index 0000000..a4bebdf --- /dev/null +++ b/magic-boot-ui/src/icons/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/login-log.svg b/magic-boot-ui/src/icons/login-log.svg new file mode 100644 index 0000000..43bc10b --- /dev/null +++ b/magic-boot-ui/src/icons/login-log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/magic-boot-ui/src/icons/oper-log.svg b/magic-boot-ui/src/icons/oper-log.svg new file mode 100644 index 0000000..57a884c --- /dev/null +++ b/magic-boot-ui/src/icons/oper-log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/magic-boot-ui/src/layout/tabs.vue b/magic-boot-ui/src/layout/tabs.vue index 62860f2..83e770c 100644 --- a/magic-boot-ui/src/layout/tabs.vue +++ b/magic-boot-ui/src/layout/tabs.vue @@ -97,4 +97,4 @@ path: path }) } - \ No newline at end of file + diff --git a/magic-boot-ui/src/main.js b/magic-boot-ui/src/main.js index cff6b0b..7938870 100644 --- a/magic-boot-ui/src/main.js +++ b/magic-boot-ui/src/main.js @@ -23,7 +23,8 @@ import global from '@/scripts/global.js' document.title = global.title router.beforeEach((to, from) => { global.tabValue.value = to.path - if((to.name && global.visitedViews.length === 0 || global.visitedViews.every(it => it.path !== to.path)) && !to.path.startsWith('/redirect')){ + if((to.name && global.visitedViews.length === 0 || global.visitedViews.every(it => it.path !== to.path)) && !to.path.startsWith('/redirect') && !to.path.startsWith('/login')){ + console.log(to) global.visitedViews.push(to) } return true diff --git a/magic-boot-ui/src/scripts/request.js b/magic-boot-ui/src/scripts/request.js index 55a8b07..8ebf99d 100644 --- a/magic-boot-ui/src/scripts/request.js +++ b/magic-boot-ui/src/scripts/request.js @@ -54,29 +54,31 @@ service.interceptors.response.use( var duration = 5 if (res.code === 402) { duration = 1 - ElMessageBox.prompt(`当前账号:${global.user.info.username}凭证已过期,请输入密码重新登录`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '退出', - inputType: 'password', - closeOnClickModal: false, - beforeClose: (action, instance, done) => { - if (action === 'confirm') { - login({ - username: global.user.info.username, - password: instance.inputValue - }).then((res) => { - if (res) { - done() - service(response.config).then(ret => reslove(ret)) - } - }) - } else if (action === 'cancel') { - logout() - } else { - done() + if(global.user.info.username){ + ElMessageBox.prompt(`当前账号:${global.user.info.username}凭证已过期,请输入密码重新登录`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '退出', + inputType: 'password', + closeOnClickModal: false, + beforeClose: (action, instance, done) => { + if (action === 'confirm') { + login({ + username: global.user.info.username, + password: instance.inputValue + }).then((res) => { + if (res) { + done() + service(response.config).then(ret => reslove(ret)) + } + }) + } else if (action === 'cancel') { + logout() + } else { + done() + } } - } - }) + }) + } } if (res.code !== 402) { if(currentMessage){ diff --git a/magic-boot-ui/src/views/system/log/login-log.vue b/magic-boot-ui/src/views/system/log/login-log.vue new file mode 100644 index 0000000..8eadffb --- /dev/null +++ b/magic-boot-ui/src/views/system/log/login-log.vue @@ -0,0 +1,46 @@ + + + diff --git a/magic-boot-ui/src/views/system/log/oper-log.vue b/magic-boot-ui/src/views/system/log/oper-log.vue new file mode 100644 index 0000000..9d6436e --- /dev/null +++ b/magic-boot-ui/src/views/system/log/oper-log.vue @@ -0,0 +1,58 @@ + + + diff --git a/magic-boot-ui/src/views/system/menu/menu-form.vue b/magic-boot-ui/src/views/system/menu/menu-form.vue index cb456ff..09d088d 100644 --- a/magic-boot-ui/src/views/system/menu/menu-form.vue +++ b/magic-boot-ui/src/views/system/menu/menu-form.vue @@ -17,7 +17,7 @@ - + @@ -44,7 +44,7 @@ diff --git a/magic-boot-ui/src/views/system/user/user-form.vue b/magic-boot-ui/src/views/system/user/user-form.vue index c6939a9..dd85b9e 100644 --- a/magic-boot-ui/src/views/system/user/user-form.vue +++ b/magic-boot-ui/src/views/system/user/user-form.vue @@ -27,7 +27,7 @@ - + diff --git a/magic-boot/pom.xml b/magic-boot/pom.xml index 480ff43..75387a3 100644 --- a/magic-boot/pom.xml +++ b/magic-boot/pom.xml @@ -14,7 +14,7 @@ magic-boot 1.8 - 1.7.5 + 2.0.0-beta.2 1.2.1 5.7.13 1.26.0 diff --git a/magic-boot/src/main/java/org/ssssssss/magicboot/extension/NamedTableFunctionExtension.java b/magic-boot/src/main/java/org/ssssssss/magicboot/extension/NamedTableFunctionExtension.java index d233772..2d2de30 100644 --- a/magic-boot/src/main/java/org/ssssssss/magicboot/extension/NamedTableFunctionExtension.java +++ b/magic-boot/src/main/java/org/ssssssss/magicboot/extension/NamedTableFunctionExtension.java @@ -1,7 +1,7 @@ package org.ssssssss.magicboot.extension; import org.springframework.stereotype.Component; -import org.ssssssss.magicapi.modules.table.NamedTable; +import org.ssssssss.magicapi.modules.db.table.NamedTable; import org.ssssssss.magicboot.model.MagicBootConstants; import org.ssssssss.script.annotation.Comment; import org.ssssssss.script.functions.ExtensionMethod; diff --git a/magic-boot/src/main/java/org/ssssssss/magicboot/extension/ResponseFunctionExtension.java b/magic-boot/src/main/java/org/ssssssss/magicboot/extension/ResponseFunctionExtension.java index 31ceab9..fbbf370 100644 --- a/magic-boot/src/main/java/org/ssssssss/magicboot/extension/ResponseFunctionExtension.java +++ b/magic-boot/src/main/java/org/ssssssss/magicboot/extension/ResponseFunctionExtension.java @@ -4,10 +4,11 @@ import org.springframework.stereotype.Component; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; -import org.ssssssss.magicapi.context.RequestContext; -import org.ssssssss.magicapi.modules.ResponseModule; +import org.ssssssss.magicapi.core.context.RequestContext; +import org.ssssssss.magicapi.modules.servlet.ResponseModule; import org.ssssssss.script.annotation.Comment; import org.ssssssss.script.functions.ExtensionMethod; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -36,4 +37,4 @@ public class ResponseFunctionExtension implements ExtensionMethod { return responseModule.end(); } -} \ No newline at end of file +} diff --git a/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/NamedTableHandlerInterceptor.java b/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/NamedTableHandlerInterceptor.java index 36f2631..3365c57 100644 --- a/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/NamedTableHandlerInterceptor.java +++ b/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/NamedTableHandlerInterceptor.java @@ -3,13 +3,14 @@ package org.ssssssss.magicboot.interceptor; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.util.IdUtil; import org.springframework.stereotype.Component; -import org.ssssssss.magicapi.interceptor.NamedTableInterceptor; -import org.ssssssss.magicapi.model.SqlMode; -import org.ssssssss.magicapi.modules.table.NamedTable; -import static org.ssssssss.magicboot.model.MagicBootConstants.*; +import org.ssssssss.magicapi.modules.db.inteceptor.NamedTableInterceptor; +import org.ssssssss.magicapi.modules.db.model.SqlMode; +import org.ssssssss.magicapi.modules.db.table.NamedTable; import java.util.Date; +import static org.ssssssss.magicboot.model.MagicBootConstants.*; + @Component public class NamedTableHandlerInterceptor implements NamedTableInterceptor { diff --git a/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/PermissionInterceptor.java b/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/PermissionInterceptor.java index 7917fc1..7e3aa48 100644 --- a/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/PermissionInterceptor.java +++ b/magic-boot/src/main/java/org/ssssssss/magicboot/interceptor/PermissionInterceptor.java @@ -1,29 +1,42 @@ package org.ssssssss.magicboot.interceptor; import cn.dev33.satoken.stp.StpUtil; +import cn.hutool.extra.servlet.ServletUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Component; -import org.ssssssss.magicapi.interceptor.RequestInterceptor; -import org.ssssssss.magicapi.model.ApiInfo; -import org.ssssssss.magicapi.model.Options; -import org.ssssssss.magicapi.provider.MagicAPIService; +import org.springframework.web.servlet.HandlerInterceptor; +import org.ssssssss.magicapi.core.context.RequestEntity; +import org.ssssssss.magicapi.core.interceptor.RequestInterceptor; +import org.ssssssss.magicapi.core.model.ApiInfo; +import org.ssssssss.magicapi.core.model.Options; +import org.ssssssss.magicapi.core.service.MagicAPIService; +import org.ssssssss.magicapi.core.service.MagicResourceService; +import org.ssssssss.magicapi.utils.PathUtils; import org.ssssssss.magicboot.model.StatusCode; import org.ssssssss.script.MagicScriptContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.Date; import java.util.List; import java.util.Objects; @Component @Order(1) -public class PermissionInterceptor implements RequestInterceptor { +public class PermissionInterceptor implements RequestInterceptor, HandlerInterceptor { @Autowired MagicAPIService magicAPIService; + @Autowired + MagicResourceService magicResourceService; + + @Autowired + private JdbcTemplate template; + /* * 当返回对象时,直接将此对象返回到页面,返回null时,继续执行后续操作 */ @@ -46,4 +59,25 @@ public class PermissionInterceptor implements RequestInterceptor { return null; } + @Override + public Object postHandle(RequestEntity requestEntity, Object returnValue) throws Exception { + try { + HttpServletRequest request = requestEntity.getRequest(); + ApiInfo info = requestEntity.getApiInfo(); + template.update("insert into sys_oper_log(api_name, api_path, api_method, cost_time, create_by, create_date, user_agent, user_ip) values(?,?,?,?,?,?,?,?)", +// PathUtils.replaceSlash(groupServiceProvider.getFullName(info.getGroupId()) + "/" + info.getName()).replace("/","-"), + PathUtils.replaceSlash(String.format("/%s/%s", magicResourceService.getGroupName(info.getGroupId()), info.getName())), + request.getRequestURI(), + request.getMethod(), + System.currentTimeMillis() - requestEntity.getRequestTime(), + StpUtil.getLoginId(), + new Date(requestEntity.getRequestTime()), + request.getHeader("User-Agent"), + ServletUtil.getClientIP(request)); + } catch (Exception ignored){ + ignored.printStackTrace(); + } + return null; + } + } diff --git a/magic-boot/src/main/java/org/ssssssss/magicboot/model/StatusCode.java b/magic-boot/src/main/java/org/ssssssss/magicboot/model/StatusCode.java index c51ddf8..a36713c 100644 --- a/magic-boot/src/main/java/org/ssssssss/magicboot/model/StatusCode.java +++ b/magic-boot/src/main/java/org/ssssssss/magicboot/model/StatusCode.java @@ -1,6 +1,6 @@ package org.ssssssss.magicboot.model; -import org.ssssssss.magicapi.model.JsonBean; +import org.ssssssss.magicapi.core.model.JsonBean; public enum StatusCode { diff --git a/magic-boot/src/main/resources/application.yml b/magic-boot/src/main/resources/application.yml index 2154b66..615eb59 100644 --- a/magic-boot/src/main/resources/application.yml +++ b/magic-boot/src/main/resources/application.yml @@ -37,19 +37,19 @@ magic-api: web: /magic/web show-sql: true #配置打印SQL sql-column-case: camel - page-config: - page: current - size: size - cache-config: - enable: true #开启缓存,默认是不开启的 - ttl: 3600000 #有效期1小时,默认-1 即永不过期 resource: location: data/magic-api - response-code-config: + page: + page: current + size: size + cache: + enable: true #开启缓存,默认是不开启的 + ttl: 3600000 #有效期1小时,默认-1 即永不过期 + response-code: success: 200 #执行成功的code值 invalid: 400 #参数验证未通过的code值 exception: 500 #执行出现异常的code值 - crud-config: # CRUD相关配置 + crud: # CRUD相关配置 logic-delete-column: is_del #逻辑删除列 logic-delete-value: 1 #逻辑删除值 # security-config: