├── .gitignore ├── LICENSE ├── README.md └── src ├── api ├── Application │ ├── Api.Console │ │ ├── Api.Console.csproj │ │ ├── Controllers │ │ │ ├── AccountController.cs │ │ │ ├── ApiBaseController.cs │ │ │ ├── HomeController.cs │ │ │ ├── SecurityController.cs │ │ │ └── Sys │ │ │ │ ├── MenuController.cs │ │ │ │ ├── MenuPermissionController.cs │ │ │ │ ├── OperationController.cs │ │ │ │ ├── OperationGroupController.cs │ │ │ │ ├── OperationPermissionController.cs │ │ │ │ ├── PermissionController.cs │ │ │ │ ├── PermissionGroupController.cs │ │ │ │ ├── RoleController.cs │ │ │ │ ├── RolePermissionController.cs │ │ │ │ ├── UserController.cs │ │ │ │ ├── UserPermissionController.cs │ │ │ │ └── UserRoleController.cs │ │ ├── Filters │ │ │ ├── ApiActionFilter.cs │ │ │ └── ApiExceptionFilter.cs │ │ ├── Model │ │ │ ├── PagingData.cs │ │ │ ├── Request │ │ │ │ └── LoginRequest.cs │ │ │ └── Response │ │ │ │ ├── GetLoginUserInfoResponse.cs │ │ │ │ ├── GetMenuConfigurationResponse.cs │ │ │ │ ├── GetOperationConfigurationResponse.cs │ │ │ │ ├── GetPermissionConfigurationResponse.cs │ │ │ │ ├── GetPublicKeyResponse.cs │ │ │ │ ├── GetRoleConfigurationResponse.cs │ │ │ │ ├── GetUserConfigurationResponse.cs │ │ │ │ └── LoginResponse.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Util │ │ │ ├── ApiConfig.cs │ │ │ └── Constants.cs │ │ ├── appsettings.Development.json │ │ └── appsettings.json │ ├── App.CodeBuilder │ │ ├── App.CodeBuilder.csproj │ │ ├── Program.cs │ │ └── build.bat │ └── App.EntityMigration │ │ ├── App.EntityMigration.csproj │ │ ├── MigrationContext.cs │ │ ├── appsettings.json │ │ └── build.bat ├── EZNEWApp.sln ├── Infrastructure │ └── AppConfig │ │ ├── AppConfig.csproj │ │ ├── DatabaseConfig.cs │ │ └── build.bat ├── Modules │ └── Sys │ │ ├── AppService │ │ ├── EZNEWApp.AppService.Sys │ │ │ ├── EZNEWApp.AppService.Sys.csproj │ │ │ ├── MenuAppService.cs │ │ │ ├── MenuPermissionAppService.cs │ │ │ ├── OperationAppService.cs │ │ │ ├── OperationGroupAppService.cs │ │ │ ├── OperationPermissionAppService.cs │ │ │ ├── PermissionAppService.cs │ │ │ ├── PermissionGroupAppService.cs │ │ │ ├── RoleAppService.cs │ │ │ ├── RolePermissionAppService.cs │ │ │ ├── UserAppService.cs │ │ │ ├── UserPermissionAppService.cs │ │ │ └── UserRoleAppService.cs │ │ └── EZNEWApp.AppServiceContract.Sys │ │ │ ├── EZNEWApp.AppServiceContract.Sys.csproj │ │ │ ├── IMenuAppService.cs │ │ │ ├── IMenuPermissionAppService.cs │ │ │ ├── IOperationAppService.cs │ │ │ ├── IOperationGroupAppService.cs │ │ │ ├── IOperationPermissionAppService.cs │ │ │ ├── IPermissionAppService.cs │ │ │ ├── IPermissionGroupAppService.cs │ │ │ ├── IRoleAppService.cs │ │ │ ├── IRolePermissionAppService.cs │ │ │ ├── IUserAppService.cs │ │ │ ├── IUserPermissionAppService.cs │ │ │ └── IUserRoleAppService.cs │ │ ├── Business │ │ ├── EZNEWApp.Business.Sys │ │ │ ├── EZNEWApp.Business.Sys.csproj │ │ │ ├── MenuBusiness.cs │ │ │ ├── MenuPermissionBusiness.cs │ │ │ ├── OperationBusiness.cs │ │ │ ├── OperationGroupBusiness.cs │ │ │ ├── OperationPermissionBusiness.cs │ │ │ ├── PermissionBusiness.cs │ │ │ ├── PermissionGroupBusiness.cs │ │ │ ├── RoleBusiness.cs │ │ │ ├── RolePermissionBusiness.cs │ │ │ ├── UserBusiness.cs │ │ │ ├── UserPermissionBusiness.cs │ │ │ └── UserRoleBusiness.cs │ │ └── EZNEWApp.BusinessContract.Sys │ │ │ ├── EZNEWApp.BusinessContract.Sys.csproj │ │ │ ├── IMenuBusiness.cs │ │ │ ├── IMenuPermissionBusiness.cs │ │ │ ├── IOperationBusiness.cs │ │ │ ├── IOperationGroupBusiness.cs │ │ │ ├── IOperationPermissionBusiness.cs │ │ │ ├── IPermissionBusiness.cs │ │ │ ├── IPermissionGroupBusiness.cs │ │ │ ├── IRoleBusiness.cs │ │ │ ├── IRolePermissionBusiness.cs │ │ │ ├── IUserBusiness.cs │ │ │ ├── IUserPermissionBusiness.cs │ │ │ └── IUserRoleBusiness.cs │ │ ├── Domain │ │ └── EZNEWApp.Domain.Sys │ │ │ ├── EZNEWApp.Domain.Sys.csproj │ │ │ ├── Model │ │ │ ├── Menu.cs │ │ │ ├── MenuPermission.cs │ │ │ ├── Operation.cs │ │ │ ├── OperationGroup.cs │ │ │ ├── OperationPermission.cs │ │ │ ├── Permission.cs │ │ │ ├── PermissionGroup.cs │ │ │ ├── Role.cs │ │ │ ├── RolePermission.cs │ │ │ ├── User.cs │ │ │ ├── UserPermission.cs │ │ │ └── UserRole.cs │ │ │ ├── Parameter │ │ │ ├── CheckAuthorizationParameter.cs │ │ │ ├── ExistOperationGroupNameParameter.cs │ │ │ ├── ExistPermissionCodeParameter.cs │ │ │ ├── ExistPermissionGroupNameParameter.cs │ │ │ ├── ExistPermissionNameParameter.cs │ │ │ ├── ExistRoleNameParameter.cs │ │ │ ├── ExistUserNameParameter.cs │ │ │ ├── Filter │ │ │ │ ├── MenuFilter.cs │ │ │ │ ├── OperationFilter.cs │ │ │ │ ├── OperationGroupFilter.cs │ │ │ │ ├── PermissionFilter.cs │ │ │ │ ├── PermissionGroupFilter.cs │ │ │ │ ├── RoleFilter.cs │ │ │ │ └── UserFilter.cs │ │ │ ├── InitializeOperationParameter.cs │ │ │ ├── LoginParameter.cs │ │ │ ├── ModifyMenuPermissionParameter.cs │ │ │ ├── ModifyOperationGroupSortParameter.cs │ │ │ ├── ModifyOperationPermissionParameter.cs │ │ │ ├── ModifyOperationStatusParameter.cs │ │ │ ├── ModifyPermissionGroupSortParameter.cs │ │ │ ├── ModifyPermissionStatusParameter.cs │ │ │ ├── ModifyRolePermissionParameter.cs │ │ │ ├── ModifyUserPasswordParameter.cs │ │ │ ├── ModifyUserPermissionParameter.cs │ │ │ ├── ModifyUserRoleParameter.cs │ │ │ ├── ModifyUserStatusParameter.cs │ │ │ ├── RemoveMenuParameter.cs │ │ │ ├── RemoveOperationGroupParameter.cs │ │ │ ├── RemoveOperationGroupPatameter.cs │ │ │ ├── RemoveOperationParameter.cs │ │ │ ├── RemovePermissionGroupParameter.cs │ │ │ ├── RemovePermissionParameter.cs │ │ │ ├── RemoveRoleParameter.cs │ │ │ ├── RemoveUserParameter.cs │ │ │ ├── SaveMenuParameter.cs │ │ │ ├── SaveOperationGroupParameter.cs │ │ │ ├── SaveOperationParameter.cs │ │ │ ├── SavePermissionGroupParameter.cs │ │ │ ├── SavePermissionParameter.cs │ │ │ ├── SaveRoleParameter.cs │ │ │ └── SaveUserParameter.cs │ │ │ └── Service │ │ │ ├── IMenuPermissionService.cs │ │ │ ├── IMenuService.cs │ │ │ ├── IOperationGroupService.cs │ │ │ ├── IOperationPermissionService.cs │ │ │ ├── IOperationService.cs │ │ │ ├── IPermissionGroupService.cs │ │ │ ├── IPermissionService.cs │ │ │ ├── IRolePermissionService.cs │ │ │ ├── IRoleService.cs │ │ │ ├── IUserPermissionService.cs │ │ │ ├── IUserRoleService.cs │ │ │ ├── IUserService.cs │ │ │ └── Impl │ │ │ ├── MenuPermissionService.cs │ │ │ ├── MenuService.cs │ │ │ ├── OperationGroupService.cs │ │ │ ├── OperationPermissionService.cs │ │ │ ├── OperationService.cs │ │ │ ├── PermissionGroupService.cs │ │ │ ├── PermissionService.cs │ │ │ ├── RolePermissionService.cs │ │ │ ├── RoleService.cs │ │ │ ├── UserPermissionService.cs │ │ │ ├── UserRoleService.cs │ │ │ └── UserService.cs │ │ └── Libraries │ │ ├── EZNEWApp.Module.Sys │ │ ├── EZNEWApp.Module.Sys.csproj │ │ ├── Enumeration.cs │ │ └── SysManager.cs │ │ └── EZNEWApp.ModuleConfig.Sys │ │ ├── DataConfiguration.cs │ │ ├── DependencyInjectionConfiguration.cs │ │ ├── DomainConfiguration.cs │ │ ├── EZNEWApp.ModuleConfig.Sys.csproj │ │ ├── ObjectMappingConfiguration.cs │ │ ├── QueryConfiguration.cs │ │ ├── RepositoryConfiguration.cs │ │ ├── SysModuleConfiguration.cs │ │ └── build.bat └── 使用说明.txt └── web ├── .browserslistrc ├── .dockerignore ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .stylelintrc.js ├── Dockerfile ├── LICENSE ├── babel.config.js ├── nginx.conf ├── nginx.default.conf ├── package.json ├── plopfile.js ├── prettier.config.js ├── public ├── favicon.ico ├── favicon_backup.ico ├── index.html └── static │ └── css │ └── loading.css ├── src ├── App.vue ├── api │ ├── colorfulIcon.js │ ├── publicKey.js │ ├── router.js │ └── sys │ │ ├── menu.js │ │ ├── menuPermission.js │ │ ├── operation.js │ │ ├── operationGroup.js │ │ ├── operationPermission.js │ │ ├── permission.js │ │ ├── permissionGroup.js │ │ ├── role.js │ │ ├── rolePermission.js │ │ ├── user.js │ │ ├── userPermission.js │ │ └── userRole.js ├── assets │ ├── error_images │ │ ├── 401.png │ │ ├── 404.png │ │ └── cloud.png │ ├── flogo1.png │ ├── login_images │ │ └── background.jpg │ └── qr_logo │ │ └── lqr_logo.png ├── colorfulIcon │ ├── index.js │ └── svg │ │ ├── alphabetical_sorting.svg │ │ └── vab.svg ├── components │ ├── EzPagination │ │ └── index.vue │ ├── SelectTree │ │ └── index.vue │ ├── VabCharge │ │ └── index.vue │ ├── VabProfile │ │ └── index.vue │ ├── VabSnow │ │ └── index.vue │ └── VabUpload │ │ └── index.vue ├── config │ ├── index.js │ ├── net.config.js │ ├── permission.js │ ├── setting.config.js │ ├── settings.js │ └── theme.config.js ├── layouts │ ├── EmptyLayout.vue │ ├── components │ │ ├── VabAppMain │ │ │ └── index.vue │ │ ├── VabAvatar │ │ │ └── index.vue │ │ ├── VabBreadcrumb │ │ │ └── index.vue │ │ ├── VabLogo │ │ │ └── index.vue │ │ ├── VabNavBar │ │ │ └── index.vue │ │ └── VabThemeBar │ │ │ └── index.vue │ ├── export.js │ └── index.vue ├── main.js ├── plugins │ ├── element.js │ ├── index.js │ ├── support.js │ ├── vabIcon.js │ ├── vabMagnifier.js │ ├── vabMarkdownEditor.js │ ├── vabPlayer.js │ ├── vabQuill.js │ └── vabVerify.js ├── remixIcon │ ├── index.js │ └── svg │ │ ├── qq-fill.svg │ │ └── vuejs-fill.svg ├── router │ └── index.js ├── store │ ├── index.js │ └── modules │ │ ├── errorLog.js │ │ ├── pageLoading.js │ │ ├── routes.js │ │ ├── settings.js │ │ ├── sys │ │ ├── menu.js │ │ ├── operation.js │ │ ├── permission.js │ │ ├── role.js │ │ └── user.js │ │ └── tabsBar.js ├── styles │ ├── element-variables.scss │ ├── loading.scss │ ├── normalize.scss │ ├── spinner │ │ ├── dots.css │ │ ├── gauge.css │ │ ├── inner-circles.css │ │ └── plus.css │ ├── themes │ │ └── default.scss │ ├── transition.scss │ ├── vab.scss │ └── variables.scss ├── utils │ ├── accessToken.js │ ├── clipboard.js │ ├── encrypt.js │ ├── errorLog.js │ ├── handleRoutes.js │ ├── index.js │ ├── pageStatus.js │ ├── pageTitle.js │ ├── paginationInfo.js │ ├── permission.js │ ├── request.js │ ├── static.js │ ├── vab.js │ └── validate.js └── views │ ├── 401.vue │ ├── 404.vue │ ├── index │ └── index.vue │ ├── login │ └── index.vue │ └── project │ └── sys │ ├── func │ ├── components │ │ ├── EditOperation.vue │ │ ├── EditOperationGroup.vue │ │ └── OperationPermission.vue │ └── index.vue │ ├── menu │ ├── components │ │ ├── EditMenu.vue │ │ ├── MenuPermission.vue │ │ └── SelectMenu.vue │ └── index.vue │ ├── permission │ ├── components │ │ ├── EditPermission.vue │ │ ├── EditPermissionGroup.vue │ │ └── PermissionMultiSelect.vue │ └── index.vue │ ├── role │ ├── components │ │ ├── EditRole.vue │ │ ├── RoleMultiSelect.vue │ │ ├── RolePermission.vue │ │ └── RoleUser.vue │ └── index.vue │ └── user │ ├── components │ ├── EditUser.vue │ ├── UserMultiSelect.vue │ ├── UserPermission.vue │ └── UserRole.vue │ └── index.vue ├── vue.config.js ├── webstorm.config.js └── 编译运行说明.txt /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 DingBin.Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | 3 | 示例应用 4 | 5 | # 快速开始 6 | 7 | 1. 下载安装 [.NetCore5.0 SDK](https://dotnet.microsoft.com/download/dotnet-core/5.0) 8 | 2. 下载安装 [Visual Studio 2019](https://visualstudio.microsoft.com/zh-hans/downloads/) 9 | 3. EZNEW备用Nuget包地址:http://nuget.eznew.net/v3/index.json 10 | 4. 下载项目:git clone https://github.com/eznew-net/Samples.git 11 | 5. 默认使用MySQL8+数据库,在/src/api/Application/Api.Console/appsettings.json中配置数据库连接 12 | 6. 创建数据库 13 | * [使用EF Migration创建数据库](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli) 14 | 15 | 1. 打开命令行工具cmd.exe 16 | 17 | 2. 安装ef工具:dotnet tool install --global dotnet-ef 18 | 19 | 3. 导航到路径 /src/api/Application/App.EntityMigration 并运行命令: dotnet ef migrations add init 20 | 21 | 4. 运行命令:dotnet ef database update 22 | 23 | 7. 编译运行 Api.Console 24 | 8. 导航到路径 src/web,运行命令 npm install cnpm -g --registry=https://registry.nlark.com 25 | 9. 运行命令 cnpm install 26 | 10. 运行命令 npm run serve 27 | 11. 使用默认用户名密码登录:admin and default Password:admin 28 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Api.Console.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | TargetFrameworkOverride 6 | true 7 | $(NoWarn);1591 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Controllers/ApiBaseController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using EZNEW.Web.Mvc; 8 | using Microsoft.AspNetCore.Http; 9 | using EZNEW.Model; 10 | 11 | // For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 12 | 13 | namespace Api.Console.Controllers 14 | { 15 | [Route("[controller]")] 16 | [ApiController] 17 | [Authorize] 18 | public class ApiBaseController : BaseController 19 | { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using EZNEW.Web.Security.Authorization; 6 | using Microsoft.AspNetCore.Authorization; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Hosting; 10 | 11 | // For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 12 | 13 | namespace Api.Console.Controllers 14 | { 15 | [AllowAnonymous] 16 | public class HomeController : Controller 17 | { 18 | IWebHostEnvironment env; 19 | 20 | public HomeController(IWebHostEnvironment env) 21 | { 22 | this.env = env; 23 | } 24 | 25 | /// 26 | /// 首页 27 | /// 28 | /// 29 | public IActionResult Index() 30 | { 31 | if (env.IsDevelopment()) 32 | { 33 | return Redirect("/swagger"); 34 | } 35 | return Redirect("/swagger"); 36 | //return Content("Hello,Api"); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Controllers/SecurityController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IdentityModel.Tokens.Jwt; 3 | using System.Security.Claims; 4 | using Microsoft.IdentityModel.Tokens; 5 | using Microsoft.AspNetCore.Authorization; 6 | using Microsoft.AspNetCore.Mvc; 7 | using EZNEW.Web.Security; 8 | using EZNEW.Model; 9 | using EZNEWApp.AppServiceContract.Sys; 10 | using EZNEW.Security.Cryptography; 11 | using EZNEW.Serialization; 12 | using EZNEWApp.Domain.Sys.Parameter; 13 | using Api.Console.Model.Request; 14 | using Api.Console.Model.Response; 15 | using Api.Console.Util; 16 | 17 | namespace Api.Console.Controllers 18 | { 19 | /// 20 | /// 安全管理 21 | /// 22 | [AllowAnonymous] 23 | public class SecurityController : ApiBaseController 24 | { 25 | IUserAppService _userAppService; 26 | public SecurityController(IUserAppService userAppService) 27 | { 28 | _userAppService = userAppService; 29 | } 30 | 31 | #region 获取公钥 32 | 33 | /// 34 | /// 获取公钥 35 | /// 36 | /// 37 | [HttpGet] 38 | [Route("publickey")] 39 | public Result GetPublicKey() 40 | { 41 | return Result.SuccessResult(new GetPublicKeyResponse() 42 | { 43 | PublicKey = Constants.RSA.PublicKey 44 | }); 45 | } 46 | 47 | #endregion 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Filters/ApiActionFilter.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.AspNetCore.Mvc.Filters; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace Api.Console.Filters 11 | { 12 | public class ApiActionFilter : IActionFilter, IResultFilter 13 | { 14 | public void OnActionExecuted(ActionExecutedContext context) 15 | { 16 | } 17 | 18 | public void OnActionExecuting(ActionExecutingContext context) 19 | { 20 | } 21 | 22 | public void OnResultExecuted(ResultExecutedContext context) 23 | { 24 | } 25 | 26 | public void OnResultExecuting(ResultExecutingContext context) 27 | { 28 | if (context.Result is ObjectResult objectResult && (objectResult.StatusCode == null || objectResult.StatusCode == StatusCodes.Status200OK)) 29 | { 30 | var resultValue = objectResult.Value; 31 | if (resultValue is not IResult) 32 | { 33 | context.Result = new JsonResult(Result.SuccessResult(data: resultValue)); 34 | } 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Filters/ApiExceptionFilter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.AspNetCore.Mvc.Filters; 4 | using EZNEW.Model; 5 | 6 | namespace Api.Console.Filters 7 | { 8 | /// 9 | /// Api exception filter 10 | /// 11 | public class ApiExceptionFilter : IExceptionFilter 12 | { 13 | public void OnException(ExceptionContext context) 14 | { 15 | context.Result = new JsonResult(Result.FailedResult(context.Exception)); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/PagingData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Api.Console.Model 7 | { 8 | public class PagingData 9 | { 10 | /// 11 | /// 获取或设置数据列表 12 | /// 13 | public IEnumerable List { get; set; } 14 | 15 | /// 16 | /// 获取或设置数据总量 17 | /// 18 | public long Total { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Request/LoginRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Api.Console.Model.Request 7 | { 8 | /// 9 | /// 定义登录信息 10 | /// 11 | public class LoginRequest 12 | { 13 | /// 14 | /// 登录名 15 | /// 16 | public string UserName { get; set; } 17 | 18 | /// 19 | /// 登录密码 20 | /// 21 | public string Password { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetLoginUserInfoResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Api.Console.Model.Response 7 | { 8 | /// 9 | /// 获取登录用户信息 10 | /// 11 | public class GetLoginUserInfoResponse 12 | { 13 | /// 14 | /// 用户角色 15 | /// 16 | public List Roles { get; set; } 17 | 18 | /// 19 | /// 用户权限 20 | /// 21 | public List Permissions { get; set; } 22 | 23 | /// 24 | /// 获取或设置用户名 25 | /// 26 | public string UserName { get; set; } 27 | 28 | /// 29 | /// 头像 30 | /// 31 | public string Avatar { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetMenuConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EZNEW.Model; 3 | 4 | namespace Api.Console.Model.Response 5 | { 6 | /// 7 | /// 获取菜单配置响应参数 8 | /// 9 | public class GetMenuConfigurationResponse 10 | { 11 | /// 12 | /// 菜单状态 13 | /// 14 | 15 | public KeyValueCollection StatusCollection { get; set; } 16 | 17 | 18 | /// 19 | /// 菜单用途 20 | /// 21 | public KeyValueCollection UsageCollection { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetOperationConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | 3 | namespace Api.Console.Model.Response 4 | { 5 | /// 6 | /// 功能操作配置信息 7 | /// 8 | public class GetOperationConfigurationResponse 9 | { 10 | /// 11 | /// 功能操作状态 12 | /// 13 | public KeyValueCollection StatusCollection { get; set; } 14 | 15 | /// 16 | /// 功能操作访问级别 17 | /// 18 | public KeyValueCollection AccessLevelCollection { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetPermissionConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | 3 | namespace Api.Console.Model.Response 4 | { 5 | /// 6 | /// 权限配置信息 7 | /// 8 | public class GetPermissionConfigurationResponse 9 | { 10 | /// 11 | /// 权限状态信息 12 | /// 13 | public KeyValueCollection StatusCollection { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetPublicKeyResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Api.Console.Model.Response 7 | { 8 | /// 9 | /// 获取公钥响应信息 10 | /// 11 | public class GetPublicKeyResponse 12 | { 13 | /// 14 | /// 获取或设置公钥值 15 | /// 16 | public string PublicKey { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetRoleConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | 3 | namespace Api.Console.Model.Response 4 | { 5 | /// 6 | /// 角色配置 7 | /// 8 | public class GetRoleConfigurationResponse 9 | { 10 | /// 11 | /// 角色状态 12 | /// 13 | public KeyValueCollection StatusCollection { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/GetUserConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | 3 | namespace Api.Console.Model.Response 4 | { 5 | /// 6 | /// 用户配置 7 | /// 8 | public class GetUserConfigurationResponse 9 | { 10 | /// 11 | /// 用户状态 12 | /// 13 | public KeyValueCollection StatusCollection { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Model/Response/LoginResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Api.Console.Model.Response 7 | { 8 | /// 9 | /// 登录响应信息 10 | /// 11 | public class LoginResponse 12 | { 13 | /// 14 | /// 获取或设置登录Token 15 | /// 16 | public string Token { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using EZNEW.DependencyInjection; 7 | using Microsoft.AspNetCore; 8 | using Microsoft.AspNetCore.Hosting; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.Hosting; 11 | using Microsoft.Extensions.Logging; 12 | 13 | namespace Api.Console 14 | { 15 | public class Program 16 | { 17 | public static void Main(string[] args) 18 | { 19 | CreateHostBuilder(args).Build().Run(); 20 | } 21 | 22 | public static IHostBuilder CreateHostBuilder(string[] args) => 23 | Host.CreateDefaultBuilder(args) 24 | .ConfigureWebHostDefaults(webBuilder => 25 | { 26 | webBuilder.UseStartup(); 27 | }) 28 | .UseServiceProviderFactory(new DefaultServiceProviderFactory()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Api.Console": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "applicationUrl": "http://localhost:5000", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/Util/ApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using AppConfig; 6 | using EZNEW.Application; 7 | using EZNEW.DataValidation; 8 | 9 | namespace Api.Console.Util 10 | { 11 | public static class ApiConfig 12 | { 13 | public static void Init() 14 | { 15 | //数据库配置 16 | DatabaseConfig.Configure(); 17 | //数据验证配置 18 | ConfigureDataValidation(); 19 | } 20 | 21 | /// 22 | /// 配置数据验证 23 | /// 24 | static void ConfigureDataValidation() 25 | { 26 | ValidationManager.ConfigureByConfigFile(ApplicationManager.RootPath); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information", 7 | "EZNEW": "Debug" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/api/Application/Api.Console/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "" 4 | } 5 | } -------------------------------------------------------------------------------- /src/api/Application/App.CodeBuilder/App.CodeBuilder.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net5.0 6 | TargetFrameworkOverride 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/api/Application/App.CodeBuilder/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using EZNEW.CodeBuilder; 3 | 4 | namespace App.CodeBuilder 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | //解决方案名称 11 | CodeBuilderManager.SolutionName = "EZNEWApp"; 12 | //根命名空间 13 | CodeBuilderManager.RootNamespace = "EZNEWApp"; 14 | //.NET版本 15 | CodeBuilderManager.NetVersion = "net5.0"; 16 | //项目结构 17 | CodeBuilderManager.DefaultProjectStructure = CodeBuild.ProjectStructure.简化模式; 18 | CodeBuilderManager.Run(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/api/Application/App.CodeBuilder/build.bat: -------------------------------------------------------------------------------- 1 | set builderPath=%cd%\App.CodeBuilder.csproj 2 | cd ../../ 3 | set topPath=%cd% 4 | 5 | cd Modules 6 | set modulePath=%cd% 7 | for /f "delims=" %%i in ('dir /ad /b "%modulePath%"') do ( 8 | cd %%i\Libraries 9 | for /f "delims=" %%c in ('dir /ad /b "*.ModuleConfig.*"') do ( 10 | dotnet add %builderPath% reference "%modulePath%\%%i\Libraries\%%c\%%c.csproj" 11 | ) 12 | cd %modulePath% 13 | ) -------------------------------------------------------------------------------- /src/api/Application/App.EntityMigration/App.EntityMigration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | TargetFrameworkOverride 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/api/Application/App.EntityMigration/MigrationContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using Microsoft.EntityFrameworkCore; 4 | using EZNEWApp.Module.Sys; 5 | using EZNEW.Data; 6 | using EZNEW.EntityMigration; 7 | using EZNEW.Configuration; 8 | using EZNEWApp.Domain.Sys.Model; 9 | 10 | namespace App.EntityMigration 11 | { 12 | public class MigrationContext : EntityMigrationContext 13 | { 14 | protected override void Configure(DbContextOptionsBuilder optionsBuilder) 15 | { 16 | _ = DatabaseServer.ServerType switch 17 | { 18 | DatabaseServerType.SQLServer => optionsBuilder.UseSqlServer(DatabaseServer.ConnectionString), 19 | DatabaseServerType.Oracle => optionsBuilder.UseOracle(DatabaseServer.ConnectionString), 20 | DatabaseServerType.MySQL => optionsBuilder.UseMySQL(DatabaseServer.ConnectionString), 21 | DatabaseServerType.SQLite => optionsBuilder.UseSqlite(DatabaseServer.ConnectionString), 22 | DatabaseServerType.PostgreSQL => optionsBuilder.UseNpgsql(DatabaseServer.ConnectionString), 23 | _ => null 24 | }; 25 | } 26 | 27 | protected override DatabaseServer GetDatabaseServer() 28 | { 29 | return new DatabaseServer() 30 | { 31 | ServerType = DatabaseServerType.MySQL, 32 | ConnectionString = ConfigurationManager.GetConnectionString("DefaultConnection") 33 | }; 34 | } 35 | 36 | protected override void OnModelCreating(ModelBuilder modelBuilder) 37 | { 38 | base.OnModelCreating(modelBuilder); 39 | //add default data 40 | modelBuilder.Entity().HasData(new User() 41 | { 42 | Id = DateTime.Now.Ticks, 43 | UserName = "admin", 44 | RealName = "EZNEW.NET", 45 | Password = "21232f297a57a5a743894a0e4a801fc3",//admin 46 | UserType = UserType.Management, 47 | Status = UserStatus.Enable, 48 | CreationTime = DateTimeOffset.Now, 49 | UpdateTime=DateTimeOffset.Now, 50 | Email = "admin@eznew.net", 51 | Mobile = "13600000000", 52 | QQ = "123456", 53 | SuperUser = true 54 | }); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/api/Application/App.EntityMigration/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionStrings": { 3 | "DefaultConnection": "" 4 | } 5 | } -------------------------------------------------------------------------------- /src/api/Application/App.EntityMigration/build.bat: -------------------------------------------------------------------------------- 1 | set currentPath=%cd% 2 | set entityMigrationPath=%cd%\App.EntityMigration.csproj 3 | cd ../ 4 | set appRootPath=%cd% 5 | cd ../ 6 | set topPath=%cd% 7 | 8 | cd Modules 9 | set modulePath=%cd% 10 | for /f "delims=" %%i in ('dir /ad /b "%modulePath%"') do ( 11 | cd %%i\Libraries 12 | for /f "delims=" %%c in ('dir /ad /b "*.ModuleConfig.*"') do ( 13 | dotnet add %entityMigrationPath% reference "%modulePath%\%%i\Libraries\%%c\%%c.csproj" 14 | ) 15 | cd %modulePath% 16 | ) 17 | cd %currentPath% 18 | copy ..\Api.Console\appsettings.json .\appsettings.json -------------------------------------------------------------------------------- /src/api/Infrastructure/AppConfig/AppConfig.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | TargetFrameworkOverride 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/api/Infrastructure/AppConfig/DatabaseConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Configuration; 5 | using EZNEW.Data; 6 | using EZNEW.Data.MySQL; 7 | 8 | namespace AppConfig 9 | { 10 | /// 11 | /// 数据库配置 12 | /// 13 | public static class DatabaseConfig 14 | { 15 | public static void Configure() 16 | { 17 | //配置数据库执行器 18 | ConfigureDatabaseProvider(); 19 | //配置数据库服务器 20 | ConfigureDatabaseServer(); 21 | } 22 | 23 | /// 24 | /// 配置数据库执行器 25 | /// 26 | static void ConfigureDatabaseProvider() 27 | { 28 | DataManager.ConfigureDatabaseProvider(DatabaseServerType.MySQL, new MySqlProvider()); 29 | } 30 | 31 | /// 32 | /// 配置数据库服务器 33 | /// 34 | static void ConfigureDatabaseServer() 35 | { 36 | DataManager.ConfigureDatabaseServer(command => 37 | { 38 | return new List 39 | { 40 | new DatabaseServer() 41 | { 42 | ServerType = DatabaseServerType.MySQL, 43 | ConnectionString = ConfigurationManager.GetConnectionString("DefaultConnection") 44 | } 45 | }; 46 | }); 47 | 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/api/Infrastructure/AppConfig/build.bat: -------------------------------------------------------------------------------- 1 | set iocPath=%cd%\AppConfig.csproj 2 | cd ../../ 3 | set topPath=%cd% 4 | 5 | cd Modules 6 | set modulePath=%cd% 7 | for /f "delims=" %%i in ('dir /ad /b "%modulePath%"') do ( 8 | cd %%i\Libraries 9 | for /f "delims=" %%c in ('dir /ad /b "*.ModuleConfig.*"') do ( 10 | dotnet add %iocPath% reference "%modulePath%\%%i\Libraries\%%c\%%c.csproj" 11 | ) 12 | cd %modulePath% 13 | ) -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/EZNEWApp.AppService.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/MenuPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.AppServiceContract.Sys; 6 | using EZNEWApp.BusinessContract.Sys; 7 | using EZNEWApp.Domain.Sys.Parameter; 8 | 9 | namespace EZNEWApp.AppService.Sys 10 | { 11 | public class MenuPermissionAppService : IMenuPermissionAppService 12 | { 13 | IMenuPermissionBusiness menuPermissionBusiness; 14 | 15 | public MenuPermissionAppService(IMenuPermissionBusiness menuPermissionBusiness) 16 | { 17 | this.menuPermissionBusiness = menuPermissionBusiness; 18 | } 19 | 20 | #region 清除菜单的所有权限 21 | 22 | /// 23 | /// 清除菜单的所有权限 24 | /// 25 | /// 菜单系统编号 26 | /// 执行结果 27 | public Result ClearByMenu(IEnumerable menuIds) 28 | { 29 | return menuPermissionBusiness.ClearByMenu(menuIds); 30 | } 31 | 32 | #endregion 33 | 34 | #region 清除权限的所有菜单 35 | 36 | /// 37 | /// 清除权限的所有菜单 38 | /// 39 | /// 权限系统编号 40 | /// 执行结果 41 | public Result ClearByPermission(IEnumerable permissionIds) 42 | { 43 | return menuPermissionBusiness.ClearByPermission(permissionIds); 44 | } 45 | 46 | #endregion 47 | 48 | #region 修改菜单&权限 49 | 50 | /// 51 | /// 修改菜单&权限 52 | /// 53 | /// 菜单&权限修改参数 54 | /// 返回操作结果 55 | public Result Modify(ModifyMenuPermissionParameter modifyMenuPermissionParameter) 56 | { 57 | return menuPermissionBusiness.Modify(modifyMenuPermissionParameter); 58 | } 59 | 60 | #endregion 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/OperationPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using EZNEWApp.AppServiceContract.Sys; 3 | using EZNEWApp.BusinessContract.Sys; 4 | using EZNEWApp.Domain.Sys.Parameter; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace EZNEWApp.AppService.Sys 10 | { 11 | public class OperationPermissionAppService : IOperationPermissionAppService 12 | { 13 | IOperationPermissionBusiness operationPermissionBusiness; 14 | 15 | public OperationPermissionAppService(IOperationPermissionBusiness operationPermissionBusiness) 16 | { 17 | this.operationPermissionBusiness = operationPermissionBusiness; 18 | } 19 | 20 | #region 修改权限&操作授权 21 | 22 | /// 23 | /// 修改权限&操作绑定 24 | /// 25 | /// 权限操作修改信息 26 | /// 返回执行结果 27 | public Result Modify(ModifyOperationPermissionParameter modifyOperationPermissionParameter) 28 | { 29 | return operationPermissionBusiness.Modify(modifyOperationPermissionParameter); 30 | } 31 | 32 | #endregion 33 | 34 | #region 清除权限绑定的所有操作 35 | 36 | /// 37 | /// 清除权限绑定的所有操作 38 | /// 39 | /// 权限编号 40 | /// 返回执行结果 41 | public Result ClearByPermission(IEnumerable permissionIds) 42 | { 43 | return operationPermissionBusiness.ClearByPermission(permissionIds); 44 | } 45 | 46 | #endregion 47 | 48 | #region 清除操作功能授权的所有权限 49 | 50 | /// 51 | /// 清除操作功能授权的所有权限 52 | /// 53 | /// 操作编号 54 | /// 返回执行结果 55 | public Result ClearByOperation(IEnumerable operationIds) 56 | { 57 | return operationPermissionBusiness.ClearByOperation(operationIds); 58 | } 59 | 60 | #endregion 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/RolePermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.AppServiceContract.Sys; 5 | using EZNEW.DependencyInjection; 6 | using EZNEW.Development.UnitOfWork; 7 | using EZNEWApp.Domain.Sys.Parameter; 8 | using EZNEWApp.Domain.Sys.Service; 9 | using EZNEW.Model; 10 | using EZNEWApp.BusinessContract.Sys; 11 | 12 | namespace EZNEWApp.AppService.Sys 13 | { 14 | /// 15 | /// 角色授权业务逻辑 16 | /// 17 | public class RolePermissionAppService : IRolePermissionAppService 18 | { 19 | IRolePermissionBusiness rolePermissionBusiness; 20 | 21 | public RolePermissionAppService(IRolePermissionBusiness rolePermissionBusiness) 22 | { 23 | this.rolePermissionBusiness = rolePermissionBusiness; 24 | } 25 | 26 | #region 根据角色清空角色授权信息 27 | 28 | /// 29 | /// 根据角色清空角色授权信息 30 | /// 31 | /// 角色系统编号 32 | /// 返回执行结果 33 | public Result ClearByRole(IEnumerable roleIds) 34 | { 35 | return rolePermissionBusiness.ClearByRole(roleIds); 36 | } 37 | 38 | #endregion 39 | 40 | #region 根据权限清空角色授权信息 41 | 42 | /// 43 | /// 根据权限清空角色授权信息 44 | /// 45 | /// 权限系统编号 46 | /// 返回执行结果 47 | public Result ClearByPermission(IEnumerable permissionIds) 48 | { 49 | return rolePermissionBusiness.ClearByPermission(permissionIds); 50 | } 51 | 52 | #endregion 53 | 54 | #region 修改角色授权 55 | 56 | /// 57 | /// 修改角色授权 58 | /// 59 | /// 角色授权修改信息 60 | /// 返回执行结果 61 | public Result Modify(ModifyRolePermissionParameter modifyRolePermissionParameter) 62 | { 63 | return rolePermissionBusiness.Modify(modifyRolePermissionParameter); 64 | } 65 | 66 | #endregion 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/UserPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.AppServiceContract.Sys; 5 | using EZNEW.DependencyInjection; 6 | using EZNEW.Development.UnitOfWork; 7 | using EZNEWApp.Domain.Sys.Parameter; 8 | using EZNEWApp.Domain.Sys.Service; 9 | using EZNEW.Model; 10 | using EZNEWApp.BusinessContract.Sys; 11 | 12 | namespace EZNEWApp.AppService.Sys 13 | { 14 | /// 15 | /// 用户授权业务逻辑 16 | /// 17 | public class UserPermissionAppService : IUserPermissionAppService 18 | { 19 | IUserPermissionBusiness userPermissionBusiness; 20 | 21 | public UserPermissionAppService(IUserPermissionBusiness userPermissionBusiness) 22 | { 23 | this.userPermissionBusiness = userPermissionBusiness; 24 | } 25 | 26 | #region 修改用户授权 27 | 28 | /// 29 | /// 修改用户授权 30 | /// 31 | /// 用户授权修改信息 32 | /// 返回执行结果 33 | public Result Modify(ModifyUserPermissionParameter modifyUserPermissionParameter) 34 | { 35 | return userPermissionBusiness.Modify(modifyUserPermissionParameter); 36 | } 37 | 38 | #endregion 39 | 40 | #region 根据用户清除用户授权信息 41 | 42 | /// 43 | /// 根据用户清除用户授权信息 44 | /// 45 | /// 用户系统编号 46 | /// 返回执行结果 47 | public Result ClearByUser(IEnumerable userIds) 48 | { 49 | return userPermissionBusiness.ClearByUser(userIds); 50 | } 51 | 52 | #endregion 53 | 54 | #region 根据权限清除用户授权信息 55 | 56 | /// 57 | /// 根据权限清除用户授权信息 58 | /// 59 | /// 权限系统编号 60 | /// 返回执行结果 61 | public Result ClearByPermission(IEnumerable permissionIds) 62 | { 63 | return userPermissionBusiness.ClearByPermission(permissionIds); 64 | } 65 | 66 | #endregion 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppService.Sys/UserRoleAppService.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using EZNEWApp.AppServiceContract.Sys; 3 | using EZNEWApp.BusinessContract.Sys; 4 | using EZNEWApp.Domain.Sys.Parameter; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Text; 8 | 9 | namespace EZNEWApp.AppService.Sys 10 | { 11 | /// 12 | /// 用户&角色应用服务实现 13 | /// 14 | public class UserRoleAppService: IUserRoleAppService 15 | { 16 | readonly IUserRoleBusiness userRoleBusiness; 17 | 18 | public UserRoleAppService(IUserRoleBusiness userRoleBusiness) 19 | { 20 | this.userRoleBusiness = userRoleBusiness; 21 | } 22 | 23 | #region 清除角色下所有的用户 24 | 25 | /// 26 | /// 清除角色下所有的用户 27 | /// 28 | /// 角色系统编号 29 | /// 执行结果 30 | public Result ClearByRole(IEnumerable roleIds) 31 | { 32 | return userRoleBusiness.ClearByRole(roleIds); 33 | } 34 | 35 | #endregion 36 | 37 | #region 清除用户绑定的所有角色 38 | 39 | /// 40 | /// 清除用户绑定的所有角色 41 | /// 42 | /// 用户系统编号 43 | /// 执行结果 44 | public Result ClearByUser(IEnumerable userIds) 45 | { 46 | return userRoleBusiness.ClearByUser(userIds); 47 | } 48 | 49 | #endregion 50 | 51 | #region 修改用户&角色绑定关系 52 | 53 | /// 54 | /// 修改用户&角色绑定关系 55 | /// 56 | /// 用户&角色修绑定关系修改信息 57 | /// 返回操作结果 58 | public Result Modify(ModifyUserRoleParameter modifyUserRoleParameter) 59 | { 60 | return userRoleBusiness.Modify(modifyUserRoleParameter); 61 | } 62 | 63 | #endregion 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/EZNEWApp.AppServiceContract.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/IMenuPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using EZNEWApp.Domain.Sys.Parameter; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace EZNEWApp.AppServiceContract.Sys 8 | { 9 | public interface IMenuPermissionAppService 10 | { 11 | #region 清除菜单的所有权限 12 | 13 | /// 14 | /// 清除菜单的所有权限 15 | /// 16 | /// 菜单系统编号 17 | /// 执行结果 18 | Result ClearByMenu(IEnumerable menuIds); 19 | 20 | #endregion 21 | 22 | #region 清除权限的所有菜单 23 | 24 | /// 25 | /// 清除权限的所有菜单 26 | /// 27 | /// 权限系统编号 28 | /// 执行结果 29 | Result ClearByPermission(IEnumerable permissionIds); 30 | 31 | #endregion 32 | 33 | #region 修改菜单&权限 34 | 35 | /// 36 | /// 修改菜单&权限 37 | /// 38 | /// 菜单&权限修改参数 39 | /// 返回操作结果 40 | Result Modify(ModifyMenuPermissionParameter modifyMenuPermissionParameter); 41 | 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/IOperationPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.AppServiceContract.Sys 8 | { 9 | /// 10 | /// 操作&权限应用服务 11 | /// 12 | public interface IOperationPermissionAppService 13 | { 14 | #region 修改权限&操作授权 15 | 16 | /// 17 | /// 修改权限&操作绑定 18 | /// 19 | /// 权限操作修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyOperationPermissionParameter modifyOperationPermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 清除权限绑定的所有操作 26 | 27 | /// 28 | /// 清除权限绑定的所有操作 29 | /// 30 | /// 权限编号 31 | /// 返回执行结果 32 | Result ClearByPermission(IEnumerable permissionIds); 33 | 34 | #endregion 35 | 36 | #region 清除操作功能授权的所有权限 37 | 38 | /// 39 | /// 清除操作功能授权的所有权限 40 | /// 41 | /// 操作编号 42 | /// 返回执行结果 43 | Result ClearByOperation(IEnumerable operationIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/IRolePermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.AppServiceContract.Sys 8 | { 9 | /// 10 | /// 角色授权业务逻辑 11 | /// 12 | public interface IRolePermissionAppService 13 | { 14 | #region 修改角色授权 15 | 16 | /// 17 | /// 修改角色授权 18 | /// 19 | /// 角色授权修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyRolePermissionParameter modifyRolePermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 根据角色清空角色授权信息 26 | 27 | /// 28 | /// 根据角色清空角色授权信息 29 | /// 30 | /// 角色系统编号 31 | /// 返回执行结果 32 | Result ClearByRole(IEnumerable roleIds); 33 | 34 | #endregion 35 | 36 | #region 根据权限清空角色授权信息 37 | 38 | /// 39 | /// 根据权限清空角色授权信息 40 | /// 41 | /// 权限系统编号 42 | /// 返回执行结果 43 | Result ClearByPermission(IEnumerable permissionIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/IUserPermissionAppService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.AppServiceContract.Sys 8 | { 9 | /// 10 | /// 用户授权业务逻辑 11 | /// 12 | public interface IUserPermissionAppService 13 | { 14 | #region 修改用户授权 15 | 16 | /// 17 | /// 修改用户授权 18 | /// 19 | /// 用户授权修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyUserPermissionParameter modifyUserPermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 根据用户清除用户授权信息 26 | 27 | /// 28 | /// 根据用户清除用户授权信息 29 | /// 30 | /// 用户系统编号 31 | /// 返回执行结果 32 | Result ClearByUser(IEnumerable userIds); 33 | 34 | #endregion 35 | 36 | #region 根据权限清除用户授权信息 37 | 38 | /// 39 | /// 根据权限清除用户授权信息 40 | /// 41 | /// 权限系统编号 42 | /// 返回执行结果 43 | Result ClearByPermission(IEnumerable permissionIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/AppService/EZNEWApp.AppServiceContract.Sys/IUserRoleAppService.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using EZNEWApp.Domain.Sys.Parameter; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace EZNEWApp.AppServiceContract.Sys 8 | { 9 | /// 10 | /// 用户&角色应用程序服务 11 | /// 12 | public interface IUserRoleAppService 13 | { 14 | #region 清除角色下所有的用户 15 | 16 | /// 17 | /// 清除角色下所有的用户 18 | /// 19 | /// 角色系统编号 20 | /// 执行结果 21 | Result ClearByRole(IEnumerable roleIds); 22 | 23 | #endregion 24 | 25 | #region 清除用户绑定的所有角色 26 | 27 | /// 28 | /// 清除用户绑定的所有角色 29 | /// 30 | /// 用户系统编号 31 | /// 执行结果 32 | Result ClearByUser(IEnumerable userIds); 33 | 34 | #endregion 35 | 36 | #region 修改用户&角色绑定关系 37 | 38 | /// 39 | /// 修改用户&角色绑定关系 40 | /// 41 | /// 用户&角色修绑定关系修改信息 42 | /// 返回操作结果 43 | Result Modify(ModifyUserRoleParameter modifyUserRoleParameter); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.Business.Sys/EZNEWApp.Business.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/EZNEWApp.BusinessContract.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IMenuPermissionBusiness.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.BusinessContract.Sys 8 | { 9 | public interface IMenuPermissionBusiness 10 | { 11 | #region 清除菜单的所有权限 12 | 13 | /// 14 | /// 清除菜单的所有权限 15 | /// 16 | /// 菜单系统编号 17 | /// 执行结果 18 | Result ClearByMenu(IEnumerable menuIds); 19 | 20 | #endregion 21 | 22 | #region 清除权限的所有菜单 23 | 24 | /// 25 | /// 清除权限的所有菜单 26 | /// 27 | /// 权限系统编号 28 | /// 执行结果 29 | Result ClearByPermission(IEnumerable permissionIds); 30 | 31 | #endregion 32 | 33 | #region 修改菜单&权限 34 | 35 | /// 36 | /// 修改菜单&权限 37 | /// 38 | /// 菜单&权限修改参数 39 | /// 返回操作结果 40 | Result Modify(ModifyMenuPermissionParameter modifyMenuPermissionParameter); 41 | 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IOperationPermissionBusiness.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.BusinessContract.Sys 8 | { 9 | /// 10 | /// 功能操作&权限接口 11 | /// 12 | public interface IOperationPermissionBusiness 13 | { 14 | #region 修改权限&操作授权 15 | 16 | /// 17 | /// 修改权限&操作绑定 18 | /// 19 | /// 权限操作修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyOperationPermissionParameter modifyOperationPermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 清除权限绑定的所有操作 26 | 27 | /// 28 | /// 清除权限绑定的所有操作 29 | /// 30 | /// 权限编号 31 | /// 返回执行结果 32 | Result ClearByPermission(IEnumerable permissionIds); 33 | 34 | #endregion 35 | 36 | #region 清除操作功能授权的所有权限 37 | 38 | /// 39 | /// 清除操作功能授权的所有权限 40 | /// 41 | /// 操作编号 42 | /// 返回执行结果 43 | Result ClearByOperation(IEnumerable operationIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IRoleBusiness.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EZNEW.Model; 3 | using EZNEW.Paging; 4 | using EZNEWApp.Domain.Sys.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | using EZNEWApp.Domain.Sys.Parameter.Filter; 7 | 8 | namespace EZNEWApp.BusinessContract.Sys 9 | { 10 | /// 11 | /// 角色业务接口 12 | /// 13 | public interface IRoleBusiness 14 | { 15 | #region 保存角色 16 | 17 | /// 18 | /// 保存角色 19 | /// 20 | /// 角色保存信息 21 | /// 22 | Result SaveRole(SaveRoleParameter saveRoleParameter); 23 | 24 | #endregion 25 | 26 | #region 获取角色 27 | 28 | /// 29 | /// 获取角色 30 | /// 31 | /// 角色筛选信息 32 | /// 返回角色信息 33 | Role GetRole(RoleFilter roleFilter); 34 | 35 | #endregion 36 | 37 | #region 删除角色 38 | 39 | /// 40 | /// 删除角色 41 | /// 42 | /// 角色删除信息 43 | /// 返回删除角色执行结果 44 | Result RemoveRole(RemoveRoleParameter deleteRoleParameter); 45 | 46 | #endregion 47 | 48 | #region 获取角色列表 49 | 50 | /// 51 | /// 获取角色列表 52 | /// 53 | /// 角色筛选信息 54 | /// 返回角色列表 55 | List GetRoleList(RoleFilter roleFilter); 56 | 57 | #endregion 58 | 59 | #region 获取角色分页 60 | 61 | /// 62 | /// 获取角色分页 63 | /// 64 | /// 角色筛选信息 65 | /// 返回角色分页 66 | PagingInfo GetRolePaging(RoleFilter roleFilter); 67 | 68 | #endregion 69 | 70 | #region 验证角色名称是否存在 71 | 72 | /// 73 | /// 验证角色名称是否存在 74 | /// 75 | /// 角色名称验证信息 76 | /// 返回角色名称是否存在 77 | bool ExistRoleName(ExistRoleNameParameter existRoleNameParameter); 78 | 79 | #endregion 80 | 81 | #region 清除角色下所有的用户 82 | 83 | /// 84 | /// 清除角色下所有的用户 85 | /// 86 | /// 角色编号 87 | /// 返回执行结果 88 | Result ClearUser(IEnumerable roleIds); 89 | 90 | #endregion 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IRolePermissionBusiness.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.BusinessContract.Sys 8 | { 9 | /// 10 | /// 角色授权业务逻辑 11 | /// 12 | public interface IRolePermissionBusiness 13 | { 14 | #region 修改角色授权 15 | 16 | /// 17 | /// 修改角色授权 18 | /// 19 | /// 角色授权修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyRolePermissionParameter modifyRolePermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 根据角色清空角色授权信息 26 | 27 | /// 28 | /// 根据角色清空角色授权信息 29 | /// 30 | /// 角色系统编号 31 | /// 返回执行结果 32 | Result ClearByRole(IEnumerable roleIds); 33 | 34 | #endregion 35 | 36 | #region 根据权限清空角色授权信息 37 | 38 | /// 39 | /// 根据权限清空角色授权信息 40 | /// 41 | /// 权限系统编号 42 | /// 返回执行结果 43 | Result ClearByPermission(IEnumerable permissionIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IUserPermissionBusiness.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.BusinessContract.Sys 8 | { 9 | /// 10 | /// 用户授权业务逻辑 11 | /// 12 | public interface IUserPermissionBusiness 13 | { 14 | #region 修改用户授权 15 | 16 | /// 17 | /// 修改用户授权 18 | /// 19 | /// 用户授权修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyUserPermissionParameter modifyUserPermissionParameter); 22 | 23 | #endregion 24 | 25 | #region 根据用户清除用户授权信息 26 | 27 | /// 28 | /// 根据用户清除用户授权信息 29 | /// 30 | /// 用户系统编号 31 | /// 返回执行结果 32 | Result ClearByUser(IEnumerable permissionIds); 33 | 34 | #endregion 35 | 36 | #region 根据权限清除用户授权信息 37 | 38 | /// 39 | /// 根据权限清除用户授权信息 40 | /// 41 | /// 权限系统编号 42 | /// 返回执行结果 43 | Result ClearByPermission(IEnumerable permissionIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Business/EZNEWApp.BusinessContract.Sys/IUserRoleBusiness.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | 7 | namespace EZNEWApp.BusinessContract.Sys 8 | { 9 | /// 10 | /// 用户角色业务接口 11 | /// 12 | public interface IUserRoleBusiness 13 | { 14 | #region 清除角色下所有的用户 15 | 16 | /// 17 | /// 清除角色下所有的用户 18 | /// 19 | /// 角色系统编号 20 | /// 执行结果 21 | Result ClearByRole(IEnumerable roleIds); 22 | 23 | #endregion 24 | 25 | #region 清除用户绑定的所有角色 26 | 27 | /// 28 | /// 清除用户绑定的所有角色 29 | /// 30 | /// 用户系统编号 31 | /// 执行结果 32 | Result ClearByUser(IEnumerable userIds); 33 | 34 | #endregion 35 | 36 | #region 修改用户&角色绑定关系 37 | 38 | /// 39 | /// 修改用户&角色绑定关系 40 | /// 41 | /// 用户&角色修绑定关系修改信息 42 | /// 返回操作结果 43 | Result Modify(ModifyUserRoleParameter modifyUserRoleParameter); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/EZNEWApp.Domain.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/MenuPermission.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Development.Entity; 5 | 6 | namespace EZNEWApp.Domain.Sys.Model 7 | { 8 | /// 9 | /// 菜单授权 10 | /// 11 | [Serializable] 12 | [Entity(ObjectName = "Sys_MenuPermission", Group = "Sys", Description = "菜单授权")] 13 | public class MenuPermission : ModelEntity 14 | { 15 | /// 16 | /// 菜单编号 17 | /// 18 | [EntityField(Description = "菜单编号", Role = FieldRole.PrimaryKey)] 19 | [EntityRelationField(typeof(Menu), nameof(Menu.Id), RelationBehavior.CascadingRemove)] 20 | public long MenuId { get; set; } 21 | 22 | /// 23 | /// 权限编号 24 | /// 25 | [EntityField(Description = "权限编号", Role = FieldRole.PrimaryKey)] 26 | [EntityRelationField(typeof(Permission), nameof(Permission.Id), RelationBehavior.CascadingRemove)] 27 | public long PermissionId { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/Operation.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.ComponentModel.DataAnnotations.Schema; 5 | using EZNEW.Development.Entity; 6 | using EZNEWApp.Module.Sys; 7 | 8 | namespace EZNEWApp.Domain.Sys.Model 9 | { 10 | /// 11 | /// 操作功能 12 | /// 13 | [Serializable] 14 | [Entity(ObjectName = "Sys_Operation", Group = "Sys", Description = "操作功能")] 15 | public class Operation : ModelRecordEntity 16 | { 17 | #region 属性 18 | 19 | /// 20 | /// 主键编号 21 | /// 22 | [EntityField(Description = "主键编号", Role = FieldRole.PrimaryKey)] 23 | public long Id { get; set; } 24 | 25 | /// 26 | /// 控制器 27 | /// 28 | [EntityField(Description = "控制器", IsRequired = true)] 29 | public string Controller { get; set; } 30 | 31 | /// 32 | /// 操作方法 33 | /// 34 | [EntityField(Description = "操作方法")] 35 | public string Action { get; set; } 36 | 37 | /// 38 | /// 地址 39 | /// 40 | [EntityField(Description = "地址")] 41 | public string Path { get; set; } 42 | 43 | /// 44 | /// 名称 45 | /// 46 | [EntityField(Description = "名称")] 47 | public string Name { get; set; } 48 | 49 | /// 50 | /// 状态 51 | /// 52 | [EntityField(Description = "状态")] 53 | public OperationStatus Status { get; set; } = OperationStatus.Enable; 54 | 55 | /// 56 | /// 排序 57 | /// 58 | [EntityField(Description = "排序")] 59 | public int Sort { get; set; } 60 | 61 | /// 62 | /// 操作分组 63 | /// 64 | [EntityField(Description = "操作分组")] 65 | [EntityRelationField(typeof(OperationGroup), nameof(OperationGroup.Id), RelationBehavior.CascadingRemove)] 66 | public long Group { get; set; } 67 | 68 | /// 69 | /// 访问级别 70 | /// 71 | [EntityField(Description = "访问级别")] 72 | public OperationAccessLevel AccessLevel { get; set; } 73 | 74 | /// 75 | /// 方法描述 76 | /// 77 | [EntityField(Description = "方法描述")] 78 | public string Remark { get; set; } 79 | 80 | #endregion 81 | } 82 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/OperationGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Data.Modification; 4 | using EZNEW.Development.Entity; 5 | using EZNEW.Development.Query; 6 | 7 | namespace EZNEWApp.Domain.Sys.Model 8 | { 9 | /// 10 | /// 操作功能分组 11 | /// 12 | [Serializable] 13 | [Entity(ObjectName = "Sys_OperationGroup", Group = "Sys", Description = "操作功能分组")] 14 | public class OperationGroup : ModelRecordEntity 15 | { 16 | #region 属性 17 | 18 | /// 19 | /// 编号 20 | /// 21 | [EntityField(Description = "编号", Role = FieldRole.PrimaryKey)] 22 | public long Id { get; set; } 23 | 24 | /// 25 | /// 名称 26 | /// 27 | [EntityField(Description = "名称")] 28 | public string Name { get; set; } 29 | 30 | /// 31 | /// 排序 32 | /// 33 | [EntityField(Description = "排序")] 34 | public int Sort { get; set; } 35 | 36 | /// 37 | /// 上级 38 | /// 39 | [EntityField(Description = "上级")] 40 | public long Parent { get; set; } 41 | 42 | /// 43 | /// 说明 44 | /// 45 | [EntityField(Description = "说明")] 46 | public string Remark { get; set; } 47 | 48 | #endregion 49 | 50 | #region 方法 51 | 52 | #region 修改排序 53 | 54 | /// 55 | /// 修改排序 56 | /// 57 | /// 新排序,排序编号不能小于0 58 | public void ModifySort(int newSort) 59 | { 60 | if (newSort < 0) 61 | { 62 | throw new Exception("请填写正确的排序号"); 63 | } 64 | Sort = newSort; 65 | //同级后面的数据排序顺延 66 | IQuery sortQuery = QueryManager.Create(r => r.Sort >= newSort && r.Parent==Parent); 67 | IModification modifyExpression = ModificationFactory.Create().Add(r => r.Sort, 1); 68 | Repository.Modify(modifyExpression, sortQuery); 69 | } 70 | 71 | #endregion 72 | 73 | #endregion 74 | } 75 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/OperationPermission.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | 5 | namespace EZNEWApp.Domain.Sys.Model 6 | { 7 | /// 8 | /// 已授权的操作 9 | /// 10 | [Serializable] 11 | [Entity(ObjectName = "Sys_OperationPermission", Group = "Sys", Description = "已授权的操作")] 12 | public class OperationPermission : ModelEntity 13 | { 14 | /// 15 | /// 操作功能 16 | /// 17 | [EntityField(Description = "操作功能", Role = FieldRole.PrimaryKey)] 18 | [EntityRelationField(typeof(Operation), nameof(Operation.Id), RelationBehavior.CascadingRemove)] 19 | public long OperationId { get; set; } 20 | 21 | /// 22 | /// 权限 23 | /// 24 | [EntityField(Description = "权限", Role = FieldRole.PrimaryKey)] 25 | [EntityRelationField(typeof(Permission), nameof(Permission.Id), RelationBehavior.CascadingRemove)] 26 | public long PermissionId { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/Permission.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | using EZNEWApp.Module.Sys; 5 | 6 | namespace EZNEWApp.Domain.Sys.Model 7 | { 8 | /// 9 | /// 权限 10 | /// 11 | [Serializable] 12 | [Entity(ObjectName = "Sys_Permission", Group = "Sys", Description = "权限")] 13 | public class Permission : ModelRecordEntity 14 | { 15 | #region 属性 16 | 17 | /// 18 | /// 编号 19 | /// 20 | [EntityField(Description = "编号", Role = FieldRole.PrimaryKey)] 21 | public long Id { get; set; } 22 | 23 | /// 24 | /// 编码 25 | /// 26 | [EntityField(Description = "编码")] 27 | public string Code { get; set; } 28 | 29 | /// 30 | /// 名称 31 | /// 32 | [EntityField(Description = "名称")] 33 | public string Name { get; set; } 34 | 35 | /// 36 | /// 权限类型 37 | /// 38 | [EntityField(Description = "权限类型")] 39 | public PermissionType Type { get; set; } 40 | 41 | /// 42 | /// 状态 43 | /// 44 | [EntityField(Description = "状态")] 45 | public PermissionStatus Status { get; set; } 46 | 47 | /// 48 | /// 排序 49 | /// 50 | [EntityField(Description = "排序")] 51 | public int Sort { get; set; } 52 | 53 | /// 54 | /// 权限分组 55 | /// 56 | [EntityField(Description = "权限分组")] 57 | [EntityRelationField(typeof(PermissionGroup), nameof(PermissionGroup.Id), RelationBehavior.CascadingRemove)] 58 | public long Group { get; set; } 59 | 60 | /// 61 | /// 说明 62 | /// 63 | [EntityField(Description = "说明")] 64 | public string Remark { get; set; } 65 | 66 | #endregion 67 | } 68 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/PermissionGroup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Data.Modification; 4 | using EZNEW.Development.Entity; 5 | using EZNEW.Development.Query; 6 | 7 | namespace EZNEWApp.Domain.Sys.Model 8 | { 9 | /// 10 | /// 权限分组 11 | /// 12 | [Serializable] 13 | [Entity(ObjectName = "Sys_PermissionGroup", Group = "Sys", Description = "权限分组")] 14 | public class PermissionGroup : ModelRecordEntity 15 | { 16 | #region 属性 17 | 18 | /// 19 | /// 编号 20 | /// 21 | [EntityField(Description = "编号", Role = FieldRole.PrimaryKey)] 22 | public long Id { get; set; } 23 | 24 | /// 25 | /// 名称 26 | /// 27 | [EntityField(Description = "名称")] 28 | public string Name { get; set; } 29 | 30 | /// 31 | /// 排序 32 | /// 33 | [EntityField(Description = "排序")] 34 | public int Sort { get; set; } 35 | 36 | /// 37 | /// 上级分组 38 | /// 39 | [EntityField(Description = "上级分组")] 40 | public long Parent { get; set; } 41 | 42 | /// 43 | /// 说明 44 | /// 45 | [EntityField(Description = "说明")] 46 | public string Remark { get; set; } 47 | 48 | #endregion 49 | 50 | #region 方法 51 | 52 | #region 修改排序 53 | 54 | /// 55 | /// 修改排序 56 | /// 57 | /// 新排序,排序编号必须大于0 58 | public void ModifySort(int newSort) 59 | { 60 | if (newSort < 0) 61 | { 62 | throw new Exception("请填写正确的排序号"); 63 | } 64 | Sort = newSort; 65 | //同级其它数据顺延 66 | IQuery sortQuery = QueryManager.Create(r => r.Sort >= newSort && r.Parent == Parent); 67 | IModification modifyExpression = ModificationFactory.Create().Add(c => c.Sort, 1); 68 | Repository.Modify(modifyExpression, sortQuery); 69 | } 70 | 71 | #endregion 72 | 73 | #endregion 74 | } 75 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/Role.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | using EZNEWApp.Module.Sys; 5 | 6 | namespace EZNEWApp.Domain.Sys.Model 7 | { 8 | /// 9 | /// 角色 10 | /// 11 | [Serializable] 12 | [Entity(ObjectName = "Sys_Role", Group = "Sys", Description = "角色")] 13 | public class Role : ModelRecordEntity 14 | { 15 | #region 属性 16 | 17 | /// 18 | /// 角色编号 19 | /// 20 | [EntityField(Description = "角色编号", Role = FieldRole.PrimaryKey)] 21 | public long Id { get; set; } 22 | 23 | /// 24 | /// 名称 25 | /// 26 | [EntityField(Description = "名称")] 27 | public string Name { get; set; } 28 | 29 | /// 30 | /// 状态 31 | /// 32 | [EntityField(Description = "状态")] 33 | public RoleStatus Status { get; set; } 34 | 35 | /// 36 | /// 备注信息 37 | /// 38 | [EntityField(Description = "备注信息")] 39 | public string Remark { get; set; } 40 | 41 | #endregion 42 | 43 | #region 方法 44 | 45 | #endregion 46 | } 47 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/RolePermission.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | 5 | namespace EZNEWApp.Domain.Sys.Model 6 | { 7 | /// 8 | /// 角色授权 9 | /// 10 | [Serializable] 11 | [Entity(ObjectName = "Sys_RolePermission", Group = "Sys", Description = "角色授权")] 12 | public class RolePermission : ModelEntity 13 | { 14 | /// 15 | /// 角色 16 | /// 17 | [EntityField(Description = "角色", Role = FieldRole.PrimaryKey)] 18 | [EntityRelationField(typeof(Role), nameof(Role.Id), RelationBehavior.CascadingRemove)] 19 | [EntityRelationField(typeof(UserRole), nameof(UserRole.RoleId))] 20 | public long RoleId { get; set; } 21 | 22 | /// 23 | /// 权限 24 | /// 25 | [EntityField(Description = "权限", Role = FieldRole.PrimaryKey)] 26 | [EntityRelationField(typeof(Permission), nameof(Permission.Id), RelationBehavior.CascadingRemove)] 27 | public long PermissionId { get; set; } 28 | } 29 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/UserPermission.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | 5 | namespace EZNEWApp.Domain.Sys.Model 6 | { 7 | /// 8 | /// 用户授权 9 | /// 10 | [Serializable] 11 | [Entity(ObjectName = "Sys_UserPermission", Group = "Sys", Description = "用户授权")] 12 | public class UserPermission : ModelEntity 13 | { 14 | /// 15 | /// 用户 16 | /// 17 | [EntityField(Description = "用户", Role = FieldRole.PrimaryKey)] 18 | [EntityRelationField(typeof(User), nameof(User.Id), RelationBehavior.CascadingRemove)] 19 | public long UserId { get; set; } 20 | 21 | /// 22 | /// 权限 23 | /// 24 | [EntityField(Description = "权限", Role = FieldRole.PrimaryKey)] 25 | [EntityRelationField(typeof(Permission), nameof(Permission.Id), RelationBehavior.CascadingRemove)] 26 | public long PermissionId { get; set; } 27 | 28 | /// 29 | /// 禁用 30 | /// 31 | [EntityField(Description = "禁用")] 32 | public bool Disable { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Model/UserRole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Entity; 4 | 5 | namespace EZNEWApp.Domain.Sys.Model 6 | { 7 | /// 8 | /// 用户角色 9 | /// 10 | [Serializable] 11 | [Entity(ObjectName = "Sys_UserRole", Group = "Sys", Description = "用户角色")] 12 | public class UserRole : ModelEntity 13 | { 14 | /// 15 | /// 用户 16 | /// 17 | [EntityField(Description = "用户", Role = FieldRole.PrimaryKey)] 18 | [EntityRelationField(typeof(User), nameof(User.Id), RelationBehavior.CascadingRemove)] 19 | public long UserId { get; set; } 20 | 21 | /// 22 | /// 角色 23 | /// 24 | [EntityField(Description = "角色", Role = FieldRole.PrimaryKey)] 25 | [EntityRelationField(typeof(Role), nameof(Role.Id), RelationBehavior.CascadingRemove)] 26 | public long RoleId { get; set; } 27 | } 28 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/CheckAuthorizationParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Domain; 7 | using EZNEWApp.Domain.Sys.Model; 8 | 9 | namespace EZNEWApp.Domain.Sys.Parameter 10 | { 11 | /// 12 | /// 检查操作授权 13 | /// 14 | public class CheckAuthorizationParameter : IDomainParameter 15 | { 16 | /// 17 | /// 用户编号 18 | /// 19 | public long UserId { get; set; } 20 | 21 | /// 22 | /// 授权操作 23 | /// 24 | public Operation Operation { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistOperationGroupNameParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 检查授权操作分组名称 9 | /// 10 | public class ExistOperationGroupNameParameter 11 | { 12 | /// 13 | /// 分组名称 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// 排除验证的分组编号 19 | /// 20 | public long ExcludeId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistPermissionCodeParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 验证权限编码是否存在 9 | /// 10 | public class ExistPermissionCodeParameter 11 | { 12 | /// 13 | /// 验证权限编码时需要排除的权限Id 14 | /// 15 | public long ExcludeId { get; set; } 16 | 17 | /// 18 | /// 权限编码 19 | /// 20 | public string Code { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistPermissionGroupNameParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 验证权限分组名称是否存在 9 | /// 10 | public class ExistPermissionGroupNameParameter 11 | { 12 | /// 13 | /// 分组名称 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// 验证分组名称时需要排除的分组编号 19 | /// 20 | public long ExcludeId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistPermissionNameParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 验证权限名称 9 | /// 10 | public class ExistPermissionNameParameter 11 | { 12 | /// 13 | /// 权限名称 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// 验证权限名称时需要排除的权限编号 19 | /// 20 | public long ExcludeId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistRoleNameParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 验证角色名是否存在 9 | /// 10 | public class ExistRoleNameParameter 11 | { 12 | /// 13 | /// 角色名称 14 | /// 15 | public string Name { get; set; } 16 | 17 | /// 18 | /// 验证角色名称时需要排除的角色编号 19 | /// 20 | public long ExcludeId { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ExistUserNameParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 验证用户名参数 9 | /// 10 | public class ExistUserNameParameter 11 | { 12 | /// 13 | /// 要排除的用户编号 14 | /// 15 | public long? ExcludeId { get; set; } 16 | 17 | /// 18 | /// 用户名 19 | /// 20 | public string UserName { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/InitializeOperationParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Development.Domain; 2 | using EZNEWApp.Domain.Sys.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace EZNEWApp.Domain.Sys.Parameter 8 | { 9 | /// 10 | /// 初始化 11 | /// 12 | public class InitializeOperationParameter : IDomainParameter 13 | { 14 | /// 15 | /// 操作分组 16 | /// 17 | public List OperationGroups { get; set; } 18 | 19 | /// 20 | /// 操作功能 21 | /// 22 | public List Operations { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/LoginParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Domain; 7 | 8 | namespace EZNEWApp.Domain.Sys.Parameter 9 | { 10 | /// 11 | /// 用户登录信息 12 | /// 13 | public class LoginParameter : IDomainParameter 14 | { 15 | /// 16 | /// 用户名 17 | /// 18 | public string UserName { get; set; } 19 | 20 | /// 21 | /// 登陆密码 22 | /// 23 | public string Password { get; set; } 24 | 25 | /// 26 | /// 验证码 27 | /// 28 | public string VerificationCode { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyMenuPermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 修改菜单权限参数 10 | /// 11 | public class ModifyMenuPermissionParameter 12 | { 13 | /// 14 | /// 绑定信息 15 | /// 16 | public IEnumerable Bindings { get; set; } 17 | 18 | /// 19 | /// 解绑信息 20 | /// 21 | public IEnumerable Unbindings { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyOperationGroupSortParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 修改分组排序 9 | /// 10 | public class ModifyOperationGroupSortParameter 11 | { 12 | /// 13 | /// 分组编号 14 | /// 15 | public long Id { get; set; } 16 | 17 | /// 18 | /// 排序号 19 | /// 20 | public int NewSort { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyOperationPermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Domain; 7 | using EZNEWApp.Domain.Sys.Model; 8 | 9 | namespace EZNEWApp.Domain.Sys.Parameter 10 | { 11 | /// 12 | /// 修改权限和操作功能绑定 13 | /// 14 | public class ModifyOperationPermissionParameter : IDomainParameter 15 | { 16 | /// 17 | /// 绑定信息 18 | /// 19 | public IEnumerable Bindings { get; set; } 20 | 21 | /// 22 | /// 解绑信息 23 | /// 24 | public IEnumerable Unbindings { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyOperationStatusParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Development.Domain; 2 | using EZNEWApp.Module.Sys; 3 | using System.Collections.Generic; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 修改授权操作状态信息 9 | /// 10 | public class ModifyOperationStatusParameter : IDomainParameter 11 | { 12 | /// 13 | /// 状态信息 14 | /// 15 | public Dictionary StatusInfos { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyPermissionGroupSortParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 修改权限分组排序 9 | /// 10 | public class ModifyPermissionGroupSortParameter 11 | { 12 | /// 13 | /// 分组编号 14 | /// 15 | public long Id { get; set; } 16 | 17 | /// 18 | /// 新的排序 19 | /// 20 | public int NewSort { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyPermissionStatusParameter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EZNEW.Development.Domain; 3 | using EZNEWApp.Module.Sys; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 修改权限状态信息 9 | /// 10 | public class ModifyPermissionStatusParameter : IDomainParameter 11 | { 12 | /// 13 | /// 状态信息 14 | /// 15 | public Dictionary StatusInfos { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyRolePermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Development.Domain; 4 | using EZNEWApp.Domain.Sys.Model; 5 | using EZNEWApp.Domain.Sys.Parameter.Filter; 6 | 7 | namespace EZNEWApp.Domain.Sys.Parameter 8 | { 9 | /// 10 | /// 修改角色权限绑定 11 | /// 12 | public class ModifyRolePermissionParameter : IDomainParameter 13 | { 14 | /// 15 | /// 绑定信息 16 | /// 17 | public IEnumerable Bindings { get; set; } 18 | 19 | /// 20 | /// 解绑信息 21 | /// 22 | public IEnumerable Unbindings { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyUserPasswordParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Development.Domain; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace EZNEWApp.Domain.Sys.Parameter 9 | { 10 | /// 11 | /// 修改用户密码信息 12 | /// 13 | public class ModifyUserPasswordParameter : IDomainParameter 14 | { 15 | /// 16 | /// 用户编号 17 | /// 18 | public long UserId { get; set; } 19 | 20 | /// 21 | /// 当前密码 22 | /// 23 | public string CurrentPassword { get; set; } 24 | 25 | /// 26 | /// 新密码 27 | /// 28 | public string NewPassword { get; set; } 29 | 30 | /// 31 | /// 是否验证现有密码 32 | /// 33 | public bool CheckCurrentPassword { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyUserPermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | using EZNEW.Development.Domain; 6 | 7 | namespace EZNEWApp.Domain.Sys.Parameter 8 | { 9 | /// 10 | /// 修改用户授权 11 | /// 12 | public class ModifyUserPermissionParameter : IDomainParameter 13 | { 14 | /// 15 | /// 用户授权信息 16 | /// 17 | public IEnumerable UserPermissions { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyUserRoleParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Development.Domain; 5 | using EZNEWApp.Domain.Sys.Model; 6 | 7 | namespace EZNEWApp.Domain.Sys.Parameter 8 | { 9 | /// 10 | /// 修改用户&角色绑定关系 11 | /// 12 | public class ModifyUserRoleParameter : IDomainParameter 13 | { 14 | /// 15 | /// 绑定信息 16 | /// 17 | public IEnumerable Bindings { get; set; } 18 | 19 | /// 20 | /// 解绑信息 21 | /// 22 | public IEnumerable Unbindings { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/ModifyUserStatusParameter.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using EZNEW.Development.Domain; 3 | using EZNEWApp.Module.Sys; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 修改用户状态信息 9 | /// 10 | public class ModifyUserStatusParameter : IDomainParameter 11 | { 12 | /// 13 | /// 用户状态信息 14 | /// 键:用户编号 15 | /// 值:用户状态 16 | /// 17 | public Dictionary StatusInfos { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveMenuParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Development.Domain; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 删除菜单 10 | /// 11 | public class RemoveMenuParameter : IDomainParameter 12 | { 13 | /// 14 | /// 菜单编号 15 | /// 16 | public List Ids { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveOperationGroupParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 移除操作分组信息 9 | /// 10 | public class RemoveOperationGroupParameter 11 | { 12 | /// 13 | /// 要删除的操作分组编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveOperationGroupPatameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 删除操作分组信息 9 | /// 10 | public class RemoveOperationGroupPatameter 11 | { 12 | /// 13 | /// 要删除的操作分组编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveOperationParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 授权操作删除信息 9 | /// 10 | public class RemoveOperationParameter 11 | { 12 | /// 13 | /// 要删除的授权操作编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemovePermissionGroupParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 删除权限分组信息 9 | /// 10 | public class RemovePermissionGroupParameter 11 | { 12 | /// 13 | /// 要删除的权限分组编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemovePermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 删除权限信息 9 | /// 10 | public class RemovePermissionParameter 11 | { 12 | /// 13 | /// 要删除的权限编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveRoleParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 定义删除角色参数信息 9 | /// 10 | public class RemoveRoleParameter 11 | { 12 | /// 13 | /// 要删除的角色编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/RemoveUserParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace EZNEWApp.Domain.Sys.Parameter 6 | { 7 | /// 8 | /// 定义删除用户参数信息 9 | /// 10 | public class RemoveUserParameter 11 | { 12 | /// 13 | /// 要删除的用户编号 14 | /// 15 | public IEnumerable Ids { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SaveMenuParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEWApp.Domain.Sys.Model; 7 | 8 | namespace EZNEWApp.Domain.Sys.Parameter 9 | { 10 | /// 11 | /// 保存菜单信息 12 | /// 13 | public class SaveMenuParameter 14 | { 15 | /// 16 | /// 菜单 17 | /// 18 | public Menu Menu { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SaveOperationGroupParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 保存操作分组信息 10 | /// 11 | public class SaveOperationGroupParameter 12 | { 13 | /// 14 | /// 授权操作分组信息 15 | /// 16 | public OperationGroup OperationGroup { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SaveOperationParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEWApp.Domain.Sys.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | public class SaveOperationParameter 9 | { 10 | /// 11 | /// 获取或设置要保存的操作信息 12 | /// 13 | public Operation Operation { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SavePermissionGroupParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEWApp.Domain.Sys.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 保存权限分组信息 10 | /// 11 | public class SavePermissionGroupParameter 12 | { 13 | /// 14 | /// 分组信息 15 | /// 16 | public PermissionGroup PermissionGroup { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SavePermissionParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEWApp.Domain.Sys.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | public class SavePermissionParameter 9 | { 10 | /// 11 | /// 权限信息 12 | /// 13 | public Permission Permission { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SaveRoleParameter.cs: -------------------------------------------------------------------------------- 1 | using EZNEWApp.Domain.Sys.Model; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 保存角色参数 10 | /// 11 | public class SaveRoleParameter 12 | { 13 | /// 14 | /// 角色信息 15 | /// 16 | public Role Role { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Parameter/SaveUserParameter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | 6 | namespace EZNEWApp.Domain.Sys.Parameter 7 | { 8 | /// 9 | /// 定义保存用户参数信息 10 | /// 11 | public class SaveUserParameter 12 | { 13 | /// 14 | /// 保存用户 15 | /// 16 | public User User { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IMenuPermissionService.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Model; 2 | using EZNEWApp.Domain.Sys.Parameter; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace EZNEWApp.Domain.Sys.Service 8 | { 9 | /// 10 | /// 菜单权限服务 11 | /// 12 | public interface IMenuPermissionService 13 | { 14 | #region 清除菜单的所有权限 15 | 16 | /// 17 | /// 清除菜单的所有权限 18 | /// 19 | /// 菜单系统编号 20 | /// 执行结果 21 | Result ClearByMenu(IEnumerable menuIds); 22 | 23 | #endregion 24 | 25 | #region 清除权限的所有菜单 26 | 27 | /// 28 | /// 清除权限的所有菜单 29 | /// 30 | /// 权限系统编号 31 | /// 执行结果 32 | Result ClearByPermission(IEnumerable permissionIds); 33 | 34 | #endregion 35 | 36 | #region 修改菜单&权限 37 | 38 | /// 39 | /// 修改菜单&权限 40 | /// 41 | /// 菜单&权限修改参数 42 | /// 返回操作结果 43 | Result Modify(ModifyMenuPermissionParameter modifyMenuPermissionParameter); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IMenuService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Query; 7 | using EZNEW.Paging; 8 | using EZNEW.Model; 9 | using EZNEWApp.Domain.Sys.Model; 10 | using EZNEWApp.Domain.Sys.Parameter; 11 | using EZNEWApp.Domain.Sys.Parameter.Filter; 12 | 13 | namespace EZNEWApp.Domain.Sys.Service 14 | { 15 | /// 16 | /// 菜单服务 17 | /// 18 | public interface IMenuService 19 | { 20 | #region 保存菜单 21 | 22 | /// 23 | /// 保存菜单 24 | /// 25 | /// 菜单信息 26 | /// 27 | Result Save(Menu menu); 28 | 29 | #endregion 30 | 31 | #region 获取菜单 32 | 33 | /// 34 | /// 获取菜单 35 | /// 36 | /// 编号 37 | /// 38 | Menu Get(long id); 39 | 40 | /// 41 | /// 获取菜单 42 | /// 43 | /// 菜单筛选信息 44 | /// 45 | Menu Get(MenuFilter menuFilter); 46 | 47 | #endregion 48 | 49 | #region 获取菜单列表 50 | 51 | /// 52 | /// 获取菜单列表 53 | /// 54 | /// 菜单编号 55 | /// 56 | List GetList(IEnumerable menuIds); 57 | 58 | /// 59 | /// 获取菜单列表 60 | /// 61 | /// 菜单筛选信息 62 | /// 63 | List GetList(MenuFilter menuFilter); 64 | 65 | #endregion 66 | 67 | #region 获取菜单分页 68 | 69 | /// 70 | /// 获取菜单分页 71 | /// 72 | /// 菜单筛选信息 73 | /// 74 | PagingInfo GetPaging(MenuFilter menuFilter); 75 | 76 | #endregion 77 | 78 | #region 删除菜单 79 | 80 | /// 81 | /// 删除菜单 82 | /// 83 | /// 删除信息 84 | /// 执行结果 85 | Result Remove(RemoveMenuParameter removeMenuParameter); 86 | 87 | #endregion 88 | } 89 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IOperationPermissionService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Transactions; 3 | using EZNEWApp.Domain.Sys.Parameter; 4 | using EZNEW.Model; 5 | 6 | namespace EZNEWApp.Domain.Sys.Service 7 | { 8 | /// 9 | /// 权限&授权操作绑定操作服务 10 | /// 11 | public interface IOperationPermissionService 12 | { 13 | #region 修改权限&操作授权 14 | 15 | /// 16 | /// 修改权限&操作绑定 17 | /// 18 | /// 权限操作修改信息 19 | /// 返回执行结果 20 | Result Modify(ModifyOperationPermissionParameter modifyPermissionOperation); 21 | 22 | #endregion 23 | 24 | #region 清除权限绑定的所有操作 25 | 26 | /// 27 | /// 清除权限绑定的所有操作 28 | /// 29 | /// 权限编号 30 | /// 返回执行结果 31 | Result ClearByPermission(IEnumerable permissionIds); 32 | 33 | #endregion 34 | 35 | #region 清除操作功能授权的所有权限 36 | 37 | /// 38 | /// 清除操作功能授权的所有权限 39 | /// 40 | /// 操作编号 41 | /// 返回执行结果 42 | Result ClearByOperation(IEnumerable operationIds); 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IRolePermissionService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Parameter; 5 | using EZNEW.Model; 6 | 7 | namespace EZNEWApp.Domain.Sys.Service 8 | { 9 | /// 10 | /// 角色授权服务 11 | /// 12 | public interface IRolePermissionService 13 | { 14 | #region 修改角色授权 15 | 16 | /// 17 | /// 修改角色授权 18 | /// 19 | /// 角色授权修改信息 20 | /// 返回执行结果 21 | Result Modify(ModifyRolePermissionParameter modifyRolePermission); 22 | 23 | #endregion 24 | 25 | #region 根据角色清除角色授权 26 | 27 | /// 28 | /// 根据角色清除角色授权 29 | /// 30 | /// 角色编号 31 | /// 返回执行结果 32 | Result ClearByRole(IEnumerable roleIds); 33 | 34 | #endregion 35 | 36 | #region 根据权限清除角色授权 37 | 38 | /// 39 | /// 根据权限清除角色授权 40 | /// 41 | /// 权限编号 42 | /// 返回执行结果 43 | Result ClearByPermission(IEnumerable permissionIds); 44 | 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IUserPermissionService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | using EZNEW.Model; 7 | 8 | namespace EZNEWApp.Domain.Sys.Service 9 | { 10 | /// 11 | /// 用户授权服务 12 | /// 13 | public interface IUserPermissionService 14 | { 15 | #region 修改用户授权 16 | 17 | /// 18 | /// 修改用户授权 19 | /// 20 | /// 用户授权修改信息 21 | /// 返回执行结果 22 | Result Modify(ModifyUserPermissionParameter modifyUserPermission); 23 | 24 | #endregion 25 | 26 | #region 根据用户清除用户授权 27 | 28 | /// 29 | /// 根据用户清除用户授权 30 | /// 31 | /// 用户编号 32 | /// 返回执行结果 33 | Result ClearByUser(IEnumerable userIds); 34 | 35 | #endregion 36 | 37 | #region 根据权限清除用户授权 38 | 39 | /// 40 | /// 根据权限清除用户授权 41 | /// 42 | /// 权限编号 43 | /// 返回执行结果 44 | Result ClearByPermission(IEnumerable permissionIds); 45 | 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Domain/EZNEWApp.Domain.Sys/Service/IUserRoleService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEWApp.Domain.Sys.Model; 5 | using EZNEWApp.Domain.Sys.Parameter; 6 | using EZNEW.Model; 7 | 8 | namespace EZNEWApp.Domain.Sys.Service 9 | { 10 | /// 11 | /// 用户角色服务 12 | /// 13 | public interface IUserRoleService 14 | { 15 | #region 清除角色下所有的用户 16 | 17 | /// 18 | /// 清除角色下所有的用户 19 | /// 20 | /// 角色系统编号 21 | /// 执行结果 22 | Result ClearByRole(IEnumerable roleIds); 23 | 24 | #endregion 25 | 26 | #region 清除用户绑定的所有角色 27 | 28 | /// 29 | /// 清除用户绑定的所有角色 30 | /// 31 | /// 用户系统编号 32 | /// 执行结果 33 | Result ClearByUser(IEnumerable userIds); 34 | 35 | #endregion 36 | 37 | #region 修改用户&角色绑定关系 38 | 39 | /// 40 | /// 修改用户&角色绑定关系 41 | /// 42 | /// 用户&角色修绑定关系修改信息 43 | /// 返回操作结果 44 | Result Modify(ModifyUserRoleParameter modifyUserRoleParameter); 45 | 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.Module.Sys/EZNEWApp.Module.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.Module.Sys/SysManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using EZNEW.Code; 4 | 5 | namespace EZNEWApp.Module.Sys 6 | { 7 | public static class SysManager 8 | { 9 | #region 对象标识值 10 | 11 | /// 12 | /// 根据指定的模块对象生成获取一个Id 13 | /// 14 | /// 模块对象类型 15 | /// 16 | public static long GetId() 17 | { 18 | return SerialNumber.GenerateSerialNumber(); 19 | } 20 | 21 | #endregion 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/DataConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Data; 7 | using EZNEW.Development.DataAccess.Event; 8 | 9 | namespace EZNEWApp.ModuleConfig.Sys 10 | { 11 | /// 12 | /// 数据访问配置 13 | /// 14 | public static class DataConfiguration 15 | { 16 | public static void Configure() 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/DependencyInjectionConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.DependencyInjection; 7 | 8 | namespace EZNEWApp.ModuleConfig.Sys 9 | { 10 | /// 11 | /// 服务注册配置 12 | /// 13 | public static class DependencyInjectionConfiguration 14 | { 15 | public static void Configure() 16 | { 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/DomainConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using EZNEW.Development.Domain.Event; 5 | using EZNEW.Logging; 6 | using EZNEWApp.Domain.Sys.Model; 7 | 8 | namespace EZNEWApp.ModuleConfig.Sys 9 | { 10 | /// 11 | /// 领域事件配置 12 | /// 13 | public static class DomainConfiguration 14 | { 15 | internal static void Configure() 16 | { 17 | //以下为测试代码,生产项目请删除 18 | 19 | //保存用户 20 | DomainEventBus.Subscribe>(e => 21 | { 22 | LogManager.LogInformation($"已保存用户:{e.Object?.GetIdentityValue()}"); 23 | return DomainEventResult.EmptyResult(); 24 | }, EventTriggerTime.WorkCompleted); 25 | 26 | //删除用户 27 | DomainEventBus.Subscribe>(e=> 28 | { 29 | LogManager.LogInformation($"已删除用户:{e.Object?.GetIdentityValue()}"); 30 | return DomainEventResult.EmptyResult(); 31 | }, EventTriggerTime.WorkCompleted); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/EZNEWApp.ModuleConfig.Sys.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net5.0 5 | TargetFrameworkOverride 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Always 20 | 21 | 22 | Always 23 | 24 | 25 | Always 26 | 27 | 28 | Always 29 | 30 | 31 | Always 32 | 33 | 34 | Always 35 | 36 | 37 | Always 38 | 39 | 40 | Always 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/ObjectMappingConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using AutoMapper; 5 | using EZNEW.Mapper; 6 | 7 | namespace EZNEWApp.ModuleConfig.Sys 8 | { 9 | /// 10 | /// 对象映射配置 11 | /// 12 | public static class ObjectMappingConfiguration 13 | { 14 | public static void Configure() 15 | { 16 | ObjectMapper.ConfigureMap(cfg => 17 | { 18 | }); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/QueryConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Query; 7 | 8 | namespace EZNEWApp.ModuleConfig.Sys 9 | { 10 | /// 11 | /// 查询配置 12 | /// 13 | public static class QueryConfiguration 14 | { 15 | public static void Configure() 16 | { 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/RepositoryConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using EZNEW.Development.Domain.Repository; 7 | using EZNEW.Development.Domain.Repository.Event; 8 | 9 | namespace EZNEWApp.ModuleConfig.Sys 10 | { 11 | /// 12 | /// 仓储配置 13 | /// 14 | public static class RepositoryConfiguration 15 | { 16 | public static void Configure() 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/SysModuleConfiguration.cs: -------------------------------------------------------------------------------- 1 | using EZNEW.Module; 2 | using EZNEWApp.Module.Sys; 3 | 4 | namespace EZNEWApp.ModuleConfig.Sys 5 | { 6 | public class SysModuleConfiguration : IModuleConfiguration 7 | { 8 | public void Configure() 9 | { 10 | //服务注册配置 11 | DependencyInjectionConfiguration.Configure(); 12 | //对象映射配置 13 | ObjectMappingConfiguration.Configure(); 14 | //领域业务配置 15 | DomainConfiguration.Configure(); 16 | //仓储配置 17 | RepositoryConfiguration.Configure(); 18 | //数据配置 19 | DataConfiguration.Configure(); 20 | //查询配置 21 | QueryConfiguration.Configure(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/api/Modules/Sys/Libraries/EZNEWApp.ModuleConfig.Sys/build.bat: -------------------------------------------------------------------------------- 1 | set projectRootName=EZNEWApp 2 | set moduleName=Sys 3 | set configPath=%cd%\%projectRootName%.ModuleConfig.%moduleName%.csproj 4 | cd ../../ 5 | set topPath=%cd% 6 | 7 | cd Business 8 | for /f "delims=" %%i in ('dir /ad /b "%cd%"') do ( 9 | if exist %cd%\%%i\%%i.csproj ( 10 | dotnet add %configPath% reference %cd%\%%i\%%i.csproj 11 | ) 12 | ) 13 | 14 | cd %topPath% 15 | cd Domain 16 | for /f "delims=" %%i in ('dir /ad /b "%cd%"') do ( 17 | if exist %cd%\%%i\%%i.csproj ( 18 | dotnet add %configPath% reference %cd%\%%i\%%i.csproj 19 | ) 20 | ) 21 | 22 | cd %topPath% 23 | cd DataAccess 24 | for /f "delims=" %%i in ('dir /ad /b "%cd%"') do ( 25 | if exist %cd%\%%i\%%i.csproj ( 26 | dotnet add %configPath% reference %cd%\%%i\%%i.csproj 27 | ) 28 | ) 29 | 30 | cd %topPath% 31 | cd Model 32 | for /f "delims=" %%i in ('dir /ad /b "%cd%"') do ( 33 | if exist %cd%\%%i\%%i.csproj ( 34 | dotnet add %configPath% reference %cd%\%%i\%%i.csproj 35 | ) 36 | ) 37 | 38 | cd %topPath% 39 | cd AppService 40 | for /f "delims=" %%i in ('dir /ad /b "%cd%"') do ( 41 | if exist %cd%\%%i\%%i.csproj ( 42 | dotnet add %configPath% reference %cd%\%%i\%%i.csproj 43 | ) 44 | ) -------------------------------------------------------------------------------- /src/api/使用说明.txt: -------------------------------------------------------------------------------- 1 | 2 | 一:初始化默认数据库 3 | 4 | 项目中默认采用 SQLServer 数据库,若要切换到其它数据库请参考:http://eznew.net/start/quickstart#%E5%88%87%E6%8D%A2%E6%95%B0%E6%8D%AE%E5%BA%93 5 | 6 | 1,配置appsettings.json中的数据库连接字符串 7 | 2,打开命令行工具(cmd.exe) 8 | 3,运行命令 dotnet tool install --global dotnet-ef 9 | 4,在命令行工具导航到目录 Application/App.EntityMigration 10 | 5,运行命令 dotnet ef migrations add init 11 | 6,运行命令 dotnet ef database update 12 | 7,默认测试用户名和密码都是 admin 13 | 14 | 二:创建功能模块(以"Shop"为例) 15 | 16 | 1,调试运行项目 Application/App.CodeBuilder 17 | 2,根据提示选择创建功能分组,输入 1 18 | 3,输入模块名称 "Shop" 19 | 20 | 三:创建代码 21 | 22 | 1,创建实体(以"GoodsEntity"为例,默认建议实体统一以Entity结尾),实体的配置请参考默认模块"Sys"下的相关实体 23 | 2,调试运行项目 Application/App.CodeBuilder 24 | 3,根据提示选择创建代码,输入 2 25 | 4,输入要创建代码的实体名称,例如:GoodsEntity,多个实体以英文逗号(,)分隔 26 | 27 | 四:删除代码 28 | 29 | 会删除实体以外其它默认生成的相关代码 30 | 31 | 1,调试运行项目 Application/App.CodeBuilder 32 | 2,根据提示选择创建代码,输入3 33 | 3,输入要创建代码的实体名称,例如:GoodsEntity,多个实体以英文逗号(,)分隔 34 | -------------------------------------------------------------------------------- /src/web/.browserslistrc: -------------------------------------------------------------------------------- 1 | # 支持浏览器配置 2 | > 1% 3 | last 2 versions 4 | not dead 5 | 6 | -------------------------------------------------------------------------------- /src/web/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/web/.editorconfig: -------------------------------------------------------------------------------- 1 | # 编辑器配置 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /src/web/.eslintignore: -------------------------------------------------------------------------------- 1 | # .eslintignore 2 | 3 | src/assets 4 | src/icons 5 | public 6 | dist 7 | node_modules 8 | -------------------------------------------------------------------------------- /src/web/.eslintrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description .eslintrc.js 3 | */ 4 | 5 | module.exports = { 6 | root: true, 7 | env: { 8 | node: true, 9 | }, 10 | extends: ['plugin:vue/recommended', '@vue/prettier'], 11 | rules: { 12 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 13 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 14 | 'vue/no-v-html': 'off', 15 | 'vue/multi-word-component-names': 'off', 16 | 'vue/no-useless-template-attributes': 'off', 17 | }, 18 | parserOptions: { 19 | parser: 'babel-eslint', 20 | }, 21 | overrides: [ 22 | { 23 | files: [ 24 | '**/__tests__/*.{j,t}s?(x)', 25 | '**/tests/unit/**/*.spec.{j,t}s?(x)', 26 | ], 27 | env: { 28 | jest: true, 29 | }, 30 | }, 31 | ], 32 | } 33 | -------------------------------------------------------------------------------- /src/web/.gitattributes: -------------------------------------------------------------------------------- 1 | # .gitattributes 2 | *.html text eol=lf 3 | *.css text eol=lf 4 | *.js text eol=lf 5 | *.scss text eol=lf 6 | *.vue text eol=lf 7 | *.hbs text eol=lf 8 | *.sh text eol=lf 9 | *.md text eol=lf 10 | *.json text eol=lf 11 | *.yml text eol=lf 12 | *.js linguist-language=vue -------------------------------------------------------------------------------- /src/web/.gitignore: -------------------------------------------------------------------------------- 1 | # .gitignore 2 | .DS_Store 3 | node_modules 4 | dist 5 | .env.local 6 | .env.*.local 7 | npm-debug.log* 8 | yarn.lock 9 | yarn-debug.log* 10 | yarn-error.log* 11 | .idea 12 | *.suo 13 | *.ntvs* 14 | *.njsproj 15 | *.sln 16 | *.sw? 17 | public/video 18 | *.zip 19 | *.7z 20 | /src/layouts/components/zx-layouts 21 | /zx-templates 22 | /package-lock.json 23 | /src/styles/themes/green.scss 24 | /src/styles/themes/dark.scss 25 | /src/styles/themes/glory.scss 26 | 27 | -------------------------------------------------------------------------------- /src/web/.stylelintrc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description stylelint 3 | */ 4 | module.exports = { 5 | extends: ['stylelint-config-recess-order', 'stylelint-config-prettier'], 6 | } 7 | -------------------------------------------------------------------------------- /src/web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM nginx 2 | 3 | # 环境变量 4 | ENV TZ=Asia/Shanghai \ 5 | RUN_USER=nginx \ 6 | RUN_GROUP=nginx \ 7 | DATA_DIR=/data/web \ 8 | LOG_DIR=/data/log/nginx 9 | 10 | # 工作目录 11 | WORKDIR ${DATA_DIR} 12 | 13 | # 切换为上海时区 14 | RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ 15 | && echo $TZ > /etc/timezone 16 | 17 | # 创建日志文件夹 18 | RUN mkdir ${LOG_DIR} -p 19 | RUN chown nginx.nginx -R ${LOG_DIR} 20 | 21 | # 拷贝dist包文件 22 | COPY ./dist ./ 23 | 24 | # 拷贝nginx配置文件 25 | ADD nginx.conf /etc/nginx/nginx.conf 26 | ADD nginx.default.conf /etc/nginx/conf.d/default.conf 27 | 28 | EXPOSE 80 29 | 30 | ENTRYPOINT nginx -g "daemon off;" 31 | -------------------------------------------------------------------------------- /src/web/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 good luck 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/web/babel.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description babel.config 3 | */ 4 | let plugins = [] 5 | if (process.env.NODE_ENV !== 'development') { 6 | plugins.push('transform-remove-console') 7 | } 8 | module.exports = { 9 | presets: ['@vue/cli-plugin-babel/preset'], 10 | plugins, 11 | } 12 | -------------------------------------------------------------------------------- /src/web/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes auto; 3 | pid /var/run/nginx.pid; 4 | 5 | events { 6 | use epoll; 7 | worker_connections 51200; 8 | multi_accept on; 9 | } 10 | 11 | http { 12 | include /etc/nginx/mime.types; 13 | default_type application/octet-stream; 14 | 15 | server_names_hash_bucket_size 512; 16 | client_header_buffer_size 32k; 17 | large_client_header_buffers 4 32k; 18 | client_max_body_size 50m; 19 | 20 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 21 | '$status $body_bytes_sent "$http_referer" ' 22 | '"$http_user_agent" "$http_x_forwarded_for"'; 23 | access_log /var/log/nginx/access.log main; 24 | sendfile on; 25 | tcp_nopush on; 26 | tcp_nodelay on; 27 | 28 | keepalive_timeout 65; 29 | 30 | # gzip 压缩 31 | gzip on; 32 | gzip_min_length 1k; 33 | gzip_buffers 4 16k; 34 | gzip_http_version 1.1; 35 | gzip_comp_level 2; 36 | gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml; 37 | gzip_vary on; 38 | gzip_proxied expired no-cache no-store private auth; 39 | gzip_disable "MSIE [1-6]\."; 40 | 41 | limit_conn_zone $binary_remote_addr zone=perip:10m; 42 | limit_conn_zone $server_name zone=perserver:10m; 43 | 44 | include /etc/nginx/conf.d/*.conf; 45 | } 46 | -------------------------------------------------------------------------------- /src/web/nginx.default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | 5 | access_log /data/log/nginx/access.log main; 6 | error_log /data/log/nginx/error.log; 7 | 8 | # 静态资源 9 | location / { 10 | root /data/web; 11 | index index.html index.htm; 12 | try_files $uri $uri/ /index.html; 13 | } 14 | 15 | # 前端代理 16 | # location ^~ /后端服务名 { 17 | # proxy_pass http://后端服务IP地址:8080; 18 | # add_header Access-Control-Allow-Origin *; 19 | # add_header Access-Control-Allow-Credentials: true; 20 | # add_header Access-Control-Allow-Methods GET,POST,OPTIONS,PUT,DELETE; 21 | 22 | # proxy_http_version 1.1; 23 | # # 连接延时 24 | # proxy_connect_timeout 3600s; 25 | # proxy_read_timeout 3600s; 26 | # proxy_send_timeout 3600s; 27 | # # IP 穿透 28 | # proxy_set_header Host $proxy_host; 29 | # proxy_set_header X-Real-IP $remote_addr; 30 | # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 31 | # # WebSocket 穿透 32 | # proxy_set_header Origin ""; 33 | # proxy_set_header Upgrade $http_upgrade; 34 | # proxy_set_header Connection "upgrade"; 35 | # } 36 | 37 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 38 | #location ~ \.php$ { 39 | # root html; 40 | # fastcgi_pass 127.0.0.1:9000; 41 | # fastcgi_index index.php; 42 | # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 43 | # include fastcgi_params; 44 | #} 45 | } 46 | 47 | -------------------------------------------------------------------------------- /src/web/plopfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 代码生成机 3 | */ 4 | const viewGenerator = require('zx-templates/view/prompt') 5 | const curdGenerator = require('zx-templates/curd/prompt') 6 | const componentGenerator = require('zx-templates/component/prompt') 7 | const mockGenerator = require('zx-templates/mock/prompt') 8 | const vuexGenerator = require('zx-templates/vuex/prompt') 9 | module.exports = (plop) => { 10 | plop.setGenerator('view', viewGenerator) 11 | plop.setGenerator('curd', curdGenerator) 12 | plop.setGenerator('component', componentGenerator) 13 | plop.setGenerator('mock&api', mockGenerator) 14 | plop.setGenerator('vuex', vuexGenerator) 15 | } 16 | -------------------------------------------------------------------------------- /src/web/prettier.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 代码规范 3 | */ 4 | 5 | module.exports = { 6 | printWidth: 80, 7 | tabWidth: 2, 8 | useTabs: false, 9 | semi: false, 10 | singleQuote: true, 11 | quoteProps: 'as-needed', 12 | jsxSingleQuote: false, 13 | trailingComma: 'es5', 14 | bracketSpacing: true, 15 | arrowParens: 'always', 16 | htmlWhitespaceSensitivity: 'ignore', 17 | vueIndentScriptAndStyle: true, 18 | endOfLine: 'lf', 19 | } 20 | -------------------------------------------------------------------------------- /src/web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/public/favicon.ico -------------------------------------------------------------------------------- /src/web/public/favicon_backup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/public/favicon_backup.ico -------------------------------------------------------------------------------- /src/web/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= VUE_APP_TITLE %> 9 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 非常抱歉鉴于安全考量,您无法查看<%= VUE_APP_TITLE %> 23 | 源代码 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | <%= VUE_APP_TITLE %> 36 | 37 | 38 | 44 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/web/public/static/css/loading.css: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 雪花屏代码,基于ant-design修改 3 | **/ 4 | .first-loading-wrp { 5 | display: flex; 6 | flex-direction: column; 7 | align-items: center; 8 | justify-content: center; 9 | height: 90vh; 10 | min-height: 90vh; 11 | } 12 | 13 | .first-loading-wrp > h1 { 14 | font-size: 30px; 15 | font-weight: bolder; 16 | } 17 | 18 | .first-loading-wrp .loading-wrp { 19 | display: flex; 20 | align-items: center; 21 | justify-content: center; 22 | padding: 98px; 23 | } 24 | 25 | .dot { 26 | position: relative; 27 | box-sizing: border-box; 28 | display: inline-block; 29 | width: 64px; 30 | height: 64px; 31 | font-size: 64px; 32 | transform: rotate(45deg); 33 | animation: antRotate 1.2s infinite linear; 34 | } 35 | 36 | .dot i { 37 | position: absolute; 38 | display: block; 39 | width: 28px; 40 | height: 28px; 41 | background-color: #1890ff; 42 | border-radius: 100%; 43 | opacity: 0.3; 44 | transform: scale(0.75); 45 | transform-origin: 50% 50%; 46 | animation: antSpinMove 1s infinite linear alternate; 47 | } 48 | 49 | .dot i:nth-child(1) { 50 | top: 0; 51 | left: 0; 52 | } 53 | 54 | .dot i:nth-child(2) { 55 | top: 0; 56 | right: 0; 57 | -webkit-animation-delay: 0.4s; 58 | animation-delay: 0.4s; 59 | } 60 | 61 | .dot i:nth-child(3) { 62 | right: 0; 63 | bottom: 0; 64 | -webkit-animation-delay: 0.8s; 65 | animation-delay: 0.8s; 66 | } 67 | 68 | .dot i:nth-child(4) { 69 | bottom: 0; 70 | left: 0; 71 | -webkit-animation-delay: 1.2s; 72 | animation-delay: 1.2s; 73 | } 74 | 75 | @keyframes antRotate { 76 | to { 77 | -webkit-transform: rotate(405deg); 78 | transform: rotate(405deg); 79 | } 80 | } 81 | 82 | @-webkit-keyframes antRotate { 83 | to { 84 | -webkit-transform: rotate(405deg); 85 | transform: rotate(405deg); 86 | } 87 | } 88 | 89 | @keyframes antSpinMove { 90 | to { 91 | opacity: 1; 92 | } 93 | } 94 | 95 | @-webkit-keyframes antSpinMove { 96 | to { 97 | opacity: 1; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/web/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /src/web/src/api/colorfulIcon.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getIconList(data) { 4 | return request({ 5 | url: '/colorfulIcon/getList', 6 | method: 'post', 7 | data, 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /src/web/src/api/publicKey.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getPublicKey() { 4 | return request({ 5 | url: '/security/publicKey', 6 | method: 'get', 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /src/web/src/api/router.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getRouterList(data) { 4 | return request({ 5 | url: '/menu/navigate', 6 | method: 'post', 7 | data, 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /src/web/src/api/sys/menu.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //查询菜单 4 | export async function doQueryMenu(filter) { 5 | return await request({ 6 | url: '/menu/query', 7 | method: 'post', 8 | data: filter, 9 | }) 10 | } 11 | 12 | //获取菜单配置 13 | export async function doGetMenuConfig() { 14 | return await request({ 15 | url: '/menu/config', 16 | method: 'get', 17 | }) 18 | } 19 | 20 | //保存菜单 21 | export async function doSaveMenu(saveInfo) { 22 | return await request({ 23 | url: '/menu/save', 24 | method: 'post', 25 | data: saveInfo, 26 | }) 27 | } 28 | 29 | //删除菜单 30 | export async function doDeleteMenu(dataKeys) { 31 | return await request({ 32 | url: '/menu/delete', 33 | method: 'post', 34 | data: { 35 | ids: dataKeys, 36 | }, 37 | }) 38 | } 39 | 40 | //添加菜单权限 41 | export async function doAddMenuPermission(menuPermissions) { 42 | return await request({ 43 | url: '/menu/permission/add', 44 | method: 'post', 45 | data: menuPermissions, 46 | }) 47 | } 48 | 49 | //删除菜单权限 50 | export async function doDeleteMenuPermission(menuPermissions) { 51 | return await request({ 52 | url: '/menu/permission/delete', 53 | method: 'post', 54 | data: menuPermissions, 55 | }) 56 | } 57 | 58 | //清除菜单权限 59 | export async function doClearMenuPermission(menuIds) { 60 | return await request({ 61 | url: '/menu/permission/clear', 62 | method: 'post', 63 | data: menuIds, 64 | }) 65 | } 66 | -------------------------------------------------------------------------------- /src/web/src/api/sys/menuPermission.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //添加菜单权限 4 | export async function doAddMenuPermission(menuPermissions) { 5 | return await request({ 6 | url: '/menu-permission/add', 7 | method: 'post', 8 | data: menuPermissions, 9 | }) 10 | } 11 | 12 | //删除菜单权限 13 | export async function doDeleteMenuPermission(menuPermissions) { 14 | return await request({ 15 | url: '/menu-permission/delete', 16 | method: 'post', 17 | data: menuPermissions, 18 | }) 19 | } 20 | 21 | //根据菜单数据清除菜单权限 22 | export async function doClearByMenu(menuIds) { 23 | return await request({ 24 | url: '/menu-permission/clear-by-menu', 25 | method: 'post', 26 | data: menuIds, 27 | }) 28 | } 29 | 30 | //根据菜单数据清除菜单权限 31 | export async function doClearByPermission(permissionIds) { 32 | return await request({ 33 | url: '/menu-permission/clear-by-permission', 34 | method: 'post', 35 | data: permissionIds, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /src/web/src/api/sys/operation.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //查询操作 4 | export async function doQueryOperation(filter) { 5 | return await request({ 6 | url: '/operation/query', 7 | method: 'post', 8 | data: filter, 9 | }) 10 | } 11 | 12 | //保存操作 13 | export async function doSaveOperation(saveInfo) { 14 | return await request({ 15 | url: '/operation/save', 16 | method: 'post', 17 | data: saveInfo, 18 | }) 19 | } 20 | 21 | //获取操作配置 22 | export async function doGetOperationConfig() { 23 | return await request({ 24 | url: '/operation/config', 25 | method: 'get', 26 | }) 27 | } 28 | 29 | //删除操作 30 | export async function doDeleteOperation(keys) { 31 | return await request({ 32 | url: '/operation/delete', 33 | method: 'post', 34 | data: { 35 | ids: keys, 36 | }, 37 | }) 38 | } 39 | 40 | //添加操作权限 41 | export async function doAddOperationPermission(operationPermissions) { 42 | return await request({ 43 | url: '/operation/permission/add', 44 | method: 'post', 45 | data: operationPermissions, 46 | }) 47 | } 48 | 49 | //删除操作权限 50 | export async function doDeleteOperationPermission(operationPermissions) { 51 | return await request({ 52 | url: '/operation/permission/delete', 53 | method: 'post', 54 | data: operationPermissions, 55 | }) 56 | } 57 | 58 | //清除操作权限 59 | export async function doClearOperationPermission(operationIds) { 60 | return await request({ 61 | url: '/operation/permission/clear', 62 | method: 'post', 63 | data: operationIds, 64 | }) 65 | } 66 | -------------------------------------------------------------------------------- /src/web/src/api/sys/operationGroup.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //查询功能分组 4 | export async function doQueryOperationGroup(filter) { 5 | return await request({ 6 | url: '/operationGroup/query', 7 | method: 'post', 8 | data: filter, 9 | }) 10 | } 11 | 12 | //保存功能组 13 | export async function doSaveOperationGroup(saveInfo) { 14 | return await request({ 15 | url: '/operationGroup/save', 16 | method: 'post', 17 | data: saveInfo, 18 | }) 19 | } 20 | 21 | //检查分组名称 22 | export async function doCheckOperationGroupName(checkInfo) { 23 | return await request({ 24 | url: '/operationGroup/check-name', 25 | method: 'post', 26 | data: checkInfo, 27 | }) 28 | } 29 | 30 | //删除分组 31 | export async function doDeleteOperationGroup(groupIds) { 32 | return await request({ 33 | url: '/operationGroup/delete', 34 | method: 'post', 35 | data: { 36 | ids: groupIds, 37 | }, 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /src/web/src/api/sys/operationPermission.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //添加功能权限 4 | export async function doAddOperationPermission(operationPermissions) { 5 | return await request({ 6 | url: '/operation-permission/add', 7 | method: 'post', 8 | data: operationPermissions, 9 | }) 10 | } 11 | 12 | //删除功能权限 13 | export async function doDeleteOperationPermission(operationPermissions) { 14 | return await request({ 15 | url: '/operation-permission/delete', 16 | method: 'post', 17 | data: operationPermissions, 18 | }) 19 | } 20 | 21 | //根据功能数据清除功能权限 22 | export async function doClearByOperation(operationIds) { 23 | return await request({ 24 | url: '/operation-permission/clear-by-operation', 25 | method: 'post', 26 | data: operationIds, 27 | }) 28 | } 29 | 30 | //根据功能数据清除功能权限 31 | export async function doClearByPermission(permissionIds) { 32 | return await request({ 33 | url: '/operation-permission/clear-by-permission', 34 | method: 'post', 35 | data: permissionIds, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /src/web/src/api/sys/permission.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //查询权限 4 | export async function doQueryPermission(filter) { 5 | return await request({ 6 | url: '/permission/query', 7 | method: 'post', 8 | data: filter, 9 | }) 10 | } 11 | 12 | //保存权限 13 | export async function doSavePermission(saveInfo) { 14 | return await request({ 15 | url: '/permission/save', 16 | method: 'post', 17 | data: saveInfo, 18 | }) 19 | } 20 | 21 | //获取权限配置 22 | export async function doGetPermissionConfig() { 23 | return await request({ 24 | url: '/permission/config', 25 | method: 'get', 26 | }) 27 | } 28 | 29 | //删除权限 30 | export async function doDeletePermission(keys) { 31 | return await request({ 32 | url: '/permission/delete', 33 | method: 'post', 34 | data: { 35 | ids: keys, 36 | }, 37 | }) 38 | } 39 | 40 | //添加菜单权限 41 | export async function doAddMenuPermission(menuPermissionInfo) { 42 | return await request({ 43 | url: '/permission/menu/add', 44 | method: 'post', 45 | data: menuPermissionInfo, 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /src/web/src/api/sys/permissionGroup.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //查询权限分组 4 | export async function doQueryPermissionGroup(filter) { 5 | return await request({ 6 | url: '/permissionGroup/query', 7 | method: 'post', 8 | data: filter, 9 | }) 10 | } 11 | 12 | //保存权限分组 13 | export async function doSavePermissionGroup(saveInfo) { 14 | return await request({ 15 | url: '/permissionGroup/save', 16 | method: 'post', 17 | data: saveInfo, 18 | }) 19 | } 20 | 21 | //检查分组名称 22 | export async function doCheckPermissionGroupName(checkInfo) { 23 | return await request({ 24 | url: '/permissionGroup/check-name', 25 | method: 'post', 26 | data: checkInfo, 27 | }) 28 | } 29 | 30 | //删除分组 31 | export async function doDeletePermissionGroup(groupIds) { 32 | return await request({ 33 | url: '/permissionGroup/delete', 34 | method: 'post', 35 | data: { 36 | ids: groupIds, 37 | }, 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /src/web/src/api/sys/role.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //获取角色配置 4 | export async function doGetRoleConfig() { 5 | return await request({ 6 | url: '/role/config', 7 | method: 'get', 8 | }) 9 | } 10 | 11 | //查询角色数据 12 | export async function doQueryRole(searchInfo) { 13 | return await request({ 14 | url: '/role/query', 15 | method: 'post', 16 | data: searchInfo, 17 | }) 18 | } 19 | 20 | //删除角色 21 | export async function doDeleteRole(roleIds) { 22 | return await request({ 23 | url: '/role/delete', 24 | method: 'post', 25 | data: { 26 | ids: roleIds, 27 | }, 28 | }) 29 | } 30 | 31 | //保存角色 32 | export async function doSaveRole(roleData) { 33 | return await request({ 34 | url: '/role/save', 35 | method: 'post', 36 | data: roleData, 37 | }) 38 | } 39 | 40 | //检查角色名称 41 | export async function doCheckRoleName(checkInfo) { 42 | return await request({ 43 | url: '/role/check-name', 44 | method: 'post', 45 | data: checkInfo, 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /src/web/src/api/sys/rolePermission.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //添加角色权限 4 | export async function doAddRolePermission(rolePermissions) { 5 | return await request({ 6 | url: '/role-permission/add', 7 | method: 'post', 8 | data: rolePermissions, 9 | }) 10 | } 11 | 12 | //删除角色权限 13 | export async function doDeleteRolePermission(rolePermissions) { 14 | return await request({ 15 | url: '/role-permission/delete', 16 | method: 'post', 17 | data: rolePermissions, 18 | }) 19 | } 20 | 21 | //根据角色数据清除角色权限 22 | export async function doClearByRole(roleIds) { 23 | return await request({ 24 | url: '/role-permission/clear-by-role', 25 | method: 'post', 26 | data: roleIds, 27 | }) 28 | } 29 | 30 | //根据角色数据清除角色权限 31 | export async function doClearByPermission(permissionIds) { 32 | return await request({ 33 | url: '/role-permission/clear-by-permission', 34 | method: 'post', 35 | data: permissionIds, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /src/web/src/api/sys/user.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | import { encryptedData } from '@/utils/encrypt' 3 | import { loginRSA } from '@/config' 4 | 5 | //登录 6 | export async function doLogin(data) { 7 | if (loginRSA) { 8 | data = await encryptedData(data) 9 | data = data.param 10 | } 11 | return await request({ 12 | url: '/account/login', 13 | method: 'post', 14 | headers: { 15 | 'Content-Type': 'text/plain', 16 | }, 17 | data, 18 | }) 19 | } 20 | 21 | //获取登录用户信息 22 | export async function doGetLoginUserInfo() { 23 | return await request({ 24 | url: '/user/current/info', 25 | method: 'get', 26 | }) 27 | } 28 | 29 | //退出登录 30 | export async function doLogout() { 31 | return await request({ 32 | url: '/account/logout', 33 | method: 'get', 34 | }) 35 | } 36 | 37 | //搜索用户 38 | export async function doQueryUser(searchInfo) { 39 | return await request({ 40 | url: '/user/query', 41 | method: 'post', 42 | data: searchInfo, 43 | }) 44 | } 45 | 46 | //删除用户 47 | export async function doDeleteUser(userIds) { 48 | return await request({ 49 | url: '/user/delete', 50 | method: 'post', 51 | data: { 52 | ids: userIds, 53 | }, 54 | }) 55 | } 56 | 57 | //保存用户 58 | export async function doSaveUser(userData) { 59 | return await request({ 60 | url: '/user/save', 61 | method: 'post', 62 | data: userData, 63 | }) 64 | } 65 | 66 | //检查用户名称 67 | export async function doCheckUserName(checkInfo) { 68 | return await request({ 69 | url: '/user/check-user-name', 70 | method: 'post', 71 | data: checkInfo, 72 | }) 73 | } 74 | 75 | //获取用户配置 76 | export async function doGetUserConfig() { 77 | return await request({ 78 | url: '/user/config', 79 | method: 'get', 80 | }) 81 | } 82 | -------------------------------------------------------------------------------- /src/web/src/api/sys/userPermission.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //添加用户权限 4 | export async function doAddUserPermission(userPermissions) { 5 | return await request({ 6 | url: '/user-permission/add', 7 | method: 'post', 8 | data: userPermissions, 9 | }) 10 | } 11 | 12 | //删除用户权限 13 | export async function doDeleteUserPermission(userPermissions) { 14 | return await request({ 15 | url: '/user-permission/delete', 16 | method: 'post', 17 | data: userPermissions, 18 | }) 19 | } 20 | 21 | //根据用户数据清除用户权限 22 | export async function doClearByUser(userIds) { 23 | return await request({ 24 | url: '/user-permission/clear-by-user', 25 | method: 'post', 26 | data: userIds, 27 | }) 28 | } 29 | 30 | //根据用户数据清除用户权限 31 | export async function doClearByPermission(permissionIds) { 32 | return await request({ 33 | url: '/user-permission/clear-by-permission', 34 | method: 'post', 35 | data: permissionIds, 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /src/web/src/api/sys/userRole.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | //添加用户角色 4 | export async function doAddUserRole(userRoles) { 5 | return await request({ 6 | url: '/user-role/add', 7 | method: 'post', 8 | data: userRoles, 9 | }) 10 | } 11 | //移除用户角色 12 | export async function doDeleteUserRole(userRoles) { 13 | return await request({ 14 | url: '/user-role/delete', 15 | method: 'post', 16 | data: userRoles, 17 | }) 18 | } 19 | //清除用户角色 20 | export async function doClearByUser(userIds) { 21 | return await request({ 22 | url: '/user-role/clear-by-user', 23 | method: 'post', 24 | data: userIds, 25 | }) 26 | } 27 | //清除角色用户 28 | export async function doClearByRole(roleIds) { 29 | return await request({ 30 | url: '/user-role/clear-by-role', 31 | method: 'post', 32 | data: roleIds, 33 | }) 34 | } 35 | -------------------------------------------------------------------------------- /src/web/src/assets/error_images/401.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/error_images/401.png -------------------------------------------------------------------------------- /src/web/src/assets/error_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/error_images/404.png -------------------------------------------------------------------------------- /src/web/src/assets/error_images/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/error_images/cloud.png -------------------------------------------------------------------------------- /src/web/src/assets/flogo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/flogo1.png -------------------------------------------------------------------------------- /src/web/src/assets/login_images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/login_images/background.jpg -------------------------------------------------------------------------------- /src/web/src/assets/qr_logo/lqr_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/six-net/Samples/6d8d14c09b46a72c595d2e822727ed62ebc72469/src/web/src/assets/qr_logo/lqr_logo.png -------------------------------------------------------------------------------- /src/web/src/colorfulIcon/index.js: -------------------------------------------------------------------------------- 1 | const req = require.context('./svg', false, /\.svg$/), 2 | requireAll = (requireContext) => { 3 | /*let a = requireContext.keys().map(requireContext); 4 | let arr = []; 5 | for (let i = 0; i < a.length; i++) { 6 | console.log(); 7 | let icon = a[i].default.id; 8 | arr.push(icon); 9 | } 10 | console.log(JSON.stringify(arr));*/ 11 | return requireContext.keys().map(requireContext) 12 | } 13 | requireAll(req) 14 | -------------------------------------------------------------------------------- /src/web/src/colorfulIcon/svg/alphabetical_sorting.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/web/src/colorfulIcon/svg/vab.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/web/src/components/EzPagination/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 52 | -------------------------------------------------------------------------------- /src/web/src/components/VabSnow/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 26 | 27 | 83 | -------------------------------------------------------------------------------- /src/web/src/config/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3个子配置,通用配置|主题配置|网络配置导出 3 | */ 4 | const setting = require('./setting.config') 5 | const theme = require('./theme.config') 6 | const network = require('./net.config') 7 | module.exports = Object.assign({}, setting, theme, network) 8 | -------------------------------------------------------------------------------- /src/web/src/config/net.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导出默认网路配置 3 | **/ 4 | const network = { 5 | // 默认的接口地址 如果是开发环境和生产环境走vab-mock-server,当然你也可以选择自己配置成需要的接口地址 6 | baseURL: 7 | process.env.NODE_ENV === 'development' 8 | ? 'http://localhost:5000/api' 9 | : 'http://localhost:5000/api', 10 | //配后端数据的接收方式application/json;charset=UTF-8或者application/x-www-form-urlencoded;charset=UTF-8 11 | contentType: 'application/json;charset=UTF-8', 12 | //消息框消失时间 13 | messageDuration: 3000, 14 | //最长请求时间 15 | requestTimeout: 60000, 16 | //操作正常code,支持String、Array、int多种类型 17 | successCode: [200, 0, '200'], 18 | //登录失效code 19 | invalidCode: 402, 20 | //无权限code 21 | noPermissionCode: 401, 22 | } 23 | module.exports = network 24 | -------------------------------------------------------------------------------- /src/web/src/config/permission.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 路由守卫,目前两种模式:all模式与intelligence模式 3 | */ 4 | import router from '@/router' 5 | import store from '@/store' 6 | import VabProgress from 'nprogress' 7 | import 'nprogress/nprogress.css' 8 | import getPageTitle from '@/utils/pageTitle' 9 | import { 10 | authentication, 11 | loginInterception, 12 | progressBar, 13 | recordRoute, 14 | routesWhiteList, 15 | } from '@/config' 16 | 17 | VabProgress.configure({ 18 | easing: 'ease', 19 | speed: 500, 20 | trickleSpeed: 200, 21 | showSpinner: false, 22 | }) 23 | router.beforeResolve(async (to, from, next) => { 24 | if (progressBar) VabProgress.start() 25 | let hasToken = store.getters['sys/user/accessToken'] 26 | 27 | if (!loginInterception) hasToken = true 28 | 29 | if (hasToken) { 30 | if (to.path === '/login') { 31 | next({ path: '/' }) 32 | if (progressBar) VabProgress.done() 33 | } else { 34 | const hasPermissions = 35 | store.getters['sys/user/permissions'] && 36 | store.getters['sys/user/permissions'].length > 0 37 | if (hasPermissions) { 38 | next() 39 | } else { 40 | try { 41 | let permissions 42 | if (!loginInterception) { 43 | //settings.js loginInterception为false时,创建虚拟权限 44 | await store.dispatch('sys/user/setPermissions', ['admin']) 45 | permissions = ['admin'] 46 | } else { 47 | permissions = await store.dispatch('sys/user/getUserInfo') 48 | } 49 | 50 | let accessRoutes = [] 51 | if (authentication === 'intelligence') { 52 | accessRoutes = await store.dispatch('routes/setRoutes', permissions) 53 | } else if (authentication === 'all') { 54 | accessRoutes = await store.dispatch('routes/setAllRoutes') 55 | } 56 | accessRoutes.forEach((item) => { 57 | router.addRoute(item) 58 | }) 59 | next({ ...to, replace: true }) 60 | } catch { 61 | await store.dispatch('sys/user/resetAccessToken') 62 | if (progressBar) VabProgress.done() 63 | } 64 | } 65 | } 66 | } else { 67 | if (routesWhiteList.indexOf(to.path) !== -1) { 68 | next() 69 | } else { 70 | if (recordRoute) { 71 | next(`/login?redirect=${to.path}`) 72 | } else { 73 | next('/login') 74 | } 75 | 76 | if (progressBar) VabProgress.done() 77 | } 78 | } 79 | document.title = getPageTitle(to.meta.title) 80 | }) 81 | router.afterEach(() => { 82 | if (progressBar) VabProgress.done() 83 | }) 84 | -------------------------------------------------------------------------------- /src/web/src/config/setting.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导出默认通用配置 3 | */ 4 | const setting = { 5 | // 开发以及部署时的URL 6 | publicPath: '', 7 | // 生产环境构建文件的目录名 8 | outputDir: 'dist', 9 | // 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。 10 | assetsDir: 'static', 11 | // 开发环境每次保存时是否输出为eslint编译警告 12 | lintOnSave: true, 13 | // 进行编译的依赖 14 | transpileDependencies: [], 15 | //标题 (包括初次加载雪花屏的标题 页面的标题 浏览器的标题) 16 | title: 'EZNEW.NET', 17 | //简写 18 | abbreviation: 'vab', 19 | //开发环境端口号 20 | devPort: '81', 21 | //版本号 22 | version: process.env.VUE_APP_VERSION, 23 | //这一项非常重要!请务必保留MIT协议下package.json及copyright作者信息 即可免费商用,不遵守此项约定你将无法使用该框架,如需自定义版权信息请联系QQ1204505056 24 | 0: 'vab', 25 | //是否显示页面底部自定义版权信息 26 | footerCopyright: true, 27 | //是否显示顶部进度条 28 | progressBar: true, 29 | //缓存路由的最大数量 30 | keepAliveMaxNum: 99, 31 | // 路由模式,可选值为 history 或 hash 32 | routerMode: 'hash', 33 | //不经过token校验的路由 34 | routesWhiteList: ['/login', '/register', '/404', '/401'], 35 | //加载时显示文字 36 | loadingText: '正在加载中...', 37 | //token名称 38 | tokenName: 'token', 39 | //token在localStorage、sessionStorage存储的key的名称 40 | tokenTableName: 'eznew-token-table-name', 41 | //token存储位置localStorage sessionStorage 42 | storage: 'localStorage', 43 | //token失效回退到登录页时是否记录本次的路由 44 | recordRoute: true, 45 | //是否显示logo,不显示时设置false,显示时请填写remixIcon图标名称,暂时只支持设置remixIcon 46 | logo: 'vuejs-fill', 47 | //是否显示在页面高亮错误 48 | errorLog: ['development', 'production'], 49 | //是否开启登录拦截 50 | loginInterception: true, 51 | //是否开启登录RSA加密 52 | loginRSA: true, 53 | //intelligence和all两种方式,前者后端权限只控制permissions不控制view文件的import(前后端配合,减轻后端工作量),all方式完全交给后端前端只负责加载 54 | authentication: 'intelligence', 55 | //vertical布局时是否只保持一个子菜单的展开 56 | uniqueOpened: true, 57 | //vertical布局时默认展开的菜单path,使用逗号隔开建议只展开一个 58 | defaultOopeneds: ['/vab'], 59 | //需要加loading层的请求,防止重复提交 60 | debounce: ['doEdit'], 61 | //需要自动注入并加载的模块 62 | providePlugin: { maptalks: 'maptalks', 'window.maptalks': 'maptalks' }, 63 | //npm run build时是否自动生成7z压缩包 64 | build7z: false, 65 | //代码生成机生成在view下的文件夹名称 66 | templateFolder: 'project', 67 | //是否显示终端donation打印 68 | donation: false, 69 | } 70 | module.exports = setting 71 | -------------------------------------------------------------------------------- /src/web/src/config/settings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 3个子配置,通用配置|主题配置|网络配置 3 | */ 4 | //默认配置 5 | const { setting, theme, network } = require('./') 6 | module.exports = Object.assign({}, setting, theme, network) 7 | -------------------------------------------------------------------------------- /src/web/src/config/theme.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导出默认主题配置 3 | */ 4 | const theme = { 5 | //是否国定头部 固定fixed 不固定noFixed 6 | header: 'fixed', 7 | //横纵布局 horizontal vertical 8 | layout: 'vertical', 9 | //是否开启主题配置按钮 10 | themeBar: true, 11 | //是否显示多标签页 12 | tabsBar: true, 13 | } 14 | module.exports = theme 15 | -------------------------------------------------------------------------------- /src/web/src/layouts/EmptyLayout.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/web/src/layouts/components/VabAvatar/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ username }} 8 | 9 | 10 | 11 | 12 | 13 | 退出登录 14 | 15 | 16 | 17 | 18 | 59 | 84 | -------------------------------------------------------------------------------- /src/web/src/layouts/components/VabBreadcrumb/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ item.meta.title }} 5 | 6 | 7 | 8 | 9 | 31 | 32 | 64 | -------------------------------------------------------------------------------- /src/web/src/layouts/components/VabLogo/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 10 | 17 | 18 | 19 | 20 | 38 | 97 | -------------------------------------------------------------------------------- /src/web/src/layouts/export.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 公共布局及样式自动引入 3 | */ 4 | 5 | import Vue from 'vue' 6 | 7 | const requireComponents = require.context('./components', true, /\.vue$/) 8 | requireComponents.keys().forEach((fileName) => { 9 | const componentConfig = requireComponents(fileName) 10 | const componentName = componentConfig.default.name 11 | Vue.component(componentName, componentConfig.default || componentConfig) 12 | }) 13 | 14 | const requireZxLayouts = require.context('zx-layouts', true, /\.vue$/) 15 | requireZxLayouts.keys().forEach((fileName) => { 16 | const componentConfig = requireZxLayouts(fileName) 17 | const componentName = componentConfig.default.name 18 | Vue.component(componentName, componentConfig.default || componentConfig) 19 | }) 20 | 21 | const requireThemes = require.context('@/styles/themes', true, /\.scss$/) 22 | requireThemes.keys().forEach((fileName) => { 23 | require(`@/styles/themes/${fileName.slice(2)}`) 24 | }) 25 | -------------------------------------------------------------------------------- /src/web/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | import store from './store' 4 | import router from './router' 5 | import './plugins' 6 | import '@/layouts/export' 7 | /** 8 | * @description 生产环境默认都使用mock,如果正式用于生产环境时,记得去掉 9 | */ 10 | 11 | if (process.env.NODE_ENV === 'production') { 12 | const { mockXHR } = require('@/utils/static') 13 | mockXHR() 14 | } 15 | 16 | Vue.config.productionTip = false 17 | 18 | new Vue({ 19 | el: '#eznew-net', 20 | router, 21 | store, 22 | render: (h) => h(App), 23 | }) 24 | -------------------------------------------------------------------------------- /src/web/src/plugins/element.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import ElementUI from 'element-ui' 3 | import 'element-ui/lib/theme-chalk/display.css' 4 | 5 | import '@/styles/element-variables.scss' 6 | 7 | Vue.use(ElementUI, { 8 | size: 'small', 9 | }) 10 | -------------------------------------------------------------------------------- /src/web/src/plugins/index.js: -------------------------------------------------------------------------------- 1 | /* 公共引入,勿随意修改,修改时需经过确认 */ 2 | import Vue from 'vue' 3 | import './element' 4 | import './support' 5 | import '@/styles/vab.scss' 6 | import '@/remixIcon' 7 | import '@/colorfulIcon' 8 | import '@/config/permission' 9 | import '@/utils/errorLog' 10 | import './vabIcon' 11 | import VabPermissions from 'zx-layouts/Permissions' 12 | import Vab from '@/utils/vab' 13 | import VabCount from 'zx-count' 14 | 15 | Vue.use(Vab) 16 | Vue.use(VabPermissions) 17 | Vue.use(VabCount) 18 | -------------------------------------------------------------------------------- /src/web/src/plugins/support.js: -------------------------------------------------------------------------------- 1 | import { MessageBox } from 'element-ui' 2 | import { donation } from '@/config' 3 | import { dependencies, repository } from '../../package.json' 4 | 5 | if (!!window.ActiveXObject || 'ActiveXObject' in window) { 6 | MessageBox({ 7 | title: '温馨提示', 8 | message: 9 | '自2015年3月起,微软已宣布弃用IE,且不再对IE提供任何更新维护,请点击此处访问微软官网更新浏览器,如果您使用的是双核浏览器,请您切换浏览器内核为极速模式', 10 | type: 'warning', 11 | showClose: false, 12 | showConfirmButton: false, 13 | closeOnClickModal: false, 14 | closeOnPressEscape: false, 15 | closeOnHashChange: false, 16 | dangerouslyUseHTMLString: true, 17 | }) 18 | } 19 | if (!dependencies['vab-icon'] || !dependencies['zx-layouts']) 20 | document.body.innerHTML = '' 21 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabIcon.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VabIcon from 'vab-icon' 3 | 4 | Vue.component('VabIcon', VabIcon) 5 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabMagnifier.js: -------------------------------------------------------------------------------- 1 | import VabMagnifier from 'zx-magnifie' 2 | 3 | export default VabMagnifier 4 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabMarkdownEditor.js: -------------------------------------------------------------------------------- 1 | import ZxMarkdownEditor from 'zx-markdown-editor' 2 | import 'zx-markdown-editor/dist/zx-markdown-editor.css' 3 | 4 | const VabMarkdownEditor = ZxMarkdownEditor 5 | export default VabMarkdownEditor 6 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabPlayer.js: -------------------------------------------------------------------------------- 1 | import { VabPlayerMp4, VabPlayerHls, VabPlayerFlv } from 'zx-player' 2 | 3 | export { VabPlayerMp4, VabPlayerHls, VabPlayerFlv } 4 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabQuill.js: -------------------------------------------------------------------------------- 1 | import 'zx-quill/dist/zx-quill.css' 2 | import VabQuill from 'zx-quill' 3 | 4 | export default VabQuill 5 | -------------------------------------------------------------------------------- /src/web/src/plugins/vabVerify.js: -------------------------------------------------------------------------------- 1 | import VabVerify from 'zx-verify' 2 | import 'zx-verify/dist/zx-verify.css' 3 | 4 | export default VabVerify 5 | -------------------------------------------------------------------------------- /src/web/src/remixIcon/index.js: -------------------------------------------------------------------------------- 1 | const req = require.context('./svg', false, /\.svg$/), 2 | requireAll = (requireContext) => { 3 | /*let a = requireContext.keys().map(requireContext); 4 | let arr = []; 5 | for (let i = 0; i < a.length; i++) { 6 | console.log(); 7 | let icon = a[i].default.id; 8 | arr.push(icon); 9 | } 10 | console.log(JSON.stringify(arr));*/ 11 | return requireContext.keys().map(requireContext) 12 | } 13 | requireAll(req) 14 | -------------------------------------------------------------------------------- /src/web/src/remixIcon/svg/qq-fill.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/web/src/remixIcon/svg/vuejs-fill.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/web/src/store/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导入所有 vuex 模块,自动加入namespaced:true,用于解决vuex命名冲突,请勿修改。 3 | */ 4 | 5 | import Vue from 'vue' 6 | import Vuex from 'vuex' 7 | 8 | Vue.use(Vuex) 9 | const files = require.context('./modules', true, /\.js$/) 10 | const modules = {} 11 | 12 | files.keys().forEach((key) => { 13 | modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default 14 | }) 15 | Object.keys(modules).forEach((key) => { 16 | modules[key]['namespaced'] = true 17 | }) 18 | const store = new Vuex.Store({ 19 | modules, 20 | }) 21 | export default store 22 | -------------------------------------------------------------------------------- /src/web/src/store/modules/errorLog.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 异常捕获的状态拦截,请勿修改 3 | */ 4 | 5 | const state = () => ({ 6 | errorLogs: [], 7 | }) 8 | const getters = { 9 | errorLogs: (state) => state.errorLogs, 10 | } 11 | const mutations = { 12 | addErrorLog(state, errorLog) { 13 | state.errorLogs.push(errorLog) 14 | }, 15 | clearErrorLog: (state) => { 16 | state.errorLogs.splice(0) 17 | }, 18 | } 19 | const actions = { 20 | addErrorLog({ commit }, errorLog) { 21 | commit('addErrorLog', errorLog) 22 | }, 23 | clearErrorLog({ commit }) { 24 | commit('clearErrorLog') 25 | }, 26 | } 27 | export default { state, getters, mutations, actions } 28 | -------------------------------------------------------------------------------- /src/web/src/store/modules/pageLoading.js: -------------------------------------------------------------------------------- 1 | const state = () => ({ 2 | isLoading: false, 3 | loadingText: '', 4 | isDisabled: false, 5 | defaultLoadingText: '正在加载...', 6 | }) 7 | const getters = { 8 | //是否禁用操作 9 | isPageDisabled: (state) => state.isDisabled, 10 | //是否显示加载框 11 | isPageLoading: (state) => state.isLoading, 12 | //加载文字 13 | pageLoadingText: (state) => state.loadingText, 14 | } 15 | const mutations = { 16 | //显示加载框 17 | showPageLoading(state, loadingText, disableHandle = true) { 18 | if (loadingText && loadingText != '') { 19 | state.loadingText = loadingText 20 | } else { 21 | state.loadingText = state.defaultLoadingText 22 | } 23 | state.isLoading = true 24 | if (disableHandle) { 25 | state.isDisabled = true 26 | } 27 | }, 28 | //隐藏加载框 29 | closePageLoading(state, enableHandle = true) { 30 | state.isLoading = false 31 | if (enableHandle) { 32 | state.isDisabled = false 33 | } 34 | }, 35 | //禁用操作 36 | disablePageHandle(state) { 37 | state.isDisabled = true 38 | }, 39 | //启用操作 40 | enablePageHandle(state) { 41 | state.isDisabled = false 42 | }, 43 | } 44 | export default { state, getters, mutations } 45 | -------------------------------------------------------------------------------- /src/web/src/store/modules/routes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用 3 | */ 4 | import { asyncRoutes, constantRoutes } from '@/router' 5 | import { getRouterList } from '@/api/router' 6 | import { convertRouter, filterAsyncRoutes } from '@/utils/handleRoutes' 7 | 8 | const state = () => ({ 9 | routes: [], 10 | partialRoutes: [], 11 | }) 12 | const getters = { 13 | routes: (state) => state.routes, 14 | partialRoutes: (state) => state.partialRoutes, 15 | } 16 | const mutations = { 17 | setRoutes(state, routes) { 18 | state.routes = constantRoutes.concat(routes) 19 | }, 20 | setAllRoutes(state, routes) { 21 | state.routes = constantRoutes.concat(routes) 22 | }, 23 | setPartialRoutes(state, routes) { 24 | state.partialRoutes = constantRoutes.concat(routes) 25 | }, 26 | } 27 | const actions = { 28 | async setRoutes({ commit }, permissions) { 29 | //开源版只过滤动态路由permissions,admin不再默认拥有全部权限 30 | const finallyAsyncRoutes = await filterAsyncRoutes( 31 | [...asyncRoutes], 32 | permissions 33 | ) 34 | commit('setRoutes', finallyAsyncRoutes) 35 | return finallyAsyncRoutes 36 | }, 37 | async setAllRoutes({ commit }) { 38 | let { data } = await getRouterList() 39 | data.push({ path: '*', redirect: '/404', hidden: true }) 40 | let accessRoutes = convertRouter(data) 41 | commit('setAllRoutes', accessRoutes) 42 | return accessRoutes 43 | }, 44 | setPartialRoutes({ commit }, accessRoutes) { 45 | commit('setPartialRoutes', accessRoutes) 46 | return accessRoutes 47 | }, 48 | } 49 | export default { state, getters, mutations, actions } 50 | -------------------------------------------------------------------------------- /src/web/src/store/modules/settings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 所有全局配置的状态管理,如无必要请勿修改 3 | */ 4 | 5 | import defaultSettings from '@/config' 6 | 7 | const { tabsBar, logo, layout, header, themeBar } = defaultSettings 8 | const theme = JSON.parse(localStorage.getItem('eznew-net-theme')) || '' 9 | const state = () => ({ 10 | tabsBar: theme.tabsBar || tabsBar, 11 | logo, 12 | collapse: false, 13 | layout: theme.layout || layout, 14 | header: theme.header || header, 15 | device: 'desktop', 16 | themeBar, 17 | }) 18 | const getters = { 19 | collapse: (state) => state.collapse, 20 | device: (state) => state.device, 21 | header: (state) => state.header, 22 | layout: (state) => state.layout, 23 | logo: (state) => state.logo, 24 | tabsBar: (state) => state.tabsBar, 25 | themeBar: (state) => state.themeBar, 26 | } 27 | const mutations = { 28 | changeLayout: (state, layout) => { 29 | if (layout) state.layout = layout 30 | }, 31 | changeHeader: (state, header) => { 32 | if (header) state.header = header 33 | }, 34 | changeTabsBar: (state, tabsBar) => { 35 | if (tabsBar) state.tabsBar = tabsBar 36 | }, 37 | changeCollapse: (state) => { 38 | state.collapse = !state.collapse 39 | }, 40 | foldSideBar: (state) => { 41 | state.collapse = true 42 | }, 43 | openSideBar: (state) => { 44 | state.collapse = false 45 | }, 46 | toggleDevice: (state, device) => { 47 | state.device = device 48 | }, 49 | } 50 | const actions = { 51 | changeLayout({ commit }, layout) { 52 | commit('changeLayout', layout) 53 | }, 54 | changeHeader({ commit }, header) { 55 | commit('changeHeader', header) 56 | }, 57 | changeTabsBar({ commit }, tabsBar) { 58 | commit('changeTabsBar', tabsBar) 59 | }, 60 | changeCollapse({ commit }) { 61 | commit('changeCollapse') 62 | }, 63 | foldSideBar({ commit }) { 64 | commit('foldSideBar') 65 | }, 66 | openSideBar({ commit }) { 67 | commit('openSideBar') 68 | }, 69 | toggleDevice({ commit }, device) { 70 | commit('toggleDevice', device) 71 | }, 72 | } 73 | export default { state, getters, mutations, actions } 74 | -------------------------------------------------------------------------------- /src/web/src/store/modules/sys/menu.js: -------------------------------------------------------------------------------- 1 | import { doGetMenuConfig } from '@/api/sys/menu' 2 | 3 | const state = () => ({ 4 | config: {}, 5 | hasInit: false, 6 | }) 7 | const getters = { 8 | //获取菜单状态文本 9 | getMenuStatusDisplayText: (state) => (statusValue) => { 10 | if (state.config && state.config.statusCollection) { 11 | for (let i in state.config.statusCollection) { 12 | let item = state.config.statusCollection[i] 13 | if (item.key == statusValue) { 14 | return item.value 15 | } 16 | } 17 | } 18 | return statusValue 19 | }, 20 | //获取状态字典 21 | getMenuStatusDict(state) { 22 | return state.config.statusCollection 23 | }, 24 | //获取默认状态 25 | getMenuDefaultStatus(state) { 26 | if (state.config.statusCollection) { 27 | return parseInt(state.config.statusCollection[0].key) 28 | } 29 | return null 30 | }, 31 | 32 | //获取用途文本 33 | getMenuUsageDisplayText: (state) => (usageVal) => { 34 | if (state.config && state.config.usageCollection) { 35 | for (let i in state.config.usageCollection) { 36 | let item = state.config.usageCollection[i] 37 | if (item.key == usageVal) { 38 | return item.value 39 | } 40 | } 41 | } 42 | return usageVal 43 | }, 44 | //获取状态字典 45 | getMenuUsageDict(state) { 46 | return state.config.usageCollection 47 | }, 48 | //获取默认状态 49 | getMenuDefaultUsage(state) { 50 | if (state.config.usageCollection) { 51 | return parseInt(state.config.usageCollection[0].key) 52 | } 53 | return null 54 | }, 55 | } 56 | const mutations = { 57 | //设置权限配置数据 58 | setMenuConfig(state, newConfig) { 59 | state.config = newConfig 60 | state.hasInit = true 61 | }, 62 | } 63 | const actions = { 64 | //刷新配置 65 | async refreshMenuConfig({ commit }) { 66 | const { data } = await doGetMenuConfig() 67 | commit('setMenuConfig', data) 68 | }, 69 | 70 | //初始化配置 71 | async initMenuConfig({ state, dispatch }) { 72 | if (!state.hasInit) { 73 | await dispatch('refreshMenuConfig') 74 | } 75 | }, 76 | } 77 | export default { state, getters, mutations, actions } 78 | -------------------------------------------------------------------------------- /src/web/src/store/modules/sys/operation.js: -------------------------------------------------------------------------------- 1 | import { doGetOperationConfig } from '@/api/sys/operation' 2 | 3 | const state = () => ({ 4 | config: {}, 5 | hasInit: false, 6 | }) 7 | const getters = { 8 | //获取操作功能状态文本 9 | getOperationStatusDisplayText: (state) => (statusValue) => { 10 | if (state.config && state.config.statusCollection) { 11 | for (let i in state.config.statusCollection) { 12 | let item = state.config.statusCollection[i] 13 | if (item.key == statusValue) { 14 | return item.value 15 | } 16 | } 17 | } 18 | return statusValue 19 | }, 20 | //获取状态字典 21 | getOperationStatusDict(state) { 22 | return state.config.statusCollection 23 | }, 24 | //获取默认状态 25 | getOperationDefaultStatus(state) { 26 | if (state.config.statusCollection) { 27 | return parseInt(state.config.statusCollection[0].key) 28 | } 29 | return null 30 | }, 31 | //获取操作功能访问级别文本 32 | getOperationAccessLevelDisplayText: (state) => (levelValue) => { 33 | if (state.config && state.config.accessLevelCollection) { 34 | for (let i in state.config.accessLevelCollection) { 35 | let item = state.config.accessLevelCollection[i] 36 | if (item.key == levelValue) { 37 | return item.value 38 | } 39 | } 40 | } 41 | return levelValue 42 | }, 43 | //获取状态字典 44 | getOperationAccessLevelDict(state) { 45 | return state.config.accessLevelCollection 46 | }, 47 | //获取默认状态 48 | getOperationDefaultAccessLevel(state) { 49 | if (state.config.accessLevelCollection) { 50 | return parseInt(state.config.accessLevelCollection[0].key) 51 | } 52 | return null 53 | }, 54 | } 55 | const mutations = { 56 | //设置操作功能配置数据 57 | setConfig(state, newConfig) { 58 | state.config = newConfig 59 | state.hasInit = true 60 | }, 61 | } 62 | const actions = { 63 | //刷新配置 64 | async refreshOperationConfig({ commit }) { 65 | const { data } = await doGetOperationConfig() 66 | commit('setConfig', data) 67 | }, 68 | 69 | //初始化配置 70 | async initOperationConfig({ state, dispatch }) { 71 | if (!state.hasInit) { 72 | await dispatch('refreshOperationConfig') 73 | } 74 | }, 75 | } 76 | export default { state, getters, mutations, actions } 77 | -------------------------------------------------------------------------------- /src/web/src/store/modules/sys/permission.js: -------------------------------------------------------------------------------- 1 | import { doGetPermissionConfig } from '@/api/sys/permission' 2 | 3 | const state = () => ({ 4 | config: {}, 5 | hasInit: false, 6 | }) 7 | const getters = { 8 | //获取权限状态文本 9 | getPermissionStatusDisplayText: (state) => (statusValue) => { 10 | if (state.config && state.config.statusCollection) { 11 | for (let i in state.config.statusCollection) { 12 | let item = state.config.statusCollection[i] 13 | if (item.key == statusValue) { 14 | return item.value 15 | } 16 | } 17 | } 18 | return statusValue 19 | }, 20 | //获取状态字典 21 | getPermissionStatusDict(state) { 22 | return state.config.statusCollection 23 | }, 24 | //获取默认状态 25 | getPermissionDefaultStatus(state) { 26 | if (state.config.statusCollection) { 27 | return parseInt(state.config.statusCollection[0].key) 28 | } 29 | return null 30 | }, 31 | } 32 | const mutations = { 33 | //设置权限配置数据 34 | setConfig(state, newConfig) { 35 | state.config = newConfig 36 | state.hasInit = true 37 | }, 38 | } 39 | const actions = { 40 | //刷新配置 41 | async refreshPermissionConfig({ commit }) { 42 | const { data } = await doGetPermissionConfig() 43 | commit('setConfig', data) 44 | }, 45 | 46 | //初始化配置 47 | async initPermissionConfig({ state, dispatch }) { 48 | if (!state.hasInit) { 49 | await dispatch('refreshPermissionConfig') 50 | } 51 | }, 52 | } 53 | export default { state, getters, mutations, actions } 54 | -------------------------------------------------------------------------------- /src/web/src/store/modules/sys/role.js: -------------------------------------------------------------------------------- 1 | import { doGetRoleConfig } from '@/api/sys/role' 2 | 3 | const state = () => ({ 4 | config: {}, 5 | hasInit: false, 6 | }) 7 | const getters = { 8 | //获取角色状态文本 9 | getRoleStatusDisplayText: (state) => (statusValue) => { 10 | if (state.config && state.config.statusCollection) { 11 | for (let i in state.config.statusCollection) { 12 | let item = state.config.statusCollection[i] 13 | if (item.key == statusValue) { 14 | return item.value 15 | } 16 | } 17 | return state.config.statusCollection[statusValue] 18 | } 19 | return statusValue 20 | }, 21 | //获取状态字典 22 | getRoleStatusDict(state) { 23 | return state.config.statusCollection 24 | }, 25 | //获取默认状态 26 | getRoleDefaultStatus(state) { 27 | if (state.config.statusCollection) { 28 | return parseInt(state.config.statusCollection[0].key) 29 | } 30 | return null 31 | }, 32 | } 33 | const mutations = { 34 | //设置角色配置数据 35 | setConfig(state, newConfig) { 36 | state.config = newConfig 37 | state.hasInit = true 38 | }, 39 | } 40 | const actions = { 41 | //刷新配置 42 | async refreshRoleConfig({ commit }) { 43 | const { data } = await doGetRoleConfig() 44 | commit('setConfig', data) 45 | }, 46 | 47 | //初始化配置 48 | async initRoleConfig({ state, dispatch }) { 49 | if (!state.hasInit) { 50 | await dispatch('refreshRoleConfig') 51 | } 52 | }, 53 | } 54 | export default { state, getters, mutations, actions } 55 | -------------------------------------------------------------------------------- /src/web/src/styles/spinner/gauge.css: -------------------------------------------------------------------------------- 1 | .gauge-loader:not(:required) { 2 | position: relative; 3 | display: inline-block; 4 | width: 64px; 5 | height: 32px; 6 | margin-bottom: 10px; 7 | overflow: hidden; 8 | text-indent: -9999px; 9 | background: #6ca; 10 | border-top-left-radius: 32px; 11 | border-top-right-radius: 32px; 12 | } 13 | 14 | .gauge-loader:not(:required)::before { 15 | position: absolute; 16 | top: 5px; 17 | left: 30px; 18 | width: 4px; 19 | height: 27px; 20 | content: ""; 21 | background: white; 22 | border-radius: 2px; 23 | transform-origin: 50% 100%; 24 | animation: gauge-loader 4000ms infinite ease; 25 | } 26 | 27 | .gauge-loader:not(:required)::after { 28 | position: absolute; 29 | top: 26px; 30 | left: 26px; 31 | width: 13px; 32 | height: 13px; 33 | content: ""; 34 | background: white; 35 | -moz-border-radius: 8px; 36 | -webkit-border-radius: 8px; 37 | border-radius: 8px; 38 | } 39 | 40 | @keyframes gauge-loader { 41 | 0% { 42 | transform: rotate(-50deg); 43 | } 44 | 45 | 10% { 46 | transform: rotate(20deg); 47 | } 48 | 49 | 20% { 50 | transform: rotate(60deg); 51 | } 52 | 53 | 24% { 54 | transform: rotate(60deg); 55 | } 56 | 57 | 40% { 58 | transform: rotate(-20deg); 59 | } 60 | 61 | 54% { 62 | transform: rotate(70deg); 63 | } 64 | 65 | 56% { 66 | transform: rotate(78deg); 67 | } 68 | 69 | 58% { 70 | transform: rotate(73deg); 71 | } 72 | 73 | 60% { 74 | transform: rotate(75deg); 75 | } 76 | 77 | 62% { 78 | transform: rotate(70deg); 79 | } 80 | 81 | 70% { 82 | transform: rotate(-20deg); 83 | } 84 | 85 | 80% { 86 | transform: rotate(20deg); 87 | } 88 | 89 | 83% { 90 | transform: rotate(25deg); 91 | } 92 | 93 | 86% { 94 | transform: rotate(20deg); 95 | } 96 | 97 | 89% { 98 | transform: rotate(25deg); 99 | } 100 | 101 | 100% { 102 | transform: rotate(-50deg); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/web/src/styles/spinner/inner-circles.css: -------------------------------------------------------------------------------- 1 | .inner-circles-loader:not(:required) { 2 | position: relative; 3 | display: inline-block; 4 | width: 50px; 5 | height: 50px; 6 | margin-bottom: 10px; 7 | overflow: hidden; 8 | text-indent: -9999px; 9 | background: rgba(25, 165, 152, 0.5); 10 | border-radius: 50%; 11 | transform: translate3d(0, 0, 0); 12 | } 13 | 14 | .inner-circles-loader:not(:required)::before, 15 | .inner-circles-loader:not(:required)::after { 16 | position: absolute; 17 | top: 0; 18 | display: inline-block; 19 | width: 50px; 20 | height: 50px; 21 | content: ""; 22 | border-radius: 50%; 23 | } 24 | 25 | .inner-circles-loader:not(:required)::before { 26 | left: 0; 27 | background: #c7efcf; 28 | transform-origin: 0 50%; 29 | animation: inner-circles-loader 3s infinite; 30 | } 31 | 32 | .inner-circles-loader:not(:required)::after { 33 | right: 0; 34 | background: #eef5db; 35 | transform-origin: 100% 50%; 36 | animation: inner-circles-loader 3s 0.2s reverse infinite; 37 | } 38 | 39 | @keyframes inner-circles-loader { 40 | 0% { 41 | transform: rotate(0deg); 42 | } 43 | 44 | 50% { 45 | transform: rotate(360deg); 46 | } 47 | 48 | 100% { 49 | transform: rotate(0deg); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/web/src/styles/themes/default.scss: -------------------------------------------------------------------------------- 1 | /* 绿荫草场主题、荣耀典藏主题、暗黑之子主题加QQ讨论群972435319、1139183756后私聊群主获取,获取后将主题放到themes文件夹根目录即可 */ 2 | -------------------------------------------------------------------------------- /src/web/src/styles/transition.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * @description vue过渡动画 3 | */ 4 | 5 | @charset "utf-8"; 6 | 7 | .fade-transform-leave-active, 8 | .fade-transform-enter-active { 9 | transition: $base-transition; 10 | } 11 | 12 | .fade-transform-enter { 13 | opacity: 0; 14 | } 15 | 16 | .fade-transform-leave-to { 17 | opacity: 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/web/src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 全局主题变量配置 3 | */ 4 | /* stylelint-disable */ 5 | @charset "utf-8"; 6 | //框架默认主题色 7 | $base-color-default: #41b584; 8 | //默认层级 9 | $base-z-index: 999; 10 | //横向布局纵向布局时菜单背景色 11 | $base-menu-background: #282c34; 12 | //菜单文字颜色 13 | $base-menu-color: hsla(0, 0%, 100%, 0.95); 14 | //菜单选中文字颜色 15 | $base-menu-color-active: hsla(0, 0%, 100%, 0.95); 16 | //菜单选中背景色 17 | $base-menu-background-active: $base-color-default; 18 | //标题颜色 19 | $base-title-color: #fff; 20 | //字体大小配置 21 | $base-font-size-small: 12px; 22 | $base-font-size-default: 14px; 23 | $base-font-size-big: 16px; 24 | $base-font-size-bigger: 18px; 25 | $base-font-size-max: 22px; 26 | $base-font-color: #606266; 27 | $base-color-blue: $base-color-default; 28 | $base-color-green: #47ba80; 29 | $base-color-white: #fff; 30 | $base-color-black: #000; 31 | $base-color-yellow: #fac858; 32 | $base-color-orange: #ff6700; 33 | $base-color-red: #f34d37; 34 | $base-color-gray: rgba(0, 0, 0, 0.65); 35 | $base-main-width: 1279px; 36 | $base-border-radius: 4px; 37 | $base-border-color: #dcdfe6; 38 | //输入框高度 39 | $base-input-height: 32px; 40 | //默认paddiing 41 | $base-padding: 20px; 42 | //默认阴影 43 | $base-box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); 44 | //横向布局时top-bar、logo、一级菜单的高度 45 | $base-top-bar-height: 65px; 46 | //纵向布局时logo的高度 47 | $base-logo-height: 75px; 48 | //顶部nav-bar的高度 49 | $base-nav-bar-height: 60px; 50 | //顶部多标签页tabs-bar的高度 51 | $base-tabs-bar-height: 55px; 52 | //顶部多标签页tabs-bar中每一个item的高度 53 | $base-tag-item-height: 34px; 54 | //菜单li标签的高度 55 | $base-menu-item-height: 50px; 56 | //app-main的高度 57 | $base-app-main-height: calc( 58 | 100vh - #{$base-nav-bar-height} - #{$base-tabs-bar-height} - #{$base-padding} - 59 | #{$base-padding} - 55px - 55px 60 | ); 61 | //纵向布局时左侧导航未折叠时的宽度 62 | $base-left-menu-width: 256px; 63 | //纵向布局时左侧导航未折叠时右侧内容的宽度 64 | $base-right-content-width: calc(100% - #{$base-left-menu-width}); 65 | //纵向布局时左侧导航已折叠时的宽度 66 | $base-left-menu-width-min: 65px; 67 | //纵向布局时左侧导航已折叠时右侧内容的宽度 68 | $base-right-content-width-min: calc(100% - #{$base-left-menu-width-min}); 69 | //默认动画 70 | $base-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s, 71 | background 0s, color 0s, font-size 0s; 72 | //默认动画长 73 | $base-transition-time: 0.3s; 74 | 75 | :export { 76 | //菜单文字颜色变量导出 77 | menu-color: $base-menu-color; 78 | //菜单选中文字颜色变量导出 79 | menu-color-active: $base-menu-color-active; 80 | //菜单背景色变量导出 81 | menu-background: $base-menu-background; 82 | } 83 | -------------------------------------------------------------------------------- /src/web/src/utils/accessToken.js: -------------------------------------------------------------------------------- 1 | import { storage, tokenTableName } from '@/config' 2 | 3 | /** 4 | * @description 获取accessToken 5 | * @returns {string|ActiveX.IXMLDOMNode|Promise|any|IDBRequest|MediaKeyStatus|FormDataEntryValue|Function|Promise} 6 | */ 7 | export function getAccessToken() { 8 | if (storage) { 9 | if ('localStorage' === storage) { 10 | return localStorage.getItem(tokenTableName) 11 | } else if ('sessionStorage' === storage) { 12 | return sessionStorage.getItem(tokenTableName) 13 | } else { 14 | return localStorage.getItem(tokenTableName) 15 | } 16 | } else { 17 | return localStorage.getItem(tokenTableName) 18 | } 19 | } 20 | 21 | /** 22 | * @description 存储accessToken 23 | * @param accessToken 24 | * @returns {void|*} 25 | */ 26 | export function setAccessToken(accessToken) { 27 | if (storage) { 28 | if ('localStorage' === storage) { 29 | return localStorage.setItem(tokenTableName, accessToken) 30 | } else if ('sessionStorage' === storage) { 31 | return sessionStorage.setItem(tokenTableName, accessToken) 32 | } else { 33 | return localStorage.setItem(tokenTableName, accessToken) 34 | } 35 | } else { 36 | return localStorage.setItem(tokenTableName, accessToken) 37 | } 38 | } 39 | 40 | /** 41 | * @description 移除accessToken 42 | * @returns {void|Promise} 43 | */ 44 | export function removeAccessToken() { 45 | if (storage) { 46 | if ('localStorage' === storage) { 47 | return localStorage.removeItem(tokenTableName) 48 | } else if ('sessionStorage' === storage) { 49 | return sessionStorage.clear() 50 | } else { 51 | return localStorage.removeItem(tokenTableName) 52 | } 53 | } else { 54 | return localStorage.removeItem(tokenTableName) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/web/src/utils/clipboard.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Clipboard from 'clipboard' 3 | 4 | function clipboardSuccess() { 5 | Vue.prototype.$baseMessage('复制成功', 'success') 6 | } 7 | 8 | function clipboardError() { 9 | Vue.prototype.$baseMessage('复制失败', 'error') 10 | } 11 | 12 | /** 13 | * @description 复制数据 14 | * @param text 15 | * @param event 16 | */ 17 | export default function handleClipboard(text, event) { 18 | const clipboard = new Clipboard(event.target, { 19 | text: () => text, 20 | }) 21 | clipboard.on('success', () => { 22 | clipboardSuccess() 23 | clipboard.destroy() 24 | }) 25 | clipboard.on('error', () => { 26 | clipboardError() 27 | clipboard.destroy() 28 | }) 29 | clipboard.onClick(event) 30 | } 31 | -------------------------------------------------------------------------------- /src/web/src/utils/encrypt.js: -------------------------------------------------------------------------------- 1 | import JSEncrypt from 'jsencrypt' 2 | import { getPublicKey } from '@/api/publicKey' 3 | 4 | const privateKey = 5 | 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAMFPa+v52FkSUXvcUnrGI/XzW3EpZRI0s9BCWJ3oNQmEYA5luWW5p8h0uadTIoTyYweFPdH4hveyxlwmS7oefvbIdiP+o+QIYW/R4Wjsb4Yl8MhR4PJqUE3RCy6IT9fM8ckG4kN9ECs6Ja8fQFc6/mSl5dJczzJO3k1rWMBhKJD/AgMBAAECgYEAucMakH9dWeryhrYoRHcXo4giPVJsH9ypVt4KzmOQY/7jV7KFQK3x//27UoHfUCak51sxFw9ek7UmTPM4HjikA9LkYeE7S381b4QRvFuf3L6IbMP3ywJnJ8pPr2l5SqQ00W+oKv+w/VmEsyUHr+k4Z+4ik+FheTkVWp566WbqFsECQQDjYaMcaKw3j2Zecl8T6eUe7fdaRMIzp/gcpPMfT/9rDzIQk+7ORvm1NI9AUmFv/FAlfpuAMrdL2n7p9uznWb7RAkEA2aP934kbXg5bdV0R313MrL+7WTK/qdcYxATUbMsMuWWQBoS5irrt80WCZbG48hpocJavLNjbtrjmUX3CuJBmzwJAOJg8uP10n/+ZQzjEYXh+BszEHDuw+pp8LuT/fnOy5zrJA0dO0RjpXijO3vuiNPVgHXT9z1LQPJkNrb5ACPVVgQJBALPeb4uV0bNrJDUb5RB4ghZnIxv18CcaqNIft7vuGCcFBAIPIRTBprR+RuVq+xHDt3sNXdsvom4h49+Hky1b0ksCQBBwUtVaqH6ztCtwUF1j2c/Zcrt5P/uN7IHAd44K0gIJc1+Csr3qPG+G2yoqRM8KVqLI8Z2ZYn9c+AvEE+L9OQY=' 6 | 7 | /** 8 | * @description RSA加密 9 | * @param data 10 | * @returns {Promise<{param: PromiseLike}|*>} 11 | */ 12 | export async function encryptedData(data) { 13 | let publicKey = '' 14 | const res = await getPublicKey() 15 | publicKey = res.data.publicKey 16 | if (res.data.mockServer) { 17 | publicKey = '' 18 | } 19 | if (publicKey == '') { 20 | return data 21 | } 22 | const encrypt = new JSEncrypt() 23 | encrypt.setPublicKey(`${publicKey}`) 24 | data = encrypt.encrypt(JSON.stringify(data)) 25 | return { 26 | param: data, 27 | } 28 | } 29 | 30 | /** 31 | * @description RSA解密 32 | * @param data 33 | * @returns {PromiseLike} 34 | */ 35 | export function decryptedData(data) { 36 | const decrypt = new JSEncrypt() 37 | decrypt.setPrivateKey(`${privateKey}`) 38 | data = decrypt.decrypt(JSON.stringify(data)) 39 | return data 40 | } 41 | -------------------------------------------------------------------------------- /src/web/src/utils/errorLog.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import store from '@/store' 3 | import { isArray, isString } from '@/utils/validate' 4 | import { errorLog } from '@/config' 5 | 6 | const needErrorLog = errorLog 7 | const checkNeed = () => { 8 | const env = process.env.NODE_ENV 9 | if (isString(needErrorLog)) { 10 | return env === needErrorLog 11 | } 12 | if (isArray(needErrorLog)) { 13 | return needErrorLog.includes(env) 14 | } 15 | return false 16 | } 17 | if (checkNeed()) { 18 | Vue.config.errorHandler = (err, vm, info) => { 19 | console.error('EZNEW.NET错误拦截:', err, vm, info) 20 | const url = window.location.href 21 | Vue.nextTick(() => { 22 | store.dispatch('errorLog/addErrorLog', { err, vm, info, url }) 23 | }) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/web/src/utils/handleRoutes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description all模式渲染后端返回路由 3 | * @param constantRoutes 4 | * @returns {*} 5 | */ 6 | export function convertRouter(asyncRoutes) { 7 | return asyncRoutes.map((route) => { 8 | if (route.component) { 9 | if (route.component === 'Layout') { 10 | route.component = (resolve) => require(['@/layouts'], resolve) 11 | } else if (route.component === 'EmptyLayout') { 12 | route.component = (resolve) => 13 | require(['@/layouts/EmptyLayout'], resolve) 14 | } else { 15 | const index = route.component.indexOf('views') 16 | const path = 17 | index > 0 ? route.component.slice(index) : `views/${route.component}` 18 | route.component = (resolve) => require([`@/${path}`], resolve) 19 | } 20 | } 21 | if (route.children && route.children.length) 22 | route.children = convertRouter(route.children) 23 | if (route.children && route.children.length === 0) delete route.children 24 | return route 25 | }) 26 | } 27 | 28 | /** 29 | * @description 判断当前路由是否包含权限 30 | * @param permissions 31 | * @param route 32 | * @returns {boolean|*} 33 | */ 34 | function hasPermission(permissions, route) { 35 | if (route.meta && route.meta.permissions) { 36 | return permissions.some((role) => route.meta.permissions.includes(role)) 37 | } else { 38 | return true 39 | } 40 | } 41 | 42 | /** 43 | * @description intelligence模式根据permissions数组拦截路由 44 | * @param routes 45 | * @param permissions 46 | * @returns {[]} 47 | */ 48 | export function filterAsyncRoutes(routes, permissions) { 49 | const finallyRoutes = [] 50 | routes.forEach((route) => { 51 | const item = { ...route } 52 | if (hasPermission(permissions, item)) { 53 | if (item.children) { 54 | item.children = filterAsyncRoutes(item.children, permissions) 55 | } 56 | finallyRoutes.push(item) 57 | } 58 | }) 59 | return finallyRoutes 60 | } 61 | -------------------------------------------------------------------------------- /src/web/src/utils/pageStatus.js: -------------------------------------------------------------------------------- 1 | class PageStatusManager { 2 | isLoading = false 3 | loadingText = '' 4 | isDisabled = false 5 | defaultLoadingText = '正在加载...' 6 | 7 | //显示加载框 8 | showPageLoading(loadingText, disableHandle = true) { 9 | if (loadingText && loadingText != '') { 10 | this.loadingText = loadingText 11 | //this.vm.$set(this.vm.pageStatus, 'loadingText', loadingText) 12 | } else { 13 | this.loadingText = this.defaultLoadingText 14 | //this.vm.$set(this.vm.pageStatus, 'loadingText', this.defaultLoadingText) 15 | } 16 | this.isLoading = true 17 | //this.vm.$set(this.vm.pageStatus, 'isLoading', true) 18 | if (disableHandle) { 19 | this.isDisabled = true 20 | } 21 | } 22 | //隐藏加载框 23 | closePageLoading(enableHandle = true) { 24 | this.isLoading = false 25 | if (enableHandle) { 26 | this.isDisabled = false 27 | } 28 | } 29 | //禁用操作 30 | disablePageHandle() { 31 | this.isDisabled = true 32 | } 33 | //启用操作 34 | enablePageHandle() { 35 | this.isDisabled = false 36 | } 37 | } 38 | 39 | //获取页面状态管理对象 40 | export function getPageStatus() { 41 | return new PageStatusManager() 42 | } 43 | -------------------------------------------------------------------------------- /src/web/src/utils/pageTitle.js: -------------------------------------------------------------------------------- 1 | import { title } from '@/config' 2 | 3 | /** 4 | * @description 设置标题 5 | * @param pageTitle 6 | * @returns {string} 7 | */ 8 | export default function getPageTitle(pageTitle) { 9 | if (pageTitle) { 10 | return `${pageTitle}-${title}` 11 | } 12 | return `${title}` 13 | } 14 | -------------------------------------------------------------------------------- /src/web/src/utils/paginationInfo.js: -------------------------------------------------------------------------------- 1 | class PaginationInfoManager { 2 | small = false //是否使用小型分页样式 3 | background = false //是否为分页按钮添加背景色 4 | pageSize = 20 //每页显示条目个数 5 | total = 0 //总条目数 6 | pageCount = 0 //总页数 7 | pagerCount = 7 //页码按钮的数量 8 | currentPage = 1 //当前页数 9 | layout = 'total, sizes, prev, pager, next, jumper' //组件布局 10 | pageSizes = [10, 20, 30, 40, 50, 100] //每页显示个数选择器的选项设置 11 | popperClass = undefined //每页显示个数选择器的下拉框类名 12 | prevText = undefined //替代图标显示的上一页文字 13 | nextText = undefined //替代图标显示的下一页文字 14 | disabled = false //是否禁用 15 | hideOnSinglePage = undefined //只有一页时是否隐藏 16 | // sizeChange = this.handleSizeChange //每一页条数修改的时候触发,每页条数 17 | // currentChange = this.handleCurrentPageChange //currentPage 改变时会触发 18 | prevClick = undefined //用户点击上一页按钮改变当前页后触发 19 | nextClick = undefined //用户点击下一页按钮改变当前页后触发 20 | handleQueryData = undefined //查询数据方法 21 | 22 | //当前页修改触发 23 | handleCurrentPageChange(val) { 24 | this.currentPage = val 25 | this.handleQueryData?.() 26 | } 27 | 28 | //单页数据条数调整 29 | handleSizeChange(val) { 30 | this.pageSize = val 31 | this.handleQueryData?.() 32 | } 33 | 34 | //获取分页筛选 35 | getQueryForm(form) { 36 | let pageQueryForm = { 37 | page: this.currentPage, 38 | pageSize: this.pageSize, 39 | } 40 | if (form) { 41 | pageQueryForm = Object.assign(pageQueryForm, form) 42 | } 43 | return pageQueryForm 44 | } 45 | 46 | //初始化分页 47 | initPage() { 48 | this.currentPage = 1 49 | } 50 | 51 | //设置总条数 52 | setTotal(totalNum) { 53 | this.total = parseInt(totalNum) 54 | } 55 | } 56 | 57 | //获取分页信息 58 | export function getPaginationInfo(options) { 59 | let pagination = new PaginationInfoManager() 60 | if (options) { 61 | pagination = Object.assign(pagination, options) 62 | } 63 | return pagination 64 | } 65 | 66 | //获取简易分页配置信息 67 | export function getLwtPaginationInfo(options) { 68 | let pagination = getPaginationInfo(options) 69 | if (!options || !options.layout) { 70 | pagination.layout = 'total, sizes, prev, pager, next' 71 | } 72 | return pagination 73 | } 74 | -------------------------------------------------------------------------------- /src/web/src/utils/permission.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | /** 4 | * @description 检查权限 5 | * @param value 6 | * @returns {boolean} 7 | */ 8 | export default function checkPermission(value) { 9 | if (value && value instanceof Array && value.length > 0) { 10 | const permissions = store.getters['sys/user/permissions'] 11 | const permissionPermissions = value 12 | 13 | return permissions.some((role) => { 14 | return permissionPermissions.includes(role) 15 | }) 16 | } else { 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/web/src/utils/static.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description 导入所有 controller 模块,浏览器环境中自动输出controller文件夹下Mock接口,请勿修改。 3 | */ 4 | import Mock from 'mockjs' 5 | import { paramObj } from '@/utils' 6 | 7 | const mocks = [] 8 | const files = [] 9 | //require.context('../../mock/controller', false, /\.js$/) 10 | 11 | // files.keys().forEach((key) => { 12 | // mocks.push(...files(key)) 13 | // }) 14 | 15 | export function mockXHR() { 16 | Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send 17 | Mock.XHR.prototype.send = function () { 18 | if (this.custom.xhr) { 19 | this.custom.xhr.withCredentials = this.withCredentials || false 20 | 21 | if (this.responseType) { 22 | this.custom.xhr.responseType = this.responseType 23 | } 24 | } 25 | this.proxy_send(...arguments) 26 | } 27 | 28 | function XHRHttpRequst(respond) { 29 | return function (options) { 30 | let result 31 | if (respond instanceof Function) { 32 | const { body, type, url } = options 33 | result = respond({ 34 | method: type, 35 | body: JSON.parse(body), 36 | query: paramObj(url), 37 | }) 38 | } else { 39 | result = respond 40 | } 41 | return Mock.mock(result) 42 | } 43 | } 44 | 45 | mocks.forEach((item) => { 46 | Mock.mock( 47 | new RegExp(item.url), 48 | item.type || 'get', 49 | XHRHttpRequst(item.response) 50 | ) 51 | }) 52 | } 53 | -------------------------------------------------------------------------------- /src/web/src/views/index/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GitHub 6 | 7 | 8 | https://github.com/eznew-net 9 | 10 | 11 | 12 | 13 | Gitee 14 | 15 | 16 | https://gitee.com/eznew-net 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 37 | 105 | -------------------------------------------------------------------------------- /src/web/webstorm.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @description webstorm.config 3 | */ 4 | const webpackConfig = require('@vue/cli-service/webpack.config.js') 5 | module.exports = webpackConfig 6 | -------------------------------------------------------------------------------- /src/web/编译运行说明.txt: -------------------------------------------------------------------------------- 1 | 2 | 1:安装最新版本的Node 3 | 4 | 2: 安装cnpm 5 | npm install cnpm -g --registry=https://registry.nlark.com 6 | 7 | 3: 安装包,分别执行 npm install 和 cnpm install 8 | 9 | 4: 运行开发服务:npm run serve --------------------------------------------------------------------------------