diff --git a/README.md b/README.md index 5c4f7f8..302ac81 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ * 本项目适合有一定NetCore和 vue基础的开发人员 * 基于.NET5/.NET6实现的通用权限管理平台(RBAC模式)。整合最新技术高效快速开发,前后端分离模式,开箱即用。 * 代码量少、学习简单、通俗易懂、功能强大、易扩展、轻量级,让web开发更快速、简单高效(从此告别996),解决70%的重复工作,专注您的业务,轻松开发从现在开始! -* 前端采用vue2.x/vue3.x、Element UI/Element-UI plus、vite。 +* 前端采用vue2.x/vue3.x、Element UI、vite。 * 后端采用Net5/Net6、Sqlsugar、MySQL等,可以自动分库分表。 * 权限认证使用Jwt,支持多终端认证系统。 * 支持加载动态权限菜单,多方式轻松权限控制 @@ -41,10 +41,10 @@ - [【Gitee】vue3地址](https://gitee.com/izory/ZRAdmin-vue) ## 🍁前端技术 -Vue版前端技术栈 :基于vue2.x/vue3.x、vuex、vue-router 、vue-cli 、axios 和 element-ui/element-ui-plus,前端采用vscode工具开发 +Vue版前端技术栈 :基于vue2.x/vue3.x、vuex、vue-router 、vue-cli 、axios 和 element-ui/element plus,前端采用vscode工具开发 ## 🍀后端技术 -核心框架:.Net5.0/.Net6 + Web API + sqlsugar + swagger + signalR + IpRateLimit +核心框架:.Net5.0/.Net6.0 + Web API + sqlsugar + swagger + signalR + IpRateLimit 定时计划任务:Quartz.Net组件,支持执行程序集或者http网络请求 @@ -52,7 +52,15 @@ Vue版前端技术栈 :基于vue2.x/vue3.x、vuex、vue-router 、vue-cli 、a 日志管理:NLog、登录日志、操作日志、定时任务日志 -工具类:验证码、丰富公共功能、代码生成 +工具类:验证码、丰富公共功能 + +接口限流:支持接口限流,避免恶意请求导致服务层压力过大 + +代码生成:高效率开发,代码生成器可以一键生成所有代码 + +数据字典:支持数据字典,可以方便对一些状态进行管理 + + ## 🍖内置功能 diff --git a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs index f38e17d..ba5a672 100644 --- a/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs +++ b/ZR.Admin.WebApi/Controllers/System/CodeGeneratorController.cs @@ -221,13 +221,15 @@ namespace ZR.Admin.WebApi.Controllers /// 预览代码 /// /// + /// /// [HttpPost("preview/{tableId}")] [ActionPermissionFilter(Permission = "tool:gen:preview")] - public IActionResult Preview(long tableId = 0) + public IActionResult Preview(long tableId = 0, int VueVersion = 0) { GenerateDto dto = new(); dto.TableId = tableId; + dto.VueVersion = VueVersion; if (dto == null || dto.TableId <= 0) { throw new CustomException(ResultCode.CUSTOM_ERROR, "请求参数为空"); diff --git a/ZR.Admin.WebApi/Controllers/System/SysMenuController.cs b/ZR.Admin.WebApi/Controllers/System/SysMenuController.cs index 3c432fe..c153739 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysMenuController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysMenuController.cs @@ -172,13 +172,19 @@ namespace ZR.Admin.WebApi.Controllers.System /// /// 保存排序 /// - /// + /// + /// /// [ActionPermissionFilter(Permission = "system:menu:update")] - [HttpPost("ChangeSort")] + [HttpGet("ChangeSort")] [Log(Title = "保存排序", BusinessType = BusinessType.UPDATE)] - public IActionResult ChangeSort([FromBody] MenuDto MenuDto) + public IActionResult ChangeSort(int id = 0, int value = 0) { + MenuDto MenuDto = new() + { + MenuId = id, + orderNum = value + }; if (MenuDto == null) { return ToResponse(ApiResult.Error(101, "请求参数错误")); } int result = sysMenuService.ChangeSortMenu(MenuDto); diff --git a/ZR.Admin.WebApi/Properties/launchSettings.json b/ZR.Admin.WebApi/Properties/launchSettings.json index c9bec37..9648cd9 100644 --- a/ZR.Admin.WebApi/Properties/launchSettings.json +++ b/ZR.Admin.WebApi/Properties/launchSettings.json @@ -16,7 +16,7 @@ "launchUrl": "swagger", "applicationUrl": "http://localhost:8888", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "" } } } diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/MySqlTemplate.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/MySqlTemplate.txt index c33b222..8531aaf 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/MySqlTemplate.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/MySqlTemplate.txt @@ -1,4 +1,6 @@ --- 菜单 +use ZrAdmin; + +-- 菜单 INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) VALUES ('${genTable.functionName}', ${parentId}, 999, '${genTable.BusinessName}', '${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName}', 0, 0, 'C', '0', '0', '${replaceDto.PermissionPrefix}:list', '', 'system', sysdate()); diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/SqlTemplate.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/SqlTemplate.txt index 1c9eeab..fe01bb2 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/SqlTemplate.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/SqlTemplate.txt @@ -1,4 +1,6 @@ --- ${genTable.functionName}菜单 +use ZrAdmin; + +-- ${genTable.functionName}菜单 INSERT INTO sys_menu(menuName, parentId, orderNum, path, component, isFrame, isCache, menuType, visible, status, perms, icon, create_by, create_time) VALUES ('${genTable.functionName}', ${parentId}, 999, '${genTable.BusinessName}', '${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName}', 0, 0, 'C', '0', '0', '${replaceDto.PermissionPrefix}:list', '', 'system', GETDATE()); diff --git a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt index 1528c3e..3748bb3 100644 --- a/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt +++ b/ZR.Admin.WebApi/wwwroot/CodeGenTemplate/TplTreeVue.txt @@ -1,4 +1,12 @@ -