├── .gitattributes ├── .gitignore ├── DncZeus.Api ├── .config │ └── dotnet-tools.json ├── Auth │ ├── AppAuthenticationSettings.cs │ └── JwtBearerAuthenticationExtension.cs ├── Configurations │ ├── AppSettings.cs │ └── MappingProfile.cs ├── Controllers │ ├── AccountController.cs │ ├── Api │ │ ├── V1 │ │ │ ├── MessageController.cs │ │ │ └── Rbac │ │ │ │ ├── IconController.cs │ │ │ │ ├── MenuController.cs │ │ │ │ ├── PermissionController.cs │ │ │ │ ├── RoleController.cs │ │ │ │ └── UserController.cs │ │ └── V2 │ │ │ └── UserController.cs │ ├── ErrorController.cs │ ├── OauthController.cs │ └── TestController.cs ├── DncZeus.Api.csproj ├── Entities │ ├── AuditEntity.cs │ ├── DncAuthDbContext.cs │ ├── DncIcon.cs │ ├── DncMenu.cs │ ├── DncPermission.cs │ ├── DncRole.cs │ ├── DncRolePermissionMapping.cs │ ├── DncUser.cs │ ├── DncUserRoleMapping.cs │ ├── Entity.cs │ ├── Enums │ │ └── CommonEnum.cs │ └── QueryModels │ │ ├── DncMenuQueryModel.cs │ │ └── DncPermission │ │ ├── DncPermissionWithAssignProperty.cs │ │ └── DncPermissionWithMenu.cs ├── Extensions │ ├── AuthContext │ │ ├── AuthContextService.cs │ │ └── AuthContextUser.cs │ ├── ConfigurationManager.cs │ ├── CustomException │ │ ├── CanAccess.cs │ │ ├── CustomAuthorize.cs │ │ ├── ErrorDetails.cs │ │ ├── ExceptionMiddleware.cs │ │ ├── ExceptionMiddlewareExtensions.cs │ │ ├── HttpException.cs │ │ ├── UnauthorizeException.cs │ │ └── ValidateModelAttribute.cs │ ├── DataAccess │ │ ├── EntityFrameworkExtension.cs │ │ ├── OrderByExtensions.cs │ │ └── SqlParameterHelper.cs │ ├── DataTableConvert.cs │ ├── QuartzExtension.cs │ ├── QueryableExtension.cs │ └── ResponseModelFactory.cs ├── Migrations │ ├── 20230228141911_InitNpgsql.Designer.cs │ ├── 20230228141911_InitNpgsql.cs │ └── DncZeusDbContextModelSnapshot.cs ├── Models │ ├── Menu │ │ ├── MenuJsonModel.cs │ │ └── Router.cs │ └── Response │ │ ├── ResponseModel.cs │ │ └── ResponseResultModel.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── RequestPayload │ ├── Rbac │ │ ├── Icon │ │ │ └── IconRequestPayload.cs │ │ ├── Menu │ │ │ └── MenuRequestPayload.cs │ │ ├── Permission │ │ │ └── PermissionRequestPayload.cs │ │ ├── Role │ │ │ ├── RoleAssignPermissionPayload.cs │ │ │ └── RoleRequestPayload.cs │ │ └── User │ │ │ └── UserRequestPayload.cs │ └── RequestPayload.cs ├── Startup.cs ├── Utils │ ├── RandomHelper.cs │ └── ResetDatabase.cs ├── ViewModels │ └── Rbac │ │ ├── DncIcon │ │ ├── IconCreateViewModel.cs │ │ ├── IconImportViewModel.cs │ │ └── IconJsonModel.cs │ │ ├── DncMenu │ │ ├── MenuCreateViewModel.cs │ │ ├── MenuEditViewModel.cs │ │ ├── MenuItem.cs │ │ ├── MenuJsonModel.cs │ │ └── MenuTree.cs │ │ ├── DncPermission │ │ ├── PermissionCreateViewModel.cs │ │ ├── PermissionEditViewModel.cs │ │ ├── PermissionJsonModel.cs │ │ └── PermissionRoleTree.cs │ │ ├── DncRole │ │ ├── RoleCreateViewModel.cs │ │ └── RoleJsonModel.cs │ │ └── DncUser │ │ ├── SaveUserRolesViewModel.cs │ │ ├── UserCreateViewModel.cs │ │ ├── UserEditViewModel.cs │ │ └── UserJsonModel.cs ├── appsettings.Development.json ├── appsettings.json ├── log4net.config └── wwwroot │ └── index.html ├── DncZeus.App ├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .pnp.cjs ├── .pnp.loader.mjs ├── .postcssrc.js ├── .travis.yml ├── LICENSE ├── README.md ├── cypress.json ├── package.json ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── App.vue │ ├── api │ │ ├── data.js │ │ ├── rbac │ │ │ ├── icon.js │ │ │ ├── menu.js │ │ │ ├── permission.js │ │ │ ├── role.js │ │ │ └── user.js │ │ ├── routers.js │ │ └── user.js │ ├── assets │ │ ├── icons │ │ │ ├── iconfont.css │ │ │ ├── iconfont.eot │ │ │ ├── iconfont.svg │ │ │ ├── iconfont.ttf │ │ │ └── iconfont.woff │ │ └── images │ │ │ ├── error-page │ │ │ ├── error-401.svg │ │ │ ├── error-404.svg │ │ │ └── error-500.svg │ │ │ ├── login-bg.jpg │ │ │ ├── logo-min.jpg │ │ │ ├── logo.jpg │ │ │ ├── qq-group1.jpg │ │ │ └── talkingdata.png │ ├── components │ │ ├── charts │ │ │ ├── bar.vue │ │ │ ├── index.js │ │ │ ├── pie.vue │ │ │ └── theme.json │ │ ├── common-icon │ │ │ ├── common-icon.vue │ │ │ └── index.js │ │ ├── common │ │ │ ├── common.less │ │ │ └── util.js │ │ ├── count-to │ │ │ ├── count-to.vue │ │ │ ├── index.js │ │ │ └── index.less │ │ ├── cropper │ │ │ ├── index.js │ │ │ ├── index.less │ │ │ └── index.vue │ │ ├── drag-list │ │ │ ├── drag-list.vue │ │ │ └── index.js │ │ ├── editor │ │ │ ├── editor.vue │ │ │ └── index.js │ │ ├── icons │ │ │ ├── icons.vue │ │ │ └── index.js │ │ ├── info-card │ │ │ ├── index.js │ │ │ └── infor-card.vue │ │ ├── login-form │ │ │ ├── index.js │ │ │ └── login-form.vue │ │ ├── main │ │ │ ├── components │ │ │ │ ├── a-back-top │ │ │ │ │ ├── index.js │ │ │ │ │ └── index.vue │ │ │ │ ├── error-store │ │ │ │ │ ├── error-store.vue │ │ │ │ │ └── index.js │ │ │ │ ├── fullscreen │ │ │ │ │ ├── fullscreen.vue │ │ │ │ │ └── index.js │ │ │ │ ├── header-bar │ │ │ │ │ ├── custom-bread-crumb │ │ │ │ │ │ ├── custom-bread-crumb.less │ │ │ │ │ │ ├── custom-bread-crumb.vue │ │ │ │ │ │ └── index.js │ │ │ │ │ ├── header-bar.less │ │ │ │ │ ├── header-bar.vue │ │ │ │ │ ├── index.js │ │ │ │ │ └── sider-trigger │ │ │ │ │ │ ├── index.js │ │ │ │ │ │ ├── sider-trigger.less │ │ │ │ │ │ └── sider-trigger.vue │ │ │ │ ├── language │ │ │ │ │ ├── index.js │ │ │ │ │ └── language.vue │ │ │ │ ├── side-menu │ │ │ │ │ ├── collapsed-menu.vue │ │ │ │ │ ├── index.js │ │ │ │ │ ├── item-mixin.js │ │ │ │ │ ├── mixin.js │ │ │ │ │ ├── side-menu-item.vue │ │ │ │ │ ├── side-menu.less │ │ │ │ │ └── side-menu.vue │ │ │ │ ├── tags-nav │ │ │ │ │ ├── index.js │ │ │ │ │ ├── tags-nav.less │ │ │ │ │ └── tags-nav.vue │ │ │ │ └── user │ │ │ │ │ ├── index.js │ │ │ │ │ ├── user.less │ │ │ │ │ └── user.vue │ │ │ ├── index.js │ │ │ ├── main.less │ │ │ └── main.vue │ │ ├── markdown │ │ │ ├── index.js │ │ │ └── markdown.vue │ │ ├── parent-view │ │ │ ├── index.js │ │ │ └── parent-view.vue │ │ ├── paste-editor │ │ │ ├── index.js │ │ │ ├── paste-editor.less │ │ │ ├── paste-editor.vue │ │ │ └── plugins │ │ │ │ └── placeholder.js │ │ ├── split-pane │ │ │ ├── index.js │ │ │ ├── index.less │ │ │ ├── split.vue │ │ │ └── trigger.vue │ │ └── tables │ │ │ ├── dz-table.vue │ │ │ ├── edit.vue │ │ │ ├── handle-btns.js │ │ │ ├── index.js │ │ │ ├── index.less │ │ │ └── tables.vue │ ├── config │ │ └── index.js │ ├── directive │ │ ├── directives.js │ │ ├── hasPermission.js │ │ ├── index.js │ │ └── module │ │ │ ├── clipboard.js │ │ │ └── draggable.js │ ├── index.less │ ├── libs │ │ ├── api.request.js │ │ ├── axios.js │ │ ├── excel.js │ │ ├── router-util.js │ │ ├── tools.js │ │ └── util.js │ ├── locale │ │ ├── index.js │ │ └── lang │ │ │ ├── en-US.js │ │ │ ├── zh-CN.js │ │ │ └── zh-TW.js │ ├── main.js │ ├── mock │ │ ├── data.js │ │ ├── index.js │ │ ├── login.js │ │ └── user.js │ ├── plugin │ │ ├── error-store │ │ │ └── index.js │ │ └── index.js │ ├── router │ │ ├── before-close.js │ │ ├── index.js │ │ ├── routers.js │ │ └── static-routers.js │ ├── store │ │ ├── index.js │ │ └── module │ │ │ ├── app.js │ │ │ └── user.js │ └── view │ │ ├── argu-page │ │ ├── params.vue │ │ └── query.vue │ │ ├── demo │ │ └── demo-page.vue │ │ ├── error-page │ │ ├── 401.vue │ │ ├── 404.vue │ │ ├── 500.vue │ │ ├── back-btn-group.vue │ │ ├── error-content.vue │ │ └── error.less │ │ ├── error-store │ │ └── error-store.vue │ │ ├── join-page.vue │ │ ├── login │ │ ├── login.less │ │ └── login.vue │ │ ├── multimenu │ │ ├── level-2-1.vue │ │ ├── level-2-2-1.vue │ │ ├── level-2-2-2.vue │ │ └── level-2-2.vue │ │ ├── rbac │ │ ├── icon.vue │ │ ├── menu.vue │ │ ├── permission.vue │ │ ├── role-permission.vue │ │ ├── role.vue │ │ └── user.vue │ │ ├── single-page │ │ ├── error-logger.vue │ │ ├── home │ │ │ ├── example.vue │ │ │ ├── home.vue │ │ │ └── index.js │ │ └── message │ │ │ └── index.vue │ │ └── tools-methods │ │ └── tools-methods.vue ├── tests │ ├── e2e │ │ ├── .eslintrc │ │ ├── plugins │ │ │ └── index.js │ │ ├── specs │ │ │ └── test.js │ │ └── support │ │ │ ├── commands.js │ │ │ └── index.js │ └── unit │ │ ├── .eslintrc.js │ │ └── HelloWorld.spec.js ├── vue.config.js └── yarn.lock ├── DncZeus.sln ├── Docs ├── 00.faq.md ├── 01.gett-started.md ├── 02.environment-and-developement-tools.md ├── 03.download-and-restore.md ├── 04.solution-structure-introduction.md ├── 05.create-page.md └── 99.refs.md ├── LICENSE ├── README.md └── Scripts ├── (脚本必看,非常重要)v2.0.0.txt ├── v1.0.0 ├── (非常重要)初次运行必看.txt ├── (非常重要)升级必看.txt └── v1.0.0(SQL脚本).7z └── v2.0.0 ├── MySQL结构和示例数据脚本.zip ├── PostgreSQL结构和示例数据脚本.zip └── SQL Server结构和示例数据脚本.zip /DncZeus.Api/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "7.0.3", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /DncZeus.Api/Auth/AppAuthenticationSettings.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | namespace DncZeus.Api.Auth 9 | { 10 | /// 11 | /// JWT授权的配置项 12 | /// 13 | public class AppAuthenticationSettings 14 | { 15 | /// 16 | /// 应用ID 17 | /// 18 | public string AppId { get; set; } 19 | /// 20 | /// 应用密钥(真实项目中可能区分应用,不同的应用对应惟一的密钥) 21 | /// 22 | public string Secret { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /DncZeus.Api/Configurations/AppSettings.cs: -------------------------------------------------------------------------------- 1 | namespace DncZeus.Api.Configurations 2 | { 3 | /// 4 | /// 程序配置选项 5 | /// 6 | public class AppSettings 7 | { 8 | /// 9 | /// 是否是体验版 10 | /// 11 | public bool IsTrialVersion { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DncZeus.Api/Configurations/MappingProfile.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using AutoMapper; 9 | using DncZeus.Api.Entities; 10 | using DncZeus.Api.Entities.QueryModels; 11 | using DncZeus.Api.ViewModels.Rbac.DncIcon; 12 | using DncZeus.Api.ViewModels.Rbac.DncMenu; 13 | using DncZeus.Api.ViewModels.Rbac.DncPermission; 14 | using DncZeus.Api.ViewModels.Rbac.DncRole; 15 | using DncZeus.Api.ViewModels.Rbac.DncUser; 16 | 17 | namespace DncZeus.Api.Configurations 18 | { 19 | /// 20 | /// 21 | /// 22 | public class MappingProfile : Profile 23 | { 24 | /// 25 | /// 26 | /// 27 | public MappingProfile() 28 | { 29 | #region DncUser 30 | CreateMap(); 31 | CreateMap(); 32 | CreateMap(); 33 | CreateMap(); 34 | #endregion 35 | 36 | #region DncRole 37 | CreateMap(); 38 | CreateMap(); 39 | CreateMap(); 40 | #endregion 41 | 42 | #region DncMenu 43 | CreateMap(); 44 | CreateMap(); 45 | CreateMap(); 46 | CreateMap(); 47 | CreateMap(); 48 | CreateMap(); 49 | #endregion 50 | 51 | #region DncIcon 52 | CreateMap(); 53 | CreateMap(); 54 | CreateMap(); 55 | #endregion 56 | 57 | #region DncPermission 58 | CreateMap() 59 | .ForMember(d => d.MenuName, s => s.MapFrom(x => x.Menu.Name)) 60 | .ForMember(d => d.PermissionTypeText, s => s.MapFrom(x => x.Type.ToString())); 61 | CreateMap(); 62 | CreateMap(); 63 | CreateMap(); 64 | #endregion 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /DncZeus.Api/Controllers/Api/V2/UserController.cs: -------------------------------------------------------------------------------- 1 | using DncZeus.Api.Entities; 2 | using DncZeus.Api.Extensions; 3 | using Microsoft.AspNetCore.Mvc; 4 | using System.Linq; 5 | 6 | namespace DncZeus.Api.Controllers.api.v2 7 | { 8 | /// 9 | /// 10 | /// 11 | //[CustomAuthorize] 12 | [Route("api/v2/[controller]/[action]")] 13 | [ApiController] 14 | public class UserController : ControllerBase 15 | { 16 | private readonly DncZeusDbContext _dbContext; 17 | public UserController(DncZeusDbContext dbContext) 18 | { 19 | _dbContext = dbContext; 20 | } 21 | [HttpGet] 22 | public IActionResult List() 23 | { 24 | using (_dbContext) 25 | { 26 | var list = _dbContext.DncUser.ToList(); 27 | var response = ResponseModelFactory.CreateInstance; 28 | response.SetData(list); 29 | return Ok(response); 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /DncZeus.Api/Controllers/ErrorController.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Extensions.CustomException; 9 | using Microsoft.AspNetCore.Diagnostics; 10 | using Microsoft.AspNetCore.Http.Features; 11 | using Microsoft.AspNetCore.Mvc; 12 | using System; 13 | using System.Net; 14 | 15 | namespace DncZeus.Api.Controllers 16 | { 17 | /// 18 | /// 19 | /// 20 | [Route("/error")] 21 | [ApiController] 22 | public class ErrorController : ControllerBase 23 | { 24 | /// 25 | /// 26 | /// 27 | /// 28 | /// 29 | [Route("{code}")] 30 | [HttpGet] 31 | public IActionResult Code(int code) 32 | { 33 | // 捕获状态码 34 | var statusCode = HttpContext.Features.Get()?.Error is HttpException httpEx ? 35 | httpEx.StatusCode : (HttpStatusCode)Response.StatusCode; 36 | var ex = (HttpException)HttpContext.Features.Get()?.Error; 37 | 38 | var parsedCode = (HttpStatusCode)code; 39 | var error = new ErrorDetails 40 | { 41 | StatusCode = code, 42 | Message = ex?.ToString() 43 | }; 44 | // 如果是ASP.NET Core Web Api 应用程序,直接返回状态码(不跳转到错误页面,这里假设所有API接口的路径都是以/api/开始的) 45 | if (HttpContext.Features.Get().RawTarget.StartsWith("/api/", StringComparison.Ordinal)) 46 | { 47 | parsedCode = (HttpStatusCode)code; 48 | // error = new ErrorDetails 49 | //{ 50 | // StatusCode = code, 51 | // Message = parsedCode.ToString() 52 | //}; 53 | 54 | return new ObjectResult(error); 55 | } 56 | 57 | // error = new ErrorDetails 58 | //{ 59 | // StatusCode = code, 60 | // Message = parsedCode.ToString() 61 | //}; 62 | 63 | return new ObjectResult(error); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /DncZeus.Api/Controllers/TestController.cs: -------------------------------------------------------------------------------- 1 | using DncZeus.Api.Extensions; 2 | using DncZeus.Api.Models.Response; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Extensions.Logging; 5 | 6 | // For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 7 | 8 | namespace DncZeus.Api.Controllers 9 | { 10 | /// 11 | /// 测试控制器 12 | /// 13 | [ApiController] 14 | [Route("[controller]/[action]")] 15 | public class TestController : Controller 16 | { 17 | private readonly ILogger _logger; 18 | 19 | public TestController(ILogger logger) 20 | { 21 | _logger = logger; 22 | } 23 | 24 | /// 25 | /// 测试日志 26 | /// 27 | /// 28 | // GET: // 29 | [HttpGet] 30 | public IActionResult Logger() 31 | { 32 | _logger.LogDebug(message: "LogDebug()..."); 33 | _logger.LogInformation(message: "LogInformation()..."); 34 | _logger.LogWarning(message: "LogWarning()..."); 35 | _logger.LogError(message: "LogError()..."); 36 | ResponseResultModel response = ResponseModelFactory.CreateResultInstance; 37 | response.SetSuccess(message: "test logger success"); 38 | return Ok(value: response); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/AuditEntity.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.ComponentModel.DataAnnotations.Schema; 10 | 11 | namespace DncZeus.Api.Entities 12 | { 13 | public abstract class AuditEntity 14 | { 15 | [Column(Order = 100)] 16 | public DateTime CreatedOn { get; set; } 17 | [Column(Order = 101)] 18 | public Guid? CreatedByUserGuid { get; set; } 19 | [Column(Order = 102)] 20 | public string CreatedByUserName { get; set; } 21 | [Column(Order = 103)] 22 | public DateTime? ModifiedOn { get; set; } 23 | [Column(Order = 104)] 24 | public Guid? ModifiedByUserGuid { get; set; } 25 | [Column(Order = 105)] 26 | public string ModifiedByUserName { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/DncRolePermissionMapping.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.ComponentModel; 10 | using System.ComponentModel.DataAnnotations; 11 | using static DncZeus.Api.Entities.Enums.CommonEnum; 12 | 13 | namespace DncZeus.Api.Entities 14 | { 15 | /// 16 | /// 角色权限关系表 17 | /// 18 | public class DncRolePermissionMapping 19 | { 20 | /// 21 | /// 角色编码 22 | /// 23 | [Required] 24 | [StringLength(50)] 25 | public string RoleCode { get; set; } 26 | /// 27 | /// 权限编码 28 | /// 29 | [StringLength(20)] 30 | public string PermissionCode { get; set; } 31 | 32 | /// 33 | /// 角色实体 34 | /// 35 | public DncRole DncRole { get; set; } 36 | 37 | /// 38 | /// 权限实体 39 | /// 40 | public DncPermission DncPermission { get; set; } 41 | /// 42 | /// 创建时间 43 | /// 44 | public DateTime CreatedOn { get; set; } 45 | /// 46 | /// 是否为种子数据 47 | /// 48 | [DefaultValue(0)] 49 | public YesOrNo IsSeed { get; set; } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/DncUserRoleMapping.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.ComponentModel; 10 | using static DncZeus.Api.Entities.Enums.CommonEnum; 11 | 12 | namespace DncZeus.Api.Entities 13 | { 14 | /// 15 | /// 用户-角色映射 16 | /// 17 | public class DncUserRoleMapping 18 | { 19 | /// 20 | /// 用户GUID 21 | /// 22 | public Guid UserGuid { get; set; } 23 | /// 24 | /// 用户实体 25 | /// 26 | public DncUser DncUser { get; set; } 27 | 28 | /// 29 | /// 角色编码 30 | /// 31 | public string RoleCode { get; set; } 32 | /// 33 | /// 角色实体 34 | /// 35 | public DncRole DncRole { get; set; } 36 | /// 37 | /// 创建时间 38 | /// 39 | public DateTime CreatedOn { get; set; } 40 | /// 41 | /// 是否为种子数据 42 | /// 43 | [DefaultValue(0)] 44 | public YesOrNo IsSeed { get; set; } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/Entity.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATED_ON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | namespace DncZeus.Api.Entities 9 | { 10 | public abstract class Entity 11 | { 12 | public T Id { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/QueryModels/DncMenuQueryModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-11-13 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * DESCRIPTION: 菜单实体类 6 | ******************************************/ 7 | 8 | using System; 9 | using System.ComponentModel.DataAnnotations; 10 | 11 | namespace DncZeus.Api.Entities.QueryModels 12 | { 13 | /// 14 | /// 菜单实体类 15 | /// 16 | public class DncMenuQueryModel 17 | { 18 | /// 19 | /// GUID 20 | /// 21 | public Guid Guid { get; set; } 22 | /// 23 | /// 菜单名称 24 | /// 25 | public string Name { get; set; } 26 | /// 27 | /// 链接地址 28 | /// 29 | public string Url { get; set; } 30 | /// 31 | /// 页面别名 32 | /// 33 | public string Alias { get; set; } 34 | /// 35 | /// 菜单图标(可选) 36 | /// 37 | public string Icon { get; set; } 38 | /// 39 | /// 父级GUID 40 | /// 41 | public Guid? ParentGuid { get; set; } 42 | /// 43 | /// 排序 44 | /// 45 | public int Sort { get; set; } 46 | /// 47 | /// 是否为默认路由 48 | /// 49 | public int IsDefaultRouter { get; set; } 50 | 51 | /// 52 | /// 前端组件(.vue) 53 | /// 54 | [StringLength(255)] 55 | public string Component { get; set; } 56 | 57 | /// 58 | /// 在菜单中隐藏 59 | /// 60 | public int? HideInMenu { get; set; } 61 | /// 62 | /// 不缓存页面 63 | /// 64 | public int? NotCache { get; set; } 65 | /// 66 | /// 页面关闭前的回调函数 67 | /// 68 | [StringLength(255)] 69 | public string BeforeCloseFun { get; set; } 70 | 71 | /// 72 | /// 创建时间 73 | /// 74 | public DateTime CreatedOn { get; set; } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/QueryModels/DncPermission/DncPermissionWithAssignProperty.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | 10 | namespace DncZeus.Api.Entities.QueryModels.DncPermission 11 | { 12 | /// 13 | /// 14 | /// 15 | public class DncPermissionWithAssignProperty 16 | { 17 | /// 18 | /// 权限编码 19 | /// 20 | public string Code { get; set; } 21 | /// 22 | /// 权限名称 23 | /// 24 | public string Name { get; set; } 25 | /// 26 | /// 权限关联的菜单GUID 27 | /// 28 | public Guid? MenuGuid { get; set; } 29 | /// 30 | /// 权限操作码 31 | /// 32 | public string ActionCode { get; set; } 33 | /// 34 | /// 角色编码 35 | /// 36 | public string RoleCode { get; set; } 37 | /// 38 | /// 权限是否已分配到当前角色 39 | /// 40 | public int IsAssigned { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /DncZeus.Api/Entities/QueryModels/DncPermission/DncPermissionWithMenu.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.Entities 12 | { 13 | /// 14 | /// 权限实体类 15 | /// 16 | public class DncPermissionWithMenu 17 | { 18 | /// 19 | /// 权限码 20 | /// 21 | public string PermissionCode { get; set; } 22 | /// 23 | /// 权限操作码 24 | /// 25 | public string PermissionActionCode { get; set; } 26 | /// 27 | /// 权限名称 28 | /// 29 | public string PermissionName { get; set; } 30 | /// 31 | /// 32 | /// 33 | public PermissionType PermissionType { get; set; } 34 | /// 35 | /// 菜单名称 36 | /// 37 | public string MenuName { get; set; } 38 | /// 39 | /// 菜单GUID 40 | /// 41 | public Guid MenuGuid { get; set; } 42 | /// 43 | /// 菜单别名(与前端路由配置中的name值保持一致) 44 | /// 45 | public string MenuAlias { get; set; } 46 | /// 47 | /// 是否是默认前端路由 48 | /// 49 | public YesOrNo IsDefaultRouter { get; set; } 50 | } 51 | } -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/AuthContext/AuthContextService.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Entities; 9 | using Microsoft.AspNetCore.Http; 10 | using System; 11 | using System.Security.Claims; 12 | 13 | namespace DncZeus.Api.Extensions.AuthContext 14 | { 15 | /// 16 | /// 17 | /// 18 | public static class AuthContextService 19 | { 20 | private static IHttpContextAccessor _context; 21 | /// 22 | /// 23 | /// 24 | /// 25 | public static void Configure(IHttpContextAccessor httpContextAccessor) 26 | { 27 | _context = httpContextAccessor; 28 | } 29 | /// 30 | /// 31 | /// 32 | public static HttpContext Current => _context.HttpContext; 33 | /// 34 | /// 35 | /// 36 | public static AuthContextUser CurrentUser 37 | { 38 | get 39 | { 40 | var user = new AuthContextUser 41 | { 42 | LoginName = Current.User.FindFirstValue(ClaimTypes.NameIdentifier), 43 | DisplayName = Current.User.FindFirstValue("displayName"), 44 | EmailAddress = Current.User.FindFirstValue("emailAddress"), 45 | UserType = (UserType)Convert.ToInt32(Current.User.FindFirstValue("userType")), 46 | Avator= Current.User.FindFirstValue("avator"), 47 | Guid= new Guid(Current.User.FindFirstValue("guid")) 48 | }; 49 | return user; 50 | } 51 | } 52 | 53 | /// 54 | /// 是否已授权 55 | /// 56 | public static bool IsAuthenticated 57 | { 58 | get 59 | { 60 | return Current.User.Identity.IsAuthenticated; 61 | } 62 | } 63 | 64 | /// 65 | /// 是否是超级管理员 66 | /// 67 | public static bool IsSupperAdministator 68 | { 69 | get 70 | { 71 | return ((UserType)Convert.ToInt32(Current.User.FindFirstValue("userType"))== UserType.SuperAdministrator); 72 | } 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/AuthContext/AuthContextUser.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Entities; 9 | using System; 10 | 11 | namespace DncZeus.Api.Extensions.AuthContext 12 | { 13 | /// 14 | /// 登录用户上下文 15 | /// 16 | public class AuthContextUser 17 | { 18 | /// 19 | /// 用户GUID 20 | /// 21 | public Guid Guid { get; set; } 22 | /// 23 | /// 显示名 24 | /// 25 | public string DisplayName { get; set; } 26 | /// 27 | /// 登录名 28 | /// 29 | public string LoginName { get; set; } 30 | /// 31 | /// 电子邮箱 32 | /// 33 | public string EmailAddress { get; set; } 34 | /// 35 | /// 用户类型 36 | /// 37 | public UserType UserType { get; set; } 38 | /// 39 | /// 头像地址 40 | /// 41 | public string Avator { get; set; } 42 | /// 43 | /// 当前用户是否是超级管理员 44 | /// 45 | public bool IsSupperAdministrator => UserType == UserType.SuperAdministrator; 46 | } 47 | } -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/ConfigurationManager.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using System.IO; 3 | using DncZeus.Api.Configurations; 4 | 5 | namespace DncZeus.Api.Extensions 6 | { 7 | /// 8 | /// 配置文件管理器 9 | /// 10 | public static class ConfigurationManager 11 | { 12 | /// 13 | /// 14 | /// 15 | public static IConfiguration Configuration { get; } 16 | static ConfigurationManager() 17 | { 18 | Configuration = new ConfigurationBuilder() 19 | .SetBasePath(Directory.GetCurrentDirectory()) 20 | .AddJsonFile("appsettings.json") 21 | .Build(); 22 | } 23 | 24 | /// 25 | /// 读取配置文件[AppSettings]节点数据 26 | /// 27 | public static AppSettings AppSettings 28 | { 29 | get 30 | { 31 | var appSettings =new AppSettings(); 32 | Configuration.GetSection("AppSettings").Bind(appSettings); 33 | return appSettings; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/CanAccess.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2019-01-08 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | 12 | namespace DncZeus.Api.Extensions.CustomException 13 | { 14 | /// 15 | /// 用户可以访问的控制器及操作权限 16 | /// 17 | public class CanAccess 18 | { 19 | /// 20 | /// 控制器 21 | /// 22 | public string Controller { get; set; } 23 | /// 24 | /// Action集合 25 | /// 26 | public List Actions { get; set; } 27 | } 28 | 29 | /// 30 | /// 用户拥有的API操作权限 31 | /// 32 | public class OwnedApiPermission 33 | { 34 | /// 35 | /// 36 | /// 37 | public OwnedApiPermission() 38 | { 39 | CanAccesses = new List(); 40 | } 41 | /// 42 | /// 可以访问的API控制器集合 43 | /// 44 | public List CanAccesses { get; set; } 45 | 46 | /// 47 | /// 是否可以访问 48 | /// 49 | /// 50 | /// 51 | /// 52 | public bool Can(string controller, string action) 53 | { 54 | if (string.IsNullOrEmpty(controller) || string.IsNullOrEmpty(action)) 55 | { 56 | return false; 57 | } 58 | var ctrl = CanAccesses.Where(x => string.Equals(controller, x.Controller,StringComparison.OrdinalIgnoreCase)).FirstOrDefault(x => x.Controller == controller); 59 | if (ctrl == null) 60 | { 61 | return false; 62 | } 63 | 64 | return ctrl.Actions.Contains(action, StringComparer.OrdinalIgnoreCase); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/ErrorDetails.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Newtonsoft.Json; 9 | using Newtonsoft.Json.Serialization; 10 | 11 | namespace DncZeus.Api.Extensions.CustomException 12 | { 13 | public class ErrorDetails 14 | { 15 | public int StatusCode { get; set; } 16 | public string Message { get; set; } 17 | 18 | 19 | public override string ToString() 20 | { 21 | return JsonConvert.SerializeObject(this,new JsonSerializerSettings { 22 | ContractResolver = new DefaultContractResolver 23 | { 24 | NamingStrategy = new CamelCaseNamingStrategy() 25 | }, 26 | Formatting = Formatting.Indented 27 | }); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/ExceptionMiddleware.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.AspNetCore.Http; 9 | using System; 10 | using System.Net; 11 | using System.Threading.Tasks; 12 | 13 | namespace DncZeus.Api.Extensions.CustomException 14 | { 15 | /// 16 | /// 异常中间件 17 | /// 18 | public class ExceptionMiddleware 19 | { 20 | private readonly RequestDelegate _next; 21 | /// 22 | /// 23 | /// 24 | /// 25 | public ExceptionMiddleware(RequestDelegate next) 26 | { 27 | _next = next; 28 | } 29 | 30 | public async Task InvokeAsync(HttpContext httpContext) 31 | { 32 | try 33 | { 34 | await _next(httpContext); 35 | } 36 | catch (Exception ex) 37 | { 38 | await HandleExceptionAsync(httpContext, ex); 39 | } 40 | } 41 | 42 | private static Task HandleExceptionAsync(HttpContext context, Exception exception) 43 | { 44 | var error = new ErrorDetails { 45 | StatusCode= 500, 46 | Message=$"资源服务器忙,请稍候再试,原因:{exception.Message}" 47 | }; 48 | if (exception is UnauthorizeException) 49 | { 50 | error.StatusCode= (int)HttpStatusCode.Unauthorized; 51 | error.Message = "未授权的访问(未登录或者登录已超时)"; 52 | } 53 | 54 | context.Response.ContentType = "application/json"; 55 | context.Response.StatusCode = error.StatusCode; 56 | 57 | return context.Response.WriteAsync(error.ToString()); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/ExceptionMiddlewareExtensions.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.AspNetCore.Builder; 9 | 10 | namespace DncZeus.Api.Extensions.CustomException 11 | { 12 | public static class ExceptionMiddlewareExtensions 13 | { 14 | public static void ConfigureCustomExceptionMiddleware(this IApplicationBuilder app) 15 | { 16 | app.UseMiddleware(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/HttpException.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.Net; 10 | 11 | namespace DncZeus.Api.Extensions.CustomException 12 | { 13 | /// 14 | /// 15 | /// 16 | public class HttpException : Exception 17 | { 18 | /// 19 | /// 20 | /// 21 | /// 22 | public HttpException(HttpStatusCode statusCode) { StatusCode = statusCode; } 23 | /// 24 | /// 25 | /// 26 | public HttpStatusCode StatusCode { get; private set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/UnauthorizeException.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | 10 | namespace DncZeus.Api.Extensions.CustomException 11 | { 12 | /// 13 | /// 未授权的异常类 14 | /// 15 | public class UnauthorizeException : Exception 16 | { 17 | /// 18 | /// 19 | /// 20 | public UnauthorizeException() 21 | { 22 | 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/CustomException/ValidateModelAttribute.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.AspNetCore.Mvc.Filters; 10 | using System.Linq; 11 | 12 | namespace DncZeus.Api.Extensions.CustomException 13 | { 14 | /// 15 | /// 16 | /// 17 | public class ValidateModelAttribute : ActionFilterAttribute 18 | { 19 | /// 20 | /// 21 | /// 22 | /// 23 | public override void OnActionExecuting(ActionExecutingContext actionContext) 24 | { 25 | if (!actionContext.ModelState.IsValid) 26 | { 27 | actionContext.Result = new ObjectResult( 28 | actionContext.ModelState.Values 29 | .SelectMany(e => e.Errors) 30 | .Select(e => e.ErrorMessage)); 31 | } 32 | } 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/DataAccess/EntityFrameworkExtension.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.EntityFrameworkCore; 9 | using Microsoft.EntityFrameworkCore.Infrastructure; 10 | using System.Collections.Generic; 11 | using System.Data; 12 | 13 | namespace DncZeus.Api.Extensions.DataAccess 14 | { 15 | /// 16 | /// 17 | /// 18 | public static class EntityFrameworkExtension 19 | { 20 | /// 21 | /// 调用ADO.NET执行SQL语句查询泛型集合 22 | /// 23 | /// 24 | /// 数据库连接上下文 25 | /// SQL语句 26 | /// SQL语句需要的参数 27 | /// 28 | public static List FromSql(this DatabaseFacade database, string sql, object parameters = null) 29 | { 30 | var result = new List(); 31 | using (var command = database.GetDbConnection().CreateCommand()) 32 | { 33 | command.CommandText = sql; 34 | if (parameters != null) 35 | { 36 | var _parameters = parameters.ToSqlParamsArray(); 37 | command.Parameters.AddRange(_parameters); 38 | } 39 | 40 | database.OpenConnection(); 41 | using (var reader = command.ExecuteReader()) 42 | { 43 | var dt = new DataTable(); 44 | dt.Load(reader); 45 | result = dt.ToList(); 46 | return result; 47 | } 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/DataAccess/OrderByExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.Linq.Expressions; 3 | 4 | namespace DncZeus.Api.Extensions.DataAccess 5 | { 6 | /// 7 | /// 排序静态扩展类 8 | /// 9 | public static class OrderByExtensions 10 | { 11 | private static IOrderedQueryable OrderingHelper(IQueryable source, string propertyName, bool descending, bool anotherLevel) 12 | { 13 | var param = Expression.Parameter(typeof(T), "p"); 14 | var property = Expression.PropertyOrField(param, propertyName); 15 | var sort = Expression.Lambda(property, param); 16 | 17 | var call = Expression.Call( 18 | typeof(Queryable), 19 | (!anotherLevel ? "OrderBy" : "ThenBy") + (descending ? "Descending" : string.Empty), 20 | new[] { typeof(T), property.Type }, 21 | source.Expression, 22 | Expression.Quote(sort)); 23 | 24 | return (IOrderedQueryable)source.Provider.CreateQuery(call); 25 | } 26 | 27 | public static IOrderedQueryable OrderBy(this IQueryable source, string propertyName) 28 | { 29 | return OrderingHelper(source, propertyName, false, false); 30 | } 31 | 32 | public static IOrderedQueryable OrderBy(this IQueryable source, string propertyName, bool descending) 33 | { 34 | return OrderingHelper(source, propertyName, descending, false); 35 | } 36 | 37 | public static IOrderedQueryable ThenBy(this IOrderedQueryable source, string propertyName) 38 | { 39 | return OrderingHelper(source, propertyName, false, true); 40 | } 41 | 42 | public static IOrderedQueryable ThenBy(this IOrderedQueryable source, string propertyName, bool descending) 43 | { 44 | return OrderingHelper(source, propertyName, descending, true); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/QuartzExtension.cs: -------------------------------------------------------------------------------- 1 | using DncZeus.Api.Utils; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Quartz; 4 | 5 | namespace DncZeus.Api.Extensions 6 | { 7 | public static class QuartzExtension 8 | { 9 | /// 10 | /// 每天定期重置示例数据 11 | /// 12 | /// 13 | /// 14 | public static IServiceCollection AddRestoreScheduler(this IServiceCollection services) 15 | { 16 | if (!ConfigurationManager.AppSettings.IsTrialVersion) return services; 17 | services.AddQuartz(q => 18 | { 19 | q.UseMicrosoftDependencyInjectionJobFactory(); 20 | var jobKey = new JobKey("ResetDatabase"); 21 | q.AddJob(opts => opts.WithIdentity(jobKey)); 22 | 23 | q.AddTrigger(opts => opts 24 | .ForJob(jobKey) 25 | .WithIdentity("ResetDatabase-trigger") 26 | .WithCronSchedule("0 2 0 ? * *") //0 2 0 ? * *,0 2 * * *,0 * * ? * * 27 | ); 28 | }); 29 | services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true); 30 | return services; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/QueryableExtension.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.EntityFrameworkCore.Query.Internal; 9 | using Microsoft.EntityFrameworkCore.Storage; 10 | using System.Linq; 11 | using System.Reflection; 12 | 13 | namespace DncZeus.Api.Extensions 14 | { 15 | /// 16 | /// 17 | /// 18 | public static class QueryableExtension 19 | { 20 | /// 21 | /// IQueryable分页 22 | /// 23 | /// 24 | /// 25 | /// 26 | /// 27 | /// 28 | public static IQueryable Paged(this IQueryable query, int currentPage = 1, int pageSize = 20) 29 | { 30 | if (currentPage < 1) 31 | { 32 | currentPage = 1; 33 | } 34 | query = query.Skip((currentPage - 1) * pageSize).Take(pageSize); 35 | return query; 36 | } 37 | 38 | 39 | private static readonly TypeInfo QueryCompilerTypeInfo = typeof(QueryCompiler).GetTypeInfo(); 40 | 41 | private static readonly FieldInfo QueryCompilerField = typeof(EntityQueryProvider).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryCompiler"); 42 | private static readonly FieldInfo QueryModelGeneratorField = typeof(QueryCompiler).GetTypeInfo().DeclaredFields.First(x => x.Name == "_queryModelGenerator"); 43 | private static readonly FieldInfo DataBaseField = QueryCompilerTypeInfo.DeclaredFields.Single(x => x.Name == "_database"); 44 | private static readonly PropertyInfo DatabaseDependenciesField = typeof(Microsoft.EntityFrameworkCore.DbLoggerCategory.Database).GetTypeInfo().DeclaredProperties.Single(x => x.Name == "Dependencies"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DncZeus.Api/Extensions/ResponseModelFactory.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Models.Response; 9 | 10 | namespace DncZeus.Api.Extensions 11 | { 12 | /// 13 | /// / 14 | /// 15 | public class ResponseModelFactory 16 | { 17 | /// 18 | /// 19 | /// 20 | public static ResponseModel CreateInstance => new ResponseModel(); 21 | /// 22 | /// 23 | /// 24 | public static ResponseResultModel CreateResultInstance => new ResponseResultModel(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DncZeus.Api/Models/Menu/MenuJsonModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System.Collections.Generic; 9 | 10 | namespace DncZeus.Api.Models.Menu 11 | { 12 | public class MenuJsonModel 13 | { 14 | public MenuJsonModel() 15 | { 16 | Children = new List(); 17 | } 18 | public string Path { get; set; } 19 | public string Icon { get; set; } 20 | public string Name { get; set; } 21 | public string Title { get; set; } 22 | public string Component { get; set; } 23 | public List Children { get; set; } 24 | } 25 | 26 | public class Child 27 | { 28 | public Child() 29 | { 30 | Permission = new List(); 31 | } 32 | public string Path { get; set; } 33 | public string Icon { get; set; } 34 | public string Name { get; set; } 35 | public string Title { get; set; } 36 | public string Component { get; set; } 37 | public List Permission { get; set; } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /DncZeus.Api/Models/Menu/Router.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | using System.Linq; 11 | using System.Threading.Tasks; 12 | 13 | namespace DncZeus.Api.Models.Menu 14 | { 15 | /// 16 | /// 用于前端的路由对象 17 | /// 18 | public class Router 19 | { 20 | public Router() 21 | { 22 | Meta = new RouterMeta(); 23 | Children = new List(); 24 | } 25 | public string Path { get; set; } 26 | public string Name { get; set; } 27 | public string Component { get; set; } 28 | public RouterMeta Meta { get; set; } 29 | public List Children { get; set; } 30 | } 31 | /// 32 | /// 33 | /// 34 | public class RouterMeta 35 | { 36 | public string Title { get; set; } 37 | public bool hideInMenu { get; set; } 38 | public bool NotCache { get; set; } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /DncZeus.Api/Models/Response/ResponseResultModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | namespace DncZeus.Api.Models.Response 9 | { 10 | /// 11 | /// 12 | /// 13 | public class ResponseResultModel : ResponseModel 14 | { 15 | /// 16 | /// 17 | /// 18 | public int TotalCount { get; set; } 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public void SetData(object data,int totalCount = 0) 25 | { 26 | Data = data; 27 | TotalCount = totalCount; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DncZeus.Api/Program.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using Microsoft.AspNetCore; 9 | using Microsoft.AspNetCore.Hosting; 10 | 11 | namespace DncZeus.Api 12 | { 13 | /// 14 | /// 15 | /// 16 | public class Program 17 | { 18 | ///// 19 | ///// 应用程序启动入口方法(Main) 20 | ///// 21 | ///// 22 | //public static void Main(string[] args) 23 | //{ 24 | // //CreateWebHostBuilder(args).Build().Run(); 25 | // var host = CreateWebHostBuilder(args).Build(); 26 | // host.Run(); 27 | //} 28 | 29 | ///// 30 | ///// 31 | ///// 32 | ///// 33 | ///// 34 | //public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 35 | // WebHost.CreateDefaultBuilder(args) 36 | // .UseKestrel(c => c.AddServerHeader = false) 37 | // .UseStartup(); 38 | 39 | public static void Main(string[] args) 40 | { 41 | CreateWebHostBuilder(args).Build().Run(); 42 | } 43 | 44 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 45 | WebHost.CreateDefaultBuilder(args) 46 | //.UseKestrel(c => c.AddServerHeader = false) 47 | .UseStartup(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /DncZeus.Api/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:5432", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/values", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "DncZeus.Api": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/values", 24 | "applicationUrl": "http://localhost:5432", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/Icon/IconRequestPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using static DncZeus.Api.Entities.Enums.CommonEnum; 9 | 10 | namespace DncZeus.Api.RequestPayload.Rbac.Icon 11 | { 12 | /// 13 | /// 图标请求参数实体 14 | /// 15 | public class IconRequestPayload : RequestPayload 16 | { 17 | /// 18 | /// 是否已被删除 19 | /// 20 | public IsDeleted IsDeleted { get; set; } 21 | /// 22 | /// 状态 23 | /// 24 | public Status Status { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/Menu/MenuRequestPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.RequestPayload.Rbac.Menu 12 | { 13 | /// 14 | /// 15 | /// 16 | public class MenuRequestPayload : RequestPayload 17 | { 18 | /// 19 | /// 是否已被删除 20 | /// 21 | public IsDeleted IsDeleted { get; set; } 22 | /// 23 | /// 状态 24 | /// 25 | public Status Status { get; set; } 26 | /// 27 | /// 上级菜单GUID 28 | /// 29 | public Guid? ParentGuid { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/Permission/PermissionRequestPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.RequestPayload.Rbac.Permission 12 | { 13 | /// 14 | /// 15 | /// 16 | public class PermissionRequestPayload : RequestPayload 17 | { 18 | /// 19 | /// 是否已被删除 20 | /// 21 | public IsDeleted IsDeleted { get; set; } 22 | /// 23 | /// 状态 24 | /// 25 | public Status Status { get; set; } 26 | /// 27 | /// 关联菜单GUID 28 | /// 29 | public Guid? MenuGuid { get; set; } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/Role/RoleAssignPermissionPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System.Collections.Generic; 9 | 10 | namespace DncZeus.Api.RequestPayload.Rbac.Role 11 | { 12 | /// 13 | /// 角色分配权限的请求载体类 14 | /// 15 | public class RoleAssignPermissionPayload 16 | { 17 | /// 18 | /// 19 | /// 20 | public RoleAssignPermissionPayload() 21 | { 22 | Permissions = new List(); 23 | } 24 | /// 25 | /// 角色编码 26 | /// 27 | public string RoleCode { get; set; } 28 | /// 29 | /// 权限列表 30 | /// 31 | public List Permissions { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/Role/RoleRequestPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using static DncZeus.Api.Entities.Enums.CommonEnum; 9 | 10 | namespace DncZeus.Api.RequestPayload.Rbac.Role 11 | { 12 | /// 13 | /// 14 | /// 15 | public class RoleRequestPayload : RequestPayload 16 | { 17 | /// 18 | /// 是否已被删除 19 | /// 20 | public IsDeleted IsDeleted { get; set; } 21 | /// 22 | /// 状态 23 | /// 24 | public Status Status { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DncZeus.Api/RequestPayload/Rbac/User/UserRequestPayload.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Entities; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.RequestPayload.Rbac.User 12 | { 13 | /// 14 | /// 15 | /// 16 | public class UserRequestPayload : RequestPayload 17 | { 18 | /// 19 | /// 是否已被删除 20 | /// 21 | public IsDeleted IsDeleted { get; set; } 22 | /// 23 | /// 用户状态 24 | /// 25 | public UserStatus Status { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DncZeus.Api/Utils/ResetDatabase.cs: -------------------------------------------------------------------------------- 1 | using DncZeus.Api.Entities; 2 | using DncZeus.Api.Entities.Enums; 3 | using Quartz; 4 | using System; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | 8 | namespace DncZeus.Api.Utils 9 | { 10 | public class ResetDatabase : IJob 11 | { 12 | private DncZeusDbContext _dbContext; 13 | 14 | public ResetDatabase(DncZeusDbContext dbContext) 15 | { 16 | _dbContext = dbContext; 17 | } 18 | 19 | /// 20 | /// 21 | /// 22 | /// 23 | /// 24 | public async Task Execute(IJobExecutionContext context) 25 | { 26 | Console.WriteLine("开始重置数据..."); 27 | await using (_dbContext) 28 | { 29 | _dbContext.DncRolePermissionMapping.RemoveRange(_dbContext.DncRolePermissionMapping.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 30 | _dbContext.DncUserRoleMapping.RemoveRange(_dbContext.DncUserRoleMapping.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 31 | _dbContext.DncIcon.RemoveRange(_dbContext.DncIcon.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 32 | _dbContext.DncMenu.RemoveRange(_dbContext.DncMenu.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 33 | _dbContext.DncPermission.RemoveRange(_dbContext.DncPermission.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 34 | _dbContext.DncRole.RemoveRange(_dbContext.DncRole.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 35 | _dbContext.DncUser.RemoveRange(_dbContext.DncUser.Where(x => x.IsSeed == CommonEnum.YesOrNo.No)); 36 | await _dbContext.SaveChangesAsync(); 37 | Console.WriteLine("数据重置完成..."); 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncIcon/IconCreateViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using static DncZeus.Api.Entities.Enums.CommonEnum; 9 | 10 | namespace DncZeus.Api.ViewModels.Rbac.DncIcon 11 | { 12 | /// 13 | /// 图标的视图类(创建/编辑) 14 | /// 15 | public class IconCreateViewModel 16 | { 17 | /// 18 | /// 19 | /// 20 | public int Id { get; set; } 21 | /// 22 | /// 图标名称 23 | /// 24 | public string Code { get; set; } 25 | /// 26 | /// 图标的大小,单位是 px 27 | /// 28 | public string Size { get; set; } 29 | /// 30 | /// 图标颜色 31 | /// 32 | public string Color { get; set; } 33 | /// 34 | /// 自定义图标 35 | /// 36 | public string Custom { get; set; } 37 | /// 38 | /// 39 | /// 40 | public string Description { get; set; } 41 | /// 42 | /// 43 | /// 44 | public Status Status { get; set; } 45 | /// 46 | /// 47 | /// 48 | public IsDeleted IsDeleted { get; set; } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncIcon/IconImportViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | namespace DncZeus.Api.ViewModels.Rbac.DncIcon 9 | { 10 | /// 11 | /// 12 | /// 13 | public class IconImportViewModel 14 | { 15 | /// 16 | /// 17 | /// 18 | public string Icons { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncIcon/IconJsonModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-11-14 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * DESCRIPTION: 图标信息实体类 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncIcon 12 | { 13 | /// 14 | /// 15 | /// 16 | public class IconJsonModel 17 | { 18 | /// 19 | /// 20 | /// 21 | public int Id { get; set; } 22 | /// 23 | /// 图标名称 24 | /// 25 | public string Code { get; set; } 26 | /// 27 | /// 图标的大小,单位是 px 28 | /// 29 | public string Size { get; set; } 30 | /// 31 | /// 图标颜色 32 | /// 33 | public string Color { get; set; } 34 | /// 35 | /// 自定义图标 36 | /// 37 | public string Custom { get; set; } 38 | /// 39 | /// 40 | /// 41 | public string Description { get; set; } 42 | /// 43 | /// 44 | /// 45 | public Status Status { get; set; } 46 | /// 47 | /// 48 | /// 49 | public IsDeleted IsDeleted { get; set; } 50 | /// 51 | /// 52 | /// 53 | public string CreatedOn { get; set; } 54 | /// 55 | /// 56 | /// 57 | public Guid CreatedByUserGuid { get; set; } 58 | /// 59 | /// 60 | /// 61 | public string CreatedByUserName { get; set; } 62 | /// 63 | /// 64 | /// 65 | public string ModifiedOn { get; set; } 66 | /// 67 | /// 68 | /// 69 | public Guid? ModifiedByUserGuid { get; set; } 70 | /// 71 | /// 72 | /// 73 | public string ModifiedByUserName { get; set; } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncMenu/MenuCreateViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncMenu 12 | { 13 | /// 14 | /// 15 | /// 16 | public class MenuCreateViewModel 17 | { 18 | /// 19 | /// 菜单名称 20 | /// 21 | public string Name { get; set; } 22 | /// 23 | /// 链接地址 24 | /// 25 | public string Url { get; set; } 26 | /// 27 | /// 页面别名 28 | /// 29 | public string Alias { get; set; } 30 | /// 31 | /// 菜单图标(可选) 32 | /// 33 | public string Icon { get; set; } 34 | /// 35 | /// 父级GUID 36 | /// 37 | public Guid? ParentGuid { get; set; } 38 | /// 39 | /// 上级菜单名称 40 | /// 41 | public string ParentName { get; set; } 42 | /// 43 | /// 菜单层级深度 44 | /// 45 | public int Level { get; set; } 46 | /// 47 | /// 描述信息 48 | /// 49 | public string Description { get; set; } 50 | /// 51 | /// 排序 52 | /// 53 | public int Sort { get; set; } 54 | /// 55 | /// 是否可用(0:禁用,1:可用) 56 | /// 57 | public Status Status { get; set; } 58 | /// 59 | /// 是否已删 60 | /// 61 | public IsDeleted IsDeleted { get; set; } 62 | /// 63 | /// 是否为默认路由 64 | /// 65 | public YesOrNo IsDefaultRouter { get; set; } 66 | /// 67 | /// 前端组件(.vue) 68 | /// 69 | public string Component { get; set; } 70 | /// 71 | /// 在菜单中隐藏 72 | /// 73 | public YesOrNo HideInMenu { get; set; } 74 | /// 75 | /// 不缓存页面 76 | /// 77 | public YesOrNo NotCache { get; set; } 78 | /// 79 | /// 页面关闭前的回调函数 80 | /// 81 | public string BeforeCloseFun { get; set; } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncMenu/MenuEditViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncMenu 12 | { 13 | /// 14 | /// 15 | /// 16 | public class MenuEditViewModel 17 | { 18 | /// 19 | /// 20 | /// 21 | public Guid Guid { get; set; } 22 | /// 23 | /// 菜单名称 24 | /// 25 | public string Name { get; set; } 26 | /// 27 | /// 链接地址 28 | /// 29 | public string Url { get; set; } 30 | /// 31 | /// 页面别名 32 | /// 33 | public string Alias { get; set; } 34 | /// 35 | /// 菜单图标(可选) 36 | /// 37 | public string Icon { get; set; } 38 | /// 39 | /// 父级GUID 40 | /// 41 | public Guid? ParentGuid { get; set; } 42 | /// 43 | /// 上级菜单名称 44 | /// 45 | public string ParentName { get; set; } 46 | /// 47 | /// 菜单层级深度 48 | /// 49 | public int Level { get; set; } 50 | /// 51 | /// 描述信息 52 | /// 53 | public string Description { get; set; } 54 | /// 55 | /// 排序 56 | /// 57 | public int Sort { get; set; } 58 | /// 59 | /// 是否可用(0:禁用,1:可用) 60 | /// 61 | public Status Status { get; set; } 62 | /// 63 | /// 是否已删 64 | /// 65 | public IsDeleted IsDeleted { get; set; } 66 | /// 67 | /// 是否为默认路由 68 | /// 69 | public YesOrNo IsDefaultRouter { get; set; } 70 | /// 71 | /// 前端组件(.vue) 72 | /// 73 | public string Component { get; set; } 74 | /// 75 | /// 在菜单中隐藏 76 | /// 77 | public YesOrNo HideInMenu { get; set; } 78 | /// 79 | /// 不缓存页面 80 | /// 81 | public YesOrNo NotCache { get; set; } 82 | /// 83 | /// 页面关闭前的回调函数 84 | /// 85 | public string BeforeCloseFun { get; set; } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncMenu/MenuItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace DncZeus.Api.ViewModels.Rbac.DncMenu 4 | { 5 | public class MenuItem 6 | { 7 | public MenuItem() 8 | { 9 | Meta = new MenuMeta(); 10 | Children = new List(); 11 | } 12 | public string Guid { get; set; } 13 | public string Name { get; set; } 14 | public string Path { get; set; } 15 | public string Component { get; set; } 16 | public string ParentId { get; set; } 17 | 18 | public MenuMeta Meta { get; set; } 19 | public List Children { get; set; } 20 | } 21 | 22 | public class MenuMeta 23 | { 24 | public MenuMeta() 25 | { 26 | Permission = new List(); 27 | BeforeCloseFun = ""; 28 | } 29 | public bool HideInMenu { get; set; } 30 | public string Icon { get; set; } 31 | public bool NotCache { get; set; } 32 | public string Title { get; set; } 33 | public List Permission { get; set; } 34 | public string BeforeCloseFun { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncMenu/MenuTree.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncMenu 12 | { 13 | /// 14 | /// 用于iview的菜单树 15 | /// 16 | public class MenuTree 17 | { 18 | /// 19 | /// 20 | /// 21 | public MenuTree() 22 | { 23 | Children = new List(); 24 | } 25 | /// 26 | /// GUID 27 | /// 28 | public string Guid { get; set; } 29 | /// 30 | /// 31 | /// 32 | public Guid? ParentGuid { get; set; } 33 | /// 34 | /// 标题(菜单名称) 35 | /// 36 | public string Title { get; set; } 37 | /// 38 | /// 是否展开子节点 39 | /// 40 | public bool Expand { get; set; } 41 | /// 42 | /// 禁掉响应 43 | /// 44 | public bool Disabled { get; set; } 45 | /// 46 | /// 禁掉 checkbox 47 | /// 48 | public bool DisableCheckbox { get; set; } 49 | /// 50 | /// 是否选中子节点 51 | /// 52 | public bool Selected { get; set; } 53 | /// 54 | /// 是否勾选(如果勾选,子节点也会全部勾选) 55 | /// 56 | public bool Checked { get; set; } 57 | /// 58 | /// 子节点属性数组 59 | /// 60 | public List Children { get; set; } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncPermission/PermissionCreateViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using DncZeus.Api.Entities.Enums; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncPermission 12 | { 13 | /// 14 | /// 权限实体类 15 | /// 16 | public class PermissionCreateViewModel 17 | { 18 | /// 19 | /// 权限编码 20 | /// 21 | public string Code { get; set; } 22 | /// 23 | /// 菜单GUID 24 | /// 25 | public Guid MenuGuid { get; set; } 26 | /// 27 | /// 权限名称 28 | /// 29 | public string Name { get; set; } 30 | /// 31 | /// 权限操作码 32 | /// 33 | public string ActionCode { get; set; } 34 | /// 35 | /// 图标(可选) 36 | /// 37 | public string Icon { get; set; } 38 | /// 39 | /// 描述信息 40 | /// 41 | public string Description { get; set; } 42 | /// 43 | /// 状态 44 | /// 45 | public CommonEnum.Status Status { get; set; } 46 | /// 47 | /// 是否已删 48 | /// 49 | public CommonEnum.IsDeleted IsDeleted { get; set; } 50 | /// 51 | /// 权限类型(0:菜单,1:按钮/操作/功能等) 52 | /// 53 | public CommonEnum.PermissionType Type { get; set; } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncPermission/PermissionEditViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using DncZeus.Api.Entities.Enums; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncPermission 12 | { 13 | /// 14 | /// 权限实体类 15 | /// 16 | public class PermissionEditViewModel 17 | { 18 | /// 19 | /// 权限编码 20 | /// 21 | public string Code { get; set; } 22 | /// 23 | /// 菜单GUID 24 | /// 25 | public Guid MenuGuid { get; set; } 26 | /// 27 | /// 菜单名称 28 | /// 29 | public string MenuName { get; set; } 30 | /// 31 | /// 权限名称 32 | /// 33 | public string Name { get; set; } 34 | /// 35 | /// 权限操作码 36 | /// 37 | public string ActionCode { get; set; } 38 | /// 39 | /// 图标(可选) 40 | /// 41 | public string Icon { get; set; } 42 | /// 43 | /// 描述信息 44 | /// 45 | public string Description { get; set; } 46 | /// 47 | /// 状态 48 | /// 49 | public CommonEnum.Status Status { get; set; } 50 | /// 51 | /// 是否已删 52 | /// 53 | public CommonEnum.IsDeleted IsDeleted { get; set; } 54 | /// 55 | /// 权限类型(0:菜单,1:按钮/操作/功能等) 56 | /// 57 | public CommonEnum.PermissionType Type { get; set; } 58 | /// 59 | /// 创建时间 60 | /// 61 | public DateTime CreatedOn { get; set; } 62 | /// 63 | /// 创建者ID 64 | /// 65 | public int CreatedByUserId { get; set; } 66 | /// 67 | /// 创建者姓名 68 | /// 69 | public string CreatedByUserName { get; set; } 70 | /// 71 | /// 最近修改时间 72 | /// 73 | public DateTime? ModifiedOn { get; set; } 74 | /// 75 | /// 最近修改者ID 76 | /// 77 | public int ModifiedByUserId { get; set; } 78 | /// 79 | /// 最近修改者 80 | /// 81 | public string ModifiedByUserName { get; set; } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncRole/RoleCreateViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncRole 12 | { 13 | /// 14 | /// 15 | /// 16 | public class RoleCreateViewModel 17 | { 18 | public string Code { get; set; } 19 | public string Name { get; set; } 20 | public string Description { get; set; } 21 | public Status Status { get; set; } 22 | public IsDeleted IsDeleted { get; set; } 23 | /// 24 | /// 是否是超级管理员(超级管理员拥有系统的所有权限) 25 | /// 26 | public bool IsSuperAdministrator { get; set; } 27 | /// 28 | /// 是否是系统内置角色(系统内置角色不允许删除,修改操作) 29 | /// 30 | public bool IsBuiltin { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncRole/RoleJsonModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * DESCRIPTION: 角色信息实体类 6 | ******************************************/ 7 | using System; 8 | using static DncZeus.Api.Entities.Enums.CommonEnum; 9 | 10 | namespace DncZeus.Api.ViewModels.Rbac.DncRole 11 | { 12 | /// 13 | /// 14 | /// 15 | public class RoleJsonModel 16 | { 17 | public int Id { get; set; } 18 | public string Code { get; set; } 19 | public string Name { get; set; } 20 | public string Description { get; set; } 21 | public Status Status { get; set; } 22 | public IsDeleted IsDeleted { get; set; } 23 | public string CreatedOn { get; set; } 24 | public Guid CreatedByUserGuid { get; set; } 25 | public string CreatedByUserName { get; set; } 26 | public string ModifiedOn { get; set; } 27 | public Guid? ModifiedByUserGuid { get; set; } 28 | public string ModifiedByUserName { get; set; } 29 | /// 30 | /// 是否是超级管理员(超级管理员拥有系统的所有权限) 31 | /// 32 | public bool IsSuperAdministrator { get; set; } 33 | /// 34 | /// 是否是系统内置角色(系统内置角色不允许删除,修改操作) 35 | /// 36 | public bool IsBuiltin { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncUser/SaveUserRolesViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using System; 9 | using System.Collections.Generic; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncUser 12 | { 13 | /// 14 | /// 用户获得的角色实体对象 15 | /// 16 | public class SaveUserRolesViewModel 17 | { 18 | /// 19 | /// 用户GUID 20 | /// 21 | public Guid UserGuid { get; set; } 22 | /// 23 | /// 已获得的角色代码集合 24 | /// 25 | public List AssignedRoles { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncUser/UserCreateViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Entities; 9 | using System; 10 | using static DncZeus.Api.Entities.Enums.CommonEnum; 11 | 12 | namespace DncZeus.Api.ViewModels.Rbac.DncUser 13 | { 14 | /// 15 | /// 16 | /// 17 | public class UserCreateViewModel 18 | { 19 | /// 20 | /// 21 | /// 22 | public string LoginName { get; set; } 23 | /// 24 | /// 25 | /// 26 | public string DisplayName { get; set; } 27 | /// 28 | /// 29 | /// 30 | public string Password { get; set; } 31 | /// 32 | /// 33 | /// 34 | public string Avatar { get; set; } 35 | /// 36 | /// 37 | /// 38 | public UserType UserType { get; set; } 39 | /// 40 | /// 41 | /// 42 | public IsLocked IsLocked { get; set; } 43 | /// 44 | /// 45 | /// 46 | public UserStatus Status { get; set; } 47 | /// 48 | /// 49 | /// 50 | public IsDeleted IsDeleted { get; set; } 51 | /// 52 | /// 用户描述信息 53 | /// 54 | public string Description { get; set; } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncUser/UserEditViewModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * 版权所有,请勿删除 6 | ******************************************/ 7 | 8 | using DncZeus.Api.Entities; 9 | using System; 10 | using static DncZeus.Api.Entities.Enums.CommonEnum; 11 | 12 | namespace DncZeus.Api.ViewModels.Rbac.DncUser 13 | { 14 | /// 15 | /// 16 | /// 17 | public class UserEditViewModel 18 | { 19 | /// 20 | /// 21 | /// 22 | public Guid Guid { get; set; } 23 | /// 24 | /// 25 | /// 26 | public string LoginName { get; set; } 27 | /// 28 | /// 29 | /// 30 | public string DisplayName { get; set; } 31 | /// 32 | /// 33 | /// 34 | public string Password { get; set; } 35 | /// 36 | /// 37 | /// 38 | public string Avatar { get; set; } 39 | /// 40 | /// 41 | /// 42 | public UserType UserType { get; set; } 43 | /// 44 | /// 45 | /// 46 | public IsLocked IsLocked { get; set; } 47 | /// 48 | /// 49 | /// 50 | public UserStatus Status { get; set; } 51 | /// 52 | /// 53 | /// 54 | public IsDeleted IsDeleted { get; set; } 55 | /// 56 | /// 用户描述信息 57 | /// 58 | public string Description { get; set; } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /DncZeus.Api/ViewModels/Rbac/DncUser/UserJsonModel.cs: -------------------------------------------------------------------------------- 1 | /****************************************** 2 | * AUTHOR: Rector 3 | * CREATEDON: 2018-09-26 4 | * OFFICIAL_SITE: 码友网(https://codedefault.com)--专注.NET/.NET Core 5 | * DESCRIPTION: 用户信息实体类 6 | ******************************************/ 7 | using DncZeus.Api.Entities; 8 | using System; 9 | using static DncZeus.Api.Entities.Enums.CommonEnum; 10 | 11 | namespace DncZeus.Api.ViewModels.Rbac.DncUser 12 | { 13 | /// 14 | /// 15 | /// 16 | public class UserJsonModel 17 | { 18 | /// 19 | /// 20 | /// 21 | public Guid Guid { get; set; } 22 | /// 23 | /// 24 | /// 25 | public string LoginName { get; set; } 26 | /// 27 | /// 28 | /// 29 | public string DisplayName { get; set; } 30 | /// 31 | /// 32 | /// 33 | public string Password { get; set; } 34 | /// 35 | /// 36 | /// 37 | public string Avatar { get; set; } 38 | /// 39 | /// 40 | /// 41 | public UserType UserType { get; set; } 42 | /// 43 | /// 44 | /// 45 | public IsLocked IsLocked { get; set; } 46 | /// 47 | /// 48 | /// 49 | public UserStatus Status { get; set; } 50 | /// 51 | /// 52 | /// 53 | public IsDeleted IsDeleted { get; set; } 54 | /// 55 | /// 56 | /// 57 | public string CreatedOn { get; set; } 58 | /// 59 | /// 60 | /// 61 | public Guid CreatedByUserGuid { get; set; } 62 | /// 63 | /// 64 | /// 65 | public string CreatedByUserName { get; set; } 66 | /// 67 | /// 68 | /// 69 | public string ModifiedOn { get; set; } 70 | /// 71 | /// 72 | /// 73 | public Guid? ModifiedByUserGuid { get; set; } 74 | /// 75 | /// 76 | /// 77 | public string ModifiedByUserName { get; set; } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /DncZeus.Api/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DncZeus.Api/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AppSettings": { 3 | "Secret": "0123456789ABCDEF", 4 | "IsTrialVersion": false 5 | }, 6 | "ConnectionStrings": { 7 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=DncZeus;Trusted_Connection=True;MultipleActiveResultSets=true", 8 | "MySQLConnection": "Server=localhost;Database=dnczeus;Uid=root;Pwd=123456;", 9 | "PGSQLConnection": "Server=192.168.3.24;Database=dnczeus;Uid=postgres;Pwd=postgres;" 10 | 11 | }, 12 | "Logging": { 13 | "IncludeScopes": false, 14 | "LogLevel": { 15 | "Default": "Warning" 16 | } 17 | }, 18 | "Tokens": { 19 | "Key": "0123456789ABCDEF", 20 | "Issuer": "https://codedefault.com" 21 | }, 22 | "AllowedHosts": "*", 23 | "AllowedOrigins": "http://localhost:9000", 24 | "DataProvider": "MYSQL" 25 | } -------------------------------------------------------------------------------- /DncZeus.Api/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 欢迎使用DncZeus 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /DncZeus.App/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@vue/app" 4 | ], 5 | "plugins": [ 6 | "@babel/plugin-syntax-dynamic-import" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /DncZeus.App/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /DncZeus.App/.eslintignore: -------------------------------------------------------------------------------- 1 | routers.js 2 | * 3 | -------------------------------------------------------------------------------- /DncZeus.App/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | 'extends': [ 4 | 'plugin:vue/essential', 5 | '@vue/standard' 6 | ], 7 | rules: { 8 | // allow async-await 9 | 'generator-star-spacing': 'off', 10 | // allow debugger during development 11 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'vue/no-parsing-error': [2, { 'x-invalid-end-tag': false }], 13 | 'no-undef': 'off' 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DncZeus.App/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | /tests/e2e/videos/ 6 | /tests/e2e/screenshots/ 7 | 8 | # local env files 9 | .env.local 10 | .env.*.local 11 | 12 | # Log files 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | 17 | # Editor directories and files 18 | .idea 19 | .vscode 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw* 25 | 26 | build/env.js 27 | -------------------------------------------------------------------------------- /DncZeus.App/.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /DncZeus.App/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: stable 3 | script: npm run lint 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /DncZeus.App/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 iView 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 | -------------------------------------------------------------------------------- /DncZeus.App/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "pluginsFile": "tests/e2e/plugins/index.js" 3 | } 4 | -------------------------------------------------------------------------------- /DncZeus.App/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DncZeus", 3 | "version": "2.0.0", 4 | "author": "Rector", 5 | "private": false, 6 | "scripts": { 7 | "dev": "vue-cli-service serve --open", 8 | "build": "vue-cli-service build", 9 | "lint": "vue-cli-service lint", 10 | "test:unit": "vue-cli-service test:unit", 11 | "test:e2e": "vue-cli-service test:e2e" 12 | }, 13 | "dependencies": { 14 | "axios": "^0.21.1", 15 | "clipboard": "^2.0.0", 16 | "codemirror": "^5.38.0", 17 | "countup": "^1.8.2", 18 | "cropperjs": "^1.2.2", 19 | "dayjs": "^1.7.7", 20 | "echarts": "^4.0.4", 21 | "html2canvas": "^1.0.0-alpha.12", 22 | "iview": "^3.4.1", 23 | "iview-area": "^1.5.17", 24 | "js-cookie": "^2.2.0", 25 | "simplemde": "^1.11.2", 26 | "sortablejs": "^1.7.0", 27 | "tree-table-vue": "^1.1.0", 28 | "vue": "^2.5.10", 29 | "vue-i18n": "^7.8.0", 30 | "vue-router": "^3.0.1", 31 | "vuedraggable": "^2.16.0", 32 | "vuex": "^3.0.1", 33 | "wangeditor": "^3.1.1", 34 | "xlsx": "^0.17.0" 35 | }, 36 | "devDependencies": { 37 | "@babel/plugin-syntax-dynamic-import": "^7.0.0-rc.1", 38 | "@vue/cli-plugin-babel": "^3.0.1", 39 | "@vue/cli-plugin-eslint": "^3.0.1", 40 | "@vue/cli-plugin-unit-mocha": "^3.0.1", 41 | "@vue/cli-service": "^3.0.1", 42 | "@vue/eslint-config-standard": "^3.0.0-beta.10", 43 | "@vue/test-utils": "^1.0.0-beta.10", 44 | "chai": "^4.1.2", 45 | "eslint-plugin-cypress": "^2.0.1", 46 | "less": "^2.7.3", 47 | "less-loader": "^4.0.5", 48 | "lint-staged": "^6.0.0", 49 | "mockjs": "^1.0.1-beta3", 50 | "vue-template-compiler": "^2.5.13" 51 | }, 52 | "browserslist": [ 53 | "> 1%", 54 | "last 2 versions", 55 | "not ie <= 8" 56 | ], 57 | "gitHooks": { 58 | "pre-commit": "lint-staged" 59 | }, 60 | "lint-staged": { 61 | "*.js": [ 62 | "vue-cli-service lint", 63 | "git add" 64 | ], 65 | "*.vue": [ 66 | "vue-cli-service lint", 67 | "git add" 68 | ] 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /DncZeus.App/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/public/favicon.ico -------------------------------------------------------------------------------- /DncZeus.App/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | We're sorry but iview-admin doesn't work properly without JavaScript 15 | enabled. Please enable it to continue. 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DncZeus.App/src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | 28 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/data.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getTableData = () => { 4 | return axios.request({ 5 | url: 'get_table_data', 6 | method: 'get' 7 | }) 8 | } 9 | 10 | export const getDragList = () => { 11 | return axios.request({ 12 | url: 'get_drag_list', 13 | method: 'get' 14 | }) 15 | } 16 | 17 | export const errorReq = () => { 18 | return axios.request({ 19 | url: 'error_url', 20 | method: 'post' 21 | }) 22 | } 23 | 24 | export const saveErrorLogger = info => { 25 | return axios.request({ 26 | url: 'save_error_logger', 27 | hideError: true, 28 | data: info, 29 | method: 'post' 30 | }) 31 | } 32 | 33 | export const uploadImg = formData => { 34 | return axios.request({ 35 | url: 'image/upload', 36 | data: formData 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/rbac/icon.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getIconList = (data) => { 4 | return axios.request({ 5 | url: 'rbac/icon/list', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | // create icon 12 | export const createIcon = (data) => { 13 | return axios.request({ 14 | url: 'rbac/icon/create', 15 | method: 'post', 16 | data 17 | }) 18 | } 19 | 20 | //load icon 21 | export const loadIcon = (data) => { 22 | return axios.request({ 23 | url: 'rbac/icon/edit/' + data.id, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // edit icon 29 | export const editIcon = (data) => { 30 | return axios.request({ 31 | url: 'rbac/icon/edit', 32 | method: 'post', 33 | data 34 | }) 35 | } 36 | 37 | // delete icon 38 | export const deleteIcon = (ids) => { 39 | return axios.request({ 40 | url: 'rbac/icon/delete/' + ids, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // batch command 46 | export const batchCommand = (data) => { 47 | return axios.request({ 48 | url: 'rbac/icon/batch', 49 | method: 'get', 50 | params: data 51 | }) 52 | } 53 | 54 | 55 | // batch import 56 | export const batchImportIcon = (data) => { 57 | return axios.request({ 58 | url: 'rbac/icon/import', 59 | method: 'post', 60 | data 61 | }) 62 | } 63 | 64 | 65 | // loadIconDataSource 66 | 67 | // find icon data source by keyword 68 | export const findIconDataSourceByKeyword = (data) => { 69 | return axios.request({ 70 | url: 'rbac/icon/find_list_by_kw/' + data.keyword, 71 | method: 'get' 72 | }) 73 | } 74 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/rbac/menu.js: -------------------------------------------------------------------------------- 1 | import axios from "@/libs/api.request"; 2 | 3 | export const getMenuList = data => { 4 | return axios.request({ 5 | url: "rbac/menu/list", 6 | method: "post", 7 | data 8 | }); 9 | }; 10 | 11 | // create menu 12 | export const createMenu = data => { 13 | return axios.request({ 14 | url: "rbac/menu/create", 15 | method: "post", 16 | data 17 | }); 18 | }; 19 | 20 | //load menu 21 | export const loadMenu = data => { 22 | return axios.request({ 23 | url: "rbac/menu/edit/" + data.guid, 24 | method: "get" 25 | }); 26 | }; 27 | 28 | // edit menu 29 | export const editMenu = data => { 30 | return axios.request({ 31 | url: "rbac/menu/edit", 32 | method: "post", 33 | data 34 | }); 35 | }; 36 | 37 | // delete menu 38 | export const deleteMenu = ids => { 39 | return axios.request({ 40 | url: "rbac/menu/delete/" + ids, 41 | method: "get" 42 | }); 43 | }; 44 | 45 | // batch command 46 | export const batchCommand = data => { 47 | return axios.request({ 48 | url: "rbac/menu/batch", 49 | method: "get", 50 | params: data 51 | }); 52 | }; 53 | 54 | //load menu truee 55 | export const loadMenuTree = (guid) => { 56 | let url = "rbac/menu/tree"; 57 | if (guid != null) { 58 | url += "/" + guid; 59 | } 60 | return axios.request({ 61 | url: url, 62 | method: "get" 63 | }); 64 | }; 65 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/rbac/permission.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getPermissionList = (data) => { 4 | return axios.request({ 5 | url: 'rbac/permission/list', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | // create 12 | export const createPermission = (data) => { 13 | return axios.request({ 14 | url: 'rbac/permission/create', 15 | method: 'post', 16 | data 17 | }) 18 | } 19 | 20 | //edit 21 | export const loadPermission = (data) => { 22 | return axios.request({ 23 | url: 'rbac/permission/edit/' + data.code, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // edit submit 29 | export const editPermission = (data) => { 30 | return axios.request({ 31 | url: 'rbac/permission/edit', 32 | method: 'post', 33 | data 34 | }) 35 | } 36 | 37 | // delete 38 | export const deletePermission = (ids) => { 39 | return axios.request({ 40 | url: 'rbac/permission/delete/' + ids, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // batch command 46 | export const batchCommand = (data) => { 47 | return axios.request({ 48 | url: 'rbac/permission/batch', 49 | method: 'get', 50 | params: data 51 | }) 52 | } 53 | 54 | 55 | //load role-permission tree 56 | export const loadPermissionTree = (role_code) => { 57 | return axios.request({ 58 | url: 'rbac/permission/permission_tree/' + role_code, 59 | method: 'get' 60 | }) 61 | } 62 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/rbac/role.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getRoleList = (data) => { 4 | return axios.request({ 5 | url: 'rbac/role/list', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | // createRole 12 | export const createRole = (data) => { 13 | return axios.request({ 14 | url: 'rbac/role/create', 15 | method: 'post', 16 | data 17 | }) 18 | } 19 | 20 | //loadRole 21 | export const loadRole = (data) => { 22 | return axios.request({ 23 | url: 'rbac/role/edit/' + data.code, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // editRole 29 | export const editRole = (data) => { 30 | return axios.request({ 31 | url: 'rbac/role/edit', 32 | method: 'post', 33 | data 34 | }) 35 | } 36 | 37 | // delete role 38 | export const deleteRole = (ids) => { 39 | return axios.request({ 40 | url: 'rbac/role/delete/' + ids, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // batch command 46 | export const batchCommand = (data) => { 47 | return axios.request({ 48 | url: 'rbac/role/batch', 49 | method: 'get', 50 | params: data 51 | }) 52 | } 53 | 54 | //load role list by user guid 55 | export const loadRoleListByUserGuid = (user_guid) => { 56 | return axios.request({ 57 | url: 'rbac/role/find_list_by_user_guid/' + user_guid, 58 | method: 'get' 59 | }) 60 | } 61 | 62 | //load role simple list 63 | export const loadSimpleList = () => { 64 | return axios.request({ 65 | url: 'rbac/role/find_simple_list', 66 | method: 'get' 67 | }) 68 | } 69 | 70 | //assign permissions for role 71 | export const assignPermission = (data) => { 72 | return axios.request({ 73 | url: 'rbac/role/assign_permission', 74 | method: 'post', 75 | data 76 | }) 77 | } 78 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/rbac/user.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getUserList = (data) => { 4 | return axios.request({ 5 | url: 'rbac/user/list', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | // createUser 12 | export const createUser = (data) => { 13 | return axios.request({ 14 | url: 'rbac/user/create', 15 | method: 'post', 16 | data 17 | }) 18 | } 19 | 20 | //loadUser 21 | export const loadUser = (data) => { 22 | return axios.request({ 23 | url: 'rbac/user/edit/' + data.guid, 24 | method: 'get' 25 | }) 26 | } 27 | 28 | // editUser 29 | export const editUser = (data) => { 30 | return axios.request({ 31 | url: 'rbac/user/edit', 32 | method: 'post', 33 | data 34 | }) 35 | } 36 | 37 | // delete user 38 | export const deleteUser = (ids) => { 39 | return axios.request({ 40 | url: 'rbac/user/delete/' + ids, 41 | method: 'get' 42 | }) 43 | } 44 | 45 | // batch command 46 | export const batchCommand = (data) => { 47 | return axios.request({ 48 | url: 'rbac/user/batch', 49 | method: 'get', 50 | params: data 51 | }) 52 | } 53 | 54 | // save user roles 55 | export const saveUserRoles = (data) => { 56 | return axios.request({ 57 | url: 'rbac/user/save_roles', 58 | method: 'post', 59 | data 60 | }) 61 | } 62 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/routers.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getRouterReq = (access) => { 4 | return axios.request({ 5 | url: 'get_router', 6 | params: { 7 | access 8 | }, 9 | method: 'get' 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /DncZeus.App/src/api/user.js: -------------------------------------------------------------------------------- 1 | import _axios from 'axios' 2 | import config from '@/config' 3 | import axios from '@/libs/api.request' 4 | 5 | const authUrl = process.env.NODE_ENV === 'development' ? config.authUrl.dev : config.authUrl.pro 6 | 7 | export const login = ({ 8 | userName, 9 | password 10 | }) => { 11 | return _axios.get(authUrl + '?username=' + userName + '&password=' + password) 12 | } 13 | 14 | export const getUserInfo = (token) => { 15 | return axios.request({ 16 | url: 'account/profile', 17 | method: 'get', 18 | //是否在请求资源中添加资源的前缀 19 | withPrefix: false, //设置为true或者不设置此属性,将默认添加配置文件config.baseUrl.defaultPrefix的前缀,如果设置下面这个属性[prefix],默认配置文件中的默认前缀将不生效 20 | //请求资源的前缀重写 21 | prefix:"api/v1/" //设此属性权重最高,将覆盖配置文件[baseUrl.defaultPrefix]中的前缀,withPrefix对此属性不起作用(也就是说只要设置了此属性,都将在请求中添加设置的前缀) 22 | }) 23 | } 24 | 25 | export const logout = (token) => { 26 | return new Promise((resolve, reject) => { 27 | resolve() 28 | }) 29 | } 30 | 31 | export const getUnreadCount = () => { 32 | return axios.request({ 33 | url: 'message/count', 34 | hideError: false, 35 | method: 'get' 36 | }) 37 | } 38 | 39 | export const getMessage = () => { 40 | return axios.request({ 41 | url: 'message/init', 42 | method: 'get' 43 | }) 44 | } 45 | 46 | export const getContentByMsgId = msg_id => { 47 | return axios.request({ 48 | url: 'message/content/' + msg_id, 49 | method: 'get' 50 | }) 51 | } 52 | 53 | export const hasRead = msg_id => { 54 | return axios.request({ 55 | url: 'message/has_read/' + msg_id, 56 | method: 'get', 57 | }) 58 | } 59 | 60 | export const removeReaded = msg_id => { 61 | return axios.request({ 62 | url: 'message/remove_readed/' + msg_id, 63 | method: 'get' 64 | }) 65 | } 66 | 67 | export const restoreTrash = msg_id => { 68 | return axios.request({ 69 | url: 'message/restore/' + msg_id, 70 | method: 'get' 71 | }) 72 | } 73 | -------------------------------------------------------------------------------- /DncZeus.App/src/assets/icons/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/icons/iconfont.eot -------------------------------------------------------------------------------- /DncZeus.App/src/assets/icons/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/icons/iconfont.ttf -------------------------------------------------------------------------------- /DncZeus.App/src/assets/icons/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/icons/iconfont.woff -------------------------------------------------------------------------------- /DncZeus.App/src/assets/images/login-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/images/login-bg.jpg -------------------------------------------------------------------------------- /DncZeus.App/src/assets/images/logo-min.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/images/logo-min.jpg -------------------------------------------------------------------------------- /DncZeus.App/src/assets/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/images/logo.jpg -------------------------------------------------------------------------------- /DncZeus.App/src/assets/images/qq-group1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/images/qq-group1.jpg -------------------------------------------------------------------------------- /DncZeus.App/src/assets/images/talkingdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/DncZeus.App/src/assets/images/talkingdata.png -------------------------------------------------------------------------------- /DncZeus.App/src/components/charts/bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 59 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/charts/index.js: -------------------------------------------------------------------------------- 1 | import ChartPie from './pie.vue' 2 | import ChartBar from './bar.vue' 3 | export { ChartPie, ChartBar } 4 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/charts/pie.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 71 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/common-icon/common-icon.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 48 | 49 | 52 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/common-icon/index.js: -------------------------------------------------------------------------------- 1 | import CommonIcon from './common-icon.vue' 2 | export default CommonIcon 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/common/common.less: -------------------------------------------------------------------------------- 1 | .no-select{ 2 | -webkit-touch-callout: none; 3 | -webkit-user-select: none; 4 | -khtml-user-select: none; 5 | -moz-user-select: none; 6 | -ms-user-select: none; 7 | user-select: none; 8 | } 9 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/common/util.js: -------------------------------------------------------------------------------- 1 | export const showTitle = (item, vm) => { 2 | return vm.$config.useI18n ? vm.$t(item.name) : ((item.meta && item.meta.title) || item.name) 3 | } 4 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/count-to/index.js: -------------------------------------------------------------------------------- 1 | import countTo from './count-to.vue' 2 | export default countTo 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/count-to/index.less: -------------------------------------------------------------------------------- 1 | @prefix: ~"count-to"; 2 | 3 | .@{prefix}-wrapper{ 4 | .content-outer{ 5 | display: inline-block; 6 | .@{prefix}-unit-text{ 7 | font-style: normal; 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/cropper/index.js: -------------------------------------------------------------------------------- 1 | import Cropper from './index.vue' 2 | export default Cropper 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/cropper/index.less: -------------------------------------------------------------------------------- 1 | .bg{ 2 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC") 3 | } 4 | .cropper-wrapper{ 5 | width: 600px; 6 | height: 340px; 7 | .img-box{ 8 | height: 340px; 9 | width: 430px; 10 | border: 1px solid #ebebeb; 11 | display: inline-block; 12 | .bg; 13 | img{ 14 | max-width: 100%; 15 | display: block; 16 | } 17 | } 18 | .right-con{ 19 | display: inline-block; 20 | width: 170px; 21 | vertical-align: top; 22 | box-sizing: border-box; 23 | padding: 0 10px; 24 | .preview-box{ 25 | height: 150px !important; 26 | width: 100% !important; 27 | overflow: hidden; 28 | border: 1px solid #ebebeb; 29 | .bg; 30 | } 31 | .button-box{ 32 | padding: 10px 0 0; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/drag-list/index.js: -------------------------------------------------------------------------------- 1 | import DragList from './drag-list.vue' 2 | export default DragList 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/editor/editor.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 70 | 71 | 76 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/editor/index.js: -------------------------------------------------------------------------------- 1 | import Editor from './editor.vue' 2 | export default Editor 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/icons/icons.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 32 | 33 | 36 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/icons/index.js: -------------------------------------------------------------------------------- 1 | import Icons from './icons.vue' 2 | export default Icons 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/info-card/index.js: -------------------------------------------------------------------------------- 1 | import InforCard from './infor-card.vue' 2 | export default InforCard 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/info-card/infor-card.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 55 | 56 | 95 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/login-form/index.js: -------------------------------------------------------------------------------- 1 | import LoginForm from './login-form.vue' 2 | export default LoginForm 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/a-back-top/index.js: -------------------------------------------------------------------------------- 1 | import ABackTop from './index.vue' 2 | export default ABackTop 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/a-back-top/index.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 91 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/error-store/error-store.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 38 | 39 | 50 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/error-store/index.js: -------------------------------------------------------------------------------- 1 | import ErrorStore from './error-store.vue' 2 | export default ErrorStore 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/fullscreen/index.js: -------------------------------------------------------------------------------- 1 | import Fullscreen from './fullscreen.vue' 2 | export default Fullscreen 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.less: -------------------------------------------------------------------------------- 1 | .custom-bread-crumb{ 2 | display: inline-block; 3 | vertical-align: top; 4 | } 5 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ showTitle(item) }} 7 | 8 | 9 | 10 | 11 | 47 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/custom-bread-crumb/index.js: -------------------------------------------------------------------------------- 1 | import customBreadCrumb from './custom-bread-crumb.vue' 2 | export default customBreadCrumb 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/header-bar.less: -------------------------------------------------------------------------------- 1 | .header-bar{ 2 | width: 100%; 3 | height: 100%; 4 | position: relative; 5 | .custom-content-con{ 6 | float: right; 7 | height: auto; 8 | padding-right: 20px; 9 | line-height: 64px; 10 | & > *{ 11 | float: right; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/header-bar.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 35 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/index.js: -------------------------------------------------------------------------------- 1 | import HeaderBar from './header-bar' 2 | export default HeaderBar 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/sider-trigger/index.js: -------------------------------------------------------------------------------- 1 | import siderTrigger from './sider-trigger.vue' 2 | export default siderTrigger 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/sider-trigger/sider-trigger.less: -------------------------------------------------------------------------------- 1 | .trans{ 2 | transition: transform .2s ease; 3 | } 4 | @size: 40px; 5 | .sider-trigger-a{ 6 | padding: 6px; 7 | width: @size; 8 | height: @size; 9 | display: inline-block; 10 | text-align: center; 11 | color: #5c6b77; 12 | margin-top: 12px; 13 | i{ 14 | .trans; 15 | vertical-align: top; 16 | } 17 | &.collapsed i{ 18 | transform: rotateZ(90deg); 19 | .trans; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/header-bar/sider-trigger/sider-trigger.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 32 | 35 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/language/index.js: -------------------------------------------------------------------------------- 1 | import Language from './language.vue' 2 | export default Language 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/language/language.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | {{ value }} 10 | 11 | 12 | 13 | 14 | 15 | 52 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/collapsed-menu.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ showTitle(parentItem) }} 4 | 5 | 6 | 7 | {{ showTitle(child) }} 8 | 9 | 10 | 11 | 12 | 52 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/index.js: -------------------------------------------------------------------------------- 1 | import SideMenu from './side-menu.vue' 2 | export default SideMenu 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/item-mixin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | parentItem: { 4 | type: Object, 5 | default: () => {} 6 | }, 7 | theme: String, 8 | iconSize: Number 9 | }, 10 | computed: { 11 | parentName () { 12 | return this.parentItem.name 13 | }, 14 | children () { 15 | return this.parentItem.children 16 | }, 17 | textColor () { 18 | return this.theme === 'dark' ? '#fff' : '#495060' 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/mixin.js: -------------------------------------------------------------------------------- 1 | import CommonIcon from '_c/common-icon' 2 | import { showTitle } from '@/libs/util' 3 | export default { 4 | components: { 5 | CommonIcon 6 | }, 7 | methods: { 8 | showTitle (item) { 9 | return showTitle(item, this) 10 | }, 11 | showChildren (item) { 12 | return item.children && (item.children.length > 1 || (item.meta && item.meta.showAlways)) 13 | }, 14 | getNameOrHref (item, children0) { 15 | return item.href ? `isTurnByHref_${item.href}` : (children0 ? item.children[0].name : item.name) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/side-menu-item.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ showTitle(parentItem) }} 6 | 7 | 8 | 9 | 10 | {{ showTitle(item.children[0]) }} 11 | 12 | 13 | 14 | {{ showTitle(item) }} 15 | 16 | 17 | 18 | 19 | 27 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/side-menu/side-menu.less: -------------------------------------------------------------------------------- 1 | .side-menu-wrapper{ 2 | user-select: none; 3 | .menu-collapsed{ 4 | padding-top: 10px; 5 | 6 | .ivu-dropdown{ 7 | width: 100%; 8 | .ivu-dropdown-rel a{ 9 | width: 100%; 10 | } 11 | } 12 | .ivu-tooltip{ 13 | width: 100%; 14 | .ivu-tooltip-rel{ 15 | width: 100%; 16 | } 17 | .ivu-tooltip-popper .ivu-tooltip-content{ 18 | .ivu-tooltip-arrow{ 19 | border-right-color: #fff; 20 | } 21 | .ivu-tooltip-inner{ 22 | background: #fff; 23 | color: #495060; 24 | } 25 | } 26 | } 27 | 28 | 29 | } 30 | a.drop-menu-a{ 31 | display: inline-block; 32 | padding: 6px 15px; 33 | width: 100%; 34 | text-align: center; 35 | color: #495060; 36 | } 37 | } 38 | .menu-title{ 39 | padding-left: 6px; 40 | } 41 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/tags-nav/index.js: -------------------------------------------------------------------------------- 1 | import TagsNav from './tags-nav.vue' 2 | export default TagsNav 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/tags-nav/tags-nav.less: -------------------------------------------------------------------------------- 1 | .no-select{ 2 | -webkit-touch-callout: none; 3 | -webkit-user-select: none; 4 | -khtml-user-select: none; 5 | -moz-user-select: none; 6 | -ms-user-select: none; 7 | user-select: none; 8 | } 9 | .size{ 10 | width: 100%; 11 | height: 100%; 12 | } 13 | .tags-nav{ 14 | position: relative; 15 | border-top: 1px solid #F0F0F0; 16 | border-bottom: 1px solid #F0F0F0; 17 | .no-select; 18 | .size; 19 | .close-con{ 20 | position: absolute; 21 | right: 0; 22 | top: 0; 23 | height: 100%; 24 | width: 32px; 25 | background: #fff; 26 | text-align: center; 27 | z-index: 10; 28 | } 29 | .btn-con{ 30 | position: absolute; 31 | top: 0px; 32 | height: 100%; 33 | background: #fff; 34 | padding-top: 3px; 35 | z-index: 10; 36 | button{ 37 | padding: 6px 4px; 38 | line-height: 14px; 39 | text-align: center; 40 | } 41 | &.left-btn{ 42 | left: 0px; 43 | } 44 | &.right-btn{ 45 | right: 32px; 46 | border-right: 1px solid #F0F0F0; 47 | } 48 | } 49 | .scroll-outer{ 50 | position: absolute; 51 | left: 28px; 52 | right: 61px; 53 | top: 0; 54 | bottom: 0; 55 | box-shadow: 0px 0 3px 2px rgba(100,100,100,.1) inset; 56 | .scroll-body{ 57 | height: ~"calc(100% - 1px)"; 58 | display: inline-block; 59 | padding: 1px 4px 0; 60 | position: absolute; 61 | overflow: visible; 62 | white-space: nowrap; 63 | transition: left .3s ease; 64 | .ivu-tag-dot-inner{ 65 | transition: background .2s ease; 66 | } 67 | } 68 | } 69 | .contextmenu { 70 | position: absolute; 71 | margin: 0; 72 | padding: 5px 0; 73 | background: #fff; 74 | z-index: 100; 75 | list-style-type: none; 76 | border-radius: 4px; 77 | box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); 78 | li { 79 | margin: 0; 80 | padding: 5px 15px; 81 | cursor: pointer; 82 | &:hover { 83 | background: #eee; 84 | } 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/user/index.js: -------------------------------------------------------------------------------- 1 | import User from './user.vue' 2 | export default User 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/user/user.less: -------------------------------------------------------------------------------- 1 | .user{ 2 | &-avator-dropdown{ 3 | cursor: pointer; 4 | display: inline-block; 5 | // height: 64px; 6 | vertical-align: middle; 7 | // line-height: 64px; 8 | .ivu-badge-dot{ 9 | top: 16px; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/components/user/user.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ this.$store.state.user.userName}} 7 | 8 | 9 | 10 | 11 | 消息中心 12 | 13 | 退出登录 14 | 15 | 16 | 17 | 18 | 19 | 75 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/index.js: -------------------------------------------------------------------------------- 1 | import Main from './main.vue' 2 | export default Main 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/main/main.less: -------------------------------------------------------------------------------- 1 | .main{ 2 | .logo-con{ 3 | height: 64px; 4 | padding: 10px; 5 | img{ 6 | height: 44px; 7 | width: auto; 8 | display: block; 9 | margin: 0 auto; 10 | } 11 | } 12 | .header-con{ 13 | background: #fff; 14 | padding: 0 20px; 15 | width: 100%; 16 | } 17 | .main-layout-con{ 18 | height: 100%; 19 | overflow: hidden; 20 | } 21 | .main-content-con{ 22 | height: ~"calc(100% - 60px)"; 23 | overflow: hidden; 24 | } 25 | .tag-nav-wrapper { 26 | padding: 0; 27 | height: 40px; 28 | background: #f0f0f0; 29 | } 30 | .content-wrapper { 31 | padding: 8px; 32 | height: ~"calc(100% - 80px)"; 33 | overflow: auto; 34 | } 35 | .left-sider{ 36 | .ivu-layout-sider-children{ 37 | overflow-y: scroll; 38 | margin-right: -18px; 39 | } 40 | } 41 | .ivu-layout-sider-collapsed{ 42 | .ivu-layout-sider-children{ 43 | margin-right: 0; 44 | } 45 | } 46 | } 47 | .ivu-menu-item > i{ 48 | margin-right: 12px !important; 49 | } 50 | .ivu-menu-submenu > .ivu-menu > .ivu-menu-item > i { 51 | margin-right: 8px !important; 52 | } 53 | .collased-menu-dropdown{ 54 | width: 100%; 55 | margin: 0; 56 | line-height: normal; 57 | padding: 7px 0 6px 16px; 58 | clear: both; 59 | font-size: 12px !important; 60 | white-space: nowrap; 61 | list-style: none; 62 | cursor: pointer; 63 | transition: background 0.2s ease-in-out; 64 | &:hover{ 65 | background: rgba(100, 100, 100, 0.1); 66 | } 67 | & * { 68 | color: #515a6e; 69 | } 70 | .ivu-menu-item > i{ 71 | margin-right: 12px !important; 72 | } 73 | .ivu-menu-submenu > .ivu-menu > .ivu-menu-item > i { 74 | margin-right: 8px !important; 75 | } 76 | } 77 | 78 | .ivu-select-dropdown.ivu-dropdown-transfer { 79 | max-height: 400px; 80 | } 81 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/markdown/index.js: -------------------------------------------------------------------------------- 1 | import MarkdownEditor from './markdown.vue' 2 | export default MarkdownEditor 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/markdown/markdown.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 63 | 64 | 77 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/parent-view/index.js: -------------------------------------------------------------------------------- 1 | import ParentView from './parent-view.vue' 2 | export default ParentView 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/parent-view/parent-view.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 21 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/paste-editor/index.js: -------------------------------------------------------------------------------- 1 | import PasteEditor from './paste-editor.vue' 2 | export default PasteEditor 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/paste-editor/paste-editor.less: -------------------------------------------------------------------------------- 1 | .paste-editor-wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | border: 1px dashed gainsboro; 5 | textarea.textarea-el{ 6 | width: 100%; 7 | height: 100%; 8 | } 9 | .CodeMirror{ 10 | height: 100%; 11 | padding: 0; 12 | .CodeMirror-code div .CodeMirror-line > span > span.cm-tab{ 13 | &::after{ 14 | content: '→'; 15 | color: #BFBFBF; 16 | } 17 | } 18 | } 19 | .first-row{ 20 | font-weight: 700; 21 | font-size: 14px; 22 | } 23 | .incorrect-row{ 24 | background: #F5CBD1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/paste-editor/plugins/placeholder.js: -------------------------------------------------------------------------------- 1 | export default (codemirror) => { 2 | (function (mod) { 3 | mod(codemirror) 4 | })(function (CodeMirror) { 5 | CodeMirror.defineOption('placeholder', '', function (cm, val, old) { 6 | var prev = old && old !== CodeMirror.Init 7 | if (val && !prev) { 8 | cm.on('blur', onBlur) 9 | cm.on('change', onChange) 10 | cm.on('swapDoc', onChange) 11 | onChange(cm) 12 | } else if (!val && prev) { 13 | cm.off('blur', onBlur) 14 | cm.off('change', onChange) 15 | cm.off('swapDoc', onChange) 16 | clearPlaceholder(cm) 17 | var wrapper = cm.getWrapperElement() 18 | wrapper.className = wrapper.className.replace(' CodeMirror-empty', '') 19 | } 20 | 21 | if (val && !cm.hasFocus()) onBlur(cm) 22 | }) 23 | 24 | function clearPlaceholder (cm) { 25 | if (cm.state.placeholder) { 26 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder) 27 | cm.state.placeholder = null 28 | } 29 | } 30 | function setPlaceholder (cm) { 31 | clearPlaceholder(cm) 32 | var elt = cm.state.placeholder = document.createElement('pre') 33 | elt.style.cssText = 'height: 0; overflow: visible; color: #80848f;' 34 | elt.style.direction = cm.getOption('direction') 35 | elt.className = 'CodeMirror-placeholder' 36 | var placeHolder = cm.getOption('placeholder') 37 | if (typeof placeHolder === 'string') placeHolder = document.createTextNode(placeHolder) 38 | elt.appendChild(placeHolder) 39 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild) 40 | } 41 | 42 | function onBlur (cm) { 43 | if (isEmpty(cm)) setPlaceholder(cm) 44 | } 45 | function onChange (cm) { 46 | let wrapper = cm.getWrapperElement() 47 | let empty = isEmpty(cm) 48 | wrapper.className = wrapper.className.replace(' CodeMirror-empty', '') + (empty ? ' CodeMirror-empty' : '') 49 | 50 | if (empty) setPlaceholder(cm) 51 | else clearPlaceholder(cm) 52 | } 53 | 54 | function isEmpty (cm) { 55 | return (cm.lineCount() === 1) && (cm.getLine(0) === '') 56 | } 57 | }) 58 | } 59 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/split-pane/index.js: -------------------------------------------------------------------------------- 1 | import Split from './split.vue' 2 | export default Split 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/split-pane/trigger.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 40 | 41 | 44 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/tables/dz-table.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 搜索 14 | 15 | 16 | 17 | 暂无数据 18 | 19 | 20 | 31 | 32 | 33 | 34 | 35 | 91 | 94 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/tables/edit.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ value }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 45 | 46 | 74 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/tables/handle-btns.js: -------------------------------------------------------------------------------- 1 | const btns = { 2 | delete: (h, params, vm) => { 3 | return h('Poptip', { 4 | props: { 5 | confirm: true, 6 | title: '你确定要删除吗?' 7 | }, 8 | on: { 9 | 'on-ok': () => { 10 | vm.$emit('on-delete', params) 11 | vm.$emit('input', params.tableData.filter((item, index) => index !== params.row.initRowIndex)) 12 | } 13 | } 14 | }, [ 15 | h('Button', { 16 | props: { 17 | type: 'text', 18 | ghost: true 19 | } 20 | }, [ 21 | h('Icon', { 22 | props: { 23 | type: 'md-trash', 24 | size: 18, 25 | color: '#000000' 26 | } 27 | }) 28 | ]) 29 | ]) 30 | } 31 | } 32 | 33 | export default btns 34 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/tables/index.js: -------------------------------------------------------------------------------- 1 | import Tables from './tables.vue' 2 | export default Tables 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/components/tables/index.less: -------------------------------------------------------------------------------- 1 | .search-con{ 2 | padding: 10px 0; 3 | .search{ 4 | &-col{ 5 | display: inline-block; 6 | width: 200px; 7 | } 8 | &-input{ 9 | display: inline-block; 10 | width: 200px; 11 | margin-left: 2px; 12 | } 13 | &-btn{ 14 | margin-left: 2px; 15 | } 16 | } 17 | } 18 | .dnc-table-wrap { 19 | position: relative; 20 | .ivu-page { 21 | margin-top: 15px; 22 | } 23 | .dnc-table-refresh-btn { 24 | position: absolute; 25 | right: 0; 26 | bottom: 0; 27 | } 28 | th.ivu-table-column-center .ivu-poptip-body, 29 | td.ivu-table-column-center .ivu-poptip-body { 30 | text-align: left; 31 | } 32 | .dnc-toolbar-wrap { 33 | margin-bottom: 15px; 34 | } 35 | .table-command-column button { 36 | margin-right: 1px; 37 | margin-left: 1px; 38 | } 39 | .dnc-toolbar-wrap { 40 | .ivu-form-item { 41 | margin-bottom: 0; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DncZeus.App/src/config/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | /** 3 | * @description 配置显示在浏览器标签的title 4 | */ 5 | title: 'DncZeus通用后台权限管理框架', 6 | /** 7 | * @description token在Cookie中存储的天数,默认1天 8 | */ 9 | cookieExpires: 7, 10 | /** 11 | * @description 是否使用国际化,默认为false 12 | * 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'} 13 | * 用来在菜单中显示文字 14 | */ 15 | useI18n: false, 16 | /** 17 | * @description api请求基础路径 18 | */ 19 | baseUrl: { 20 | dev: 'http://localhost:5432/', 21 | pro: 'https://api.dnczeus.codedefault.com/', 22 | defaultPrefix: "api/v1/" 23 | }, 24 | authUrl: { 25 | dev: 'http://localhost:5432/api/oauth/auth', 26 | pro: 'https://api.dnczeus.codedefault.com/api/oauth/auth' 27 | }, 28 | /** 29 | * @description 默认打开的首页的路由name值,默认为home 30 | */ 31 | homeName: 'home', 32 | /** 33 | * @description 需要加载的插件 34 | */ 35 | plugin: { 36 | 'error-store': { 37 | showInHeader: true, // 设为false后不会在顶部显示错误日志徽标 38 | developmentOff: true // 设为true后在开发环境不会收集错误信息,方便开发中排查错误 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DncZeus.App/src/directive/directives.js: -------------------------------------------------------------------------------- 1 | import draggable from './module/draggable' 2 | import clipboard from './module/clipboard' 3 | 4 | const directives = { 5 | draggable, 6 | clipboard 7 | } 8 | 9 | export default directives 10 | -------------------------------------------------------------------------------- /DncZeus.App/src/directive/hasPermission.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Create comment node 3 | * 4 | * @private 5 | * @author https://stackoverflow.com/questions/43003976/a-custom-directive-similar-to-v-if-in-vuejs#43543814 6 | */ 7 | function commentNode(el, vnode) { 8 | const comment = document.createComment(' ') 9 | 10 | Object.defineProperty(comment, 'setAttribute', { 11 | value: () => undefined 12 | }) 13 | 14 | vnode.text = ' ' 15 | vnode.elm = comment 16 | vnode.isComment = true 17 | vnode.context = undefined 18 | vnode.tag = undefined 19 | vnode.data.directives = undefined 20 | 21 | if (vnode.componentInstance) { 22 | vnode.componentInstance.$el = comment 23 | } 24 | 25 | if (el.parentNode) { 26 | el.parentNode.replaceChild(comment, el) 27 | } 28 | } 29 | 30 | const hasPermission = { 31 | install(Vue, options) { 32 | Vue.directive('can', { 33 | bind(el, binding, vnode) { 34 | let checkPermission = vnode.context.$route.meta.checkPermission; 35 | if (!checkPermission) { 36 | return; 37 | } 38 | let permissionList = vnode.context.$route.meta.permissions; 39 | if (permissionList === undefined) { 40 | el.disabled = true; 41 | commentNode(el, vnode) 42 | } 43 | if (permissionList && permissionList.length && !permissionList.includes(binding.value)) { 44 | el.disabled = true; 45 | commentNode(el, vnode) 46 | } 47 | } 48 | }); 49 | } 50 | }; 51 | 52 | export default hasPermission; 53 | -------------------------------------------------------------------------------- /DncZeus.App/src/directive/index.js: -------------------------------------------------------------------------------- 1 | import directive from './directives' 2 | 3 | const importDirective = Vue => { 4 | /** 5 | * 拖拽指令 v-draggable="options" 6 | * options = { 7 | * trigger: /这里传入作为拖拽触发器的CSS选择器/, 8 | * body: /这里传入需要移动容器的CSS选择器/, 9 | * recover: /拖动结束之后是否恢复到原来的位置/ 10 | * } 11 | */ 12 | Vue.directive('draggable', directive.draggable) 13 | /** 14 | * clipboard指令 v-draggable="options" 15 | * options = { 16 | * value: /在输入框中使用v-model绑定的值/, 17 | * success: /复制成功后的回调/, 18 | * error: /复制失败后的回调/ 19 | * } 20 | */ 21 | Vue.directive('clipboard', directive.clipboard) 22 | } 23 | 24 | export default importDirective 25 | -------------------------------------------------------------------------------- /DncZeus.App/src/directive/module/clipboard.js: -------------------------------------------------------------------------------- 1 | import Clipboard from 'clipboard' 2 | export default { 3 | bind: (el, binding) => { 4 | const clipboard = new Clipboard(el, { 5 | text: () => binding.value.value 6 | }) 7 | el.__success_callback__ = binding.value.success 8 | el.__error_callback__ = binding.value.error 9 | clipboard.on('success', e => { 10 | const callback = el.__success_callback__ 11 | callback && callback(e) 12 | }) 13 | clipboard.on('error', e => { 14 | const callback = el.__error_callback__ 15 | callback && callback(e) 16 | }) 17 | el.__clipboard__ = clipboard 18 | }, 19 | update: (el, binding) => { 20 | el.__clipboard__.text = () => binding.value.value 21 | el.__success_callback__ = binding.value.success 22 | el.__error_callback__ = binding.value.error 23 | }, 24 | unbind: (el, binding) => { 25 | delete el.__success_callback__ 26 | delete el.__error_callback__ 27 | el.__clipboard__.destroy() 28 | delete el.__clipboard__ 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /DncZeus.App/src/directive/module/draggable.js: -------------------------------------------------------------------------------- 1 | import { on } from '@/libs/tools' 2 | export default { 3 | inserted: (el, binding, vnode) => { 4 | let triggerDom = document.querySelector(binding.value.trigger) 5 | triggerDom.style.cursor = 'move' 6 | let bodyDom = document.querySelector(binding.value.body) 7 | let pageX = 0 8 | let pageY = 0 9 | let transformX = 0 10 | let transformY = 0 11 | let canMove = false 12 | const handleMousedown = e => { 13 | let transform = /\(.*\)/.exec(bodyDom.style.transform) 14 | if (transform) { 15 | transform = transform[0].slice(1, transform[0].length - 1) 16 | let splitxy = transform.split('px, ') 17 | transformX = parseFloat(splitxy[0]) 18 | transformY = parseFloat(splitxy[1].split('px')[0]) 19 | } 20 | pageX = e.pageX 21 | pageY = e.pageY 22 | canMove = true 23 | } 24 | const handleMousemove = e => { 25 | let xOffset = e.pageX - pageX + transformX 26 | let yOffset = e.pageY - pageY + transformY 27 | if (canMove) bodyDom.style.transform = `translate(${xOffset}px, ${yOffset}px)` 28 | } 29 | const handleMouseup = e => { 30 | canMove = false 31 | } 32 | on(triggerDom, 'mousedown', handleMousedown) 33 | on(document, 'mousemove', handleMousemove) 34 | on(document, 'mouseup', handleMouseup) 35 | }, 36 | update: (el, binding, vnode) => { 37 | if (!binding.value.recover) return 38 | let bodyDom = document.querySelector(binding.value.body) 39 | bodyDom.style.transform = '' 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /DncZeus.App/src/index.less: -------------------------------------------------------------------------------- 1 | @import '~iview/src/styles/index.less'; 2 | 3 | @menu-dark-title: #001529; 4 | @menu-dark-active-bg: #000c17; 5 | @layout-sider-background: #001529; 6 | .ivu-table td { 7 | height: auto; 8 | padding-top: 5px; 9 | padding-bottom: 5px; 10 | line-height: 16px; 11 | } 12 | .ivu-table-cell { 13 | padding-left: 8px; 14 | padding-right: 8px; 15 | } 16 | .dnc-toolbar-btns { 17 | text-align: right; 18 | } 19 | .mr3 { 20 | margin-right: 3px; 21 | } 22 | .ml3 { 23 | margin-left: 3px; 24 | } 25 | .pad10 { 26 | padding: 10px; 27 | } 28 | .txt-primary { 29 | color: #2d8cf0; 30 | } 31 | .txt-primary-light { 32 | color: #5cadff; 33 | } 34 | .txt-primary-dark { 35 | color: #2b85e4; 36 | } 37 | .txt-success { 38 | color: #19be6b; 39 | } 40 | .txt-info { 41 | color: #2db7f5; 42 | } 43 | .txt-warning { 44 | color: #ff9900; 45 | } 46 | .txt-error { 47 | color: #ed4014; 48 | } 49 | .txt-danger { 50 | color: #df3308; 51 | } 52 | .txt-success { 53 | color: #19be6b; 54 | } 55 | .txt-success { 56 | color: #19be6b; 57 | } 58 | .txt-success { 59 | color: #19be6b; 60 | } 61 | .table-row-disabled { 62 | background-color: #f7f7f7; 63 | color: #ccc; 64 | } 65 | .ivu-input-group-prepend, 66 | .ivu-input-group-append { 67 | text-align: auto !important; 68 | } 69 | .text-left { 70 | text-align: left !important; 71 | } 72 | .dropdown-tree { 73 | line-height: 20px; 74 | } 75 | -------------------------------------------------------------------------------- /DncZeus.App/src/libs/api.request.js: -------------------------------------------------------------------------------- 1 | import HttpRequest from '@/libs/axios' 2 | import config from '@/config' 3 | const baseUrl = process.env.NODE_ENV === 'development' ? config.baseUrl.dev : config.baseUrl.pro 4 | const defaultPrefix = config.baseUrl.defaultPrefix; 5 | const axios = new HttpRequest(baseUrl,defaultPrefix) 6 | export default axios 7 | -------------------------------------------------------------------------------- /DncZeus.App/src/libs/router-util.js: -------------------------------------------------------------------------------- 1 | import { getToken, hasChild, localSave, localRead } from '@/libs/util' 2 | import Main from '@/components/main' 3 | import parentView from '@/components/parent-view' 4 | // import axios from 'axios' 5 | import axios from '@/libs/api.request' 6 | import config from '@/config' 7 | import { forEach } from '@/libs/tools' 8 | const baseUrl = process.env.NODE_ENV === 'development' ? config.baseUrl.dev : config.baseUrl.pro 9 | 10 | // 初始化路由 11 | export const initRouter = (vm) => { 12 | // if (!getToken()) { 13 | // return 14 | // } 15 | let list = [] 16 | // 模拟异步请求,改为您实际的后端请求路径 17 | // axios.get(baseUrl + 'system/permission/userMenuList', { 18 | // headers: { 'Authorization': 'Bearer ' + getToken() } 19 | // }) 20 | 21 | axios.request({ 22 | url: 'account/menu', 23 | method: 'get' 24 | }).then(res => { 25 | var menuData = res.data 26 | // 格式化菜单 27 | list = formatMenu(menuData) 28 | // 刷新界面菜单 29 | //vm.$store.commit('setMenuList', list) 30 | vm.$store.commit('refreshMenuList', list) 31 | }); 32 | 33 | return list 34 | } 35 | 36 | // 加载菜单,在创建路由时使用 37 | export const loadMenu = () => { 38 | let list = [] 39 | axios.request({ 40 | url: 'account/menu', 41 | method: 'get' 42 | }).then(res => { 43 | var menuData = res.data 44 | // 这是后端回传给前端的数据,如上面所说的 45 | // 格式化菜单 46 | list = formatMenu(menuData) 47 | }); 48 | 49 | return list 50 | } 51 | 52 | // 格式化菜单 53 | export const formatMenu = (list) => { 54 | let res = [] 55 | forEach(list, item => { 56 | let obj = { 57 | path: item.path, 58 | name: item.name, 59 | icon: (item.meta && item.meta.icon) || '' 60 | } 61 | obj.meta = item.meta 62 | //obj.meta.showAlways = true; 63 | // 惰性递归 **** 64 | if (item.parentId === "0") { 65 | obj.component = Main 66 | } else { 67 | // 惰性递归 **** 68 | let data = item.component 69 | if(item.children.length>0){ 70 | obj.component = parentView 71 | }else{ 72 | // 这里需要改成自己定义的 .vue 路径 73 | obj.component = () => import('@/view' + data) 74 | } 75 | } 76 | if (hasChild(item)) { 77 | obj.children = formatMenu(item.children) 78 | } 79 | res.push(obj) 80 | }) 81 | return res 82 | } 83 | -------------------------------------------------------------------------------- /DncZeus.App/src/locale/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import { 4 | localRead 5 | } from '@/libs/util' 6 | import customZhCn from './lang/zh-CN' 7 | import customZhTw from './lang/zh-TW' 8 | import customEnUs from './lang/en-US' 9 | import zhCnLocale from 'iview/src/locale/lang/zh-CN' 10 | import enUsLocale from 'iview/src/locale/lang/en-US' 11 | import zhTwLocale from 'iview/src/locale/lang/zh-TW' 12 | 13 | Vue.use(VueI18n) 14 | 15 | // 自动根据浏览器系统语言设置语言 16 | const navLang = navigator.language 17 | const localLang = (navLang === 'zh-CN' || navLang === 'en-US') ? navLang : false 18 | let lang = "zh-CN" // localLang || localRead('local') || 'zh-CN' 19 | 20 | Vue.config.lang = lang 21 | 22 | // vue-i18n 6.x+写法 23 | Vue.locale = () => {} 24 | const messages = { 25 | 'zh-CN': Object.assign(zhCnLocale, customZhCn), 26 | 'zh-TW': Object.assign(zhTwLocale, customZhTw), 27 | 'en-US': Object.assign(enUsLocale, customEnUs) 28 | } 29 | const i18n = new VueI18n({ 30 | locale: lang, 31 | messages 32 | }) 33 | 34 | export default i18n 35 | 36 | // vue-i18n 5.x写法 37 | // Vue.locale('zh-CN', Object.assign(zhCnLocale, customZhCn)) 38 | // Vue.locale('en-US', Object.assign(zhTwLocale, customZhTw)) 39 | // Vue.locale('zh-TW', Object.assign(enUsLocale, customEnUs)) 40 | -------------------------------------------------------------------------------- /DncZeus.App/src/locale/lang/en-US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: 'Home', 3 | components: 'Components', 4 | count_to_page: 'Count-to', 5 | tables_page: 'Table', 6 | split_pane_page: 'Split-pane', 7 | markdown_page: 'Markdown-editor', 8 | editor_page: 'Rich-Text-Editor', 9 | icons_page: 'Custom-icon', 10 | img_cropper_page: 'Image-editor', 11 | update: 'Update', 12 | doc: 'Document', 13 | join_page: 'QQ Group', 14 | update_table_page: 'Update .CSV', 15 | update_paste_page: 'Paste Table Data', 16 | multilevel: 'multilevel', 17 | directive_page: 'Directive', 18 | level_1: 'Level-1', 19 | level_2: 'Level-2', 20 | level_2_1: 'Level-2-1', 21 | level_2_3: 'Level-2-3', 22 | level_2_2: 'Level-2-2', 23 | level_2_2_1: 'Level-2-2-1', 24 | level_2_2_2: 'Level-2-2-2', 25 | excel: 'Excel', 26 | 'upload-excel': 'Upload Excel', 27 | 'export-excel': 'Export Excel', 28 | tools_methods_page: 'Tools Methods', 29 | drag_list_page: 'Drag-list', 30 | i18n_page: 'Internationalization', 31 | modalTitle: 'Modal Title', 32 | content: 'This is the modal box content.', 33 | buttonText: 'Show Modal', 34 | 'i18n-tip': 'Note: Only this page is multi-language, other pages do not add language content to the multi-language package.', 35 | error_store_page: 'Error Collection', 36 | error_logger_page: 'Error Logger', 37 | query: 'Query', 38 | params: 'Params', 39 | cropper_page: 'Cropper', 40 | message_page: 'Message Center', 41 | tree_table_page: 'Tree Table', 42 | rbac: "User & Role", 43 | rbac_user_page: "User Management", 44 | rbac_role_page: "Role Management", 45 | rbac_permission_page: "Permission Management", 46 | rbac_menu_page: "Menu Management", 47 | rbac_icon_page: "Icon Management", 48 | rbac_role_permission_page: "Role & Permission", 49 | login: "Login" 50 | } 51 | -------------------------------------------------------------------------------- /DncZeus.App/src/locale/lang/zh-CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: '首页', 3 | components: '组件', 4 | count_to_page: '数字渐变', 5 | tables_page: '多功能表格', 6 | split_pane_page: '分割窗口', 7 | markdown_page: 'Markdown编辑器', 8 | editor_page: '富文本编辑器', 9 | icons_page: '自定义图标', 10 | img_cropper_page: '图片编辑器', 11 | update: '上传数据', 12 | join_page: 'QQ群', 13 | doc: '文档', 14 | update_table_page: '上传CSV文件', 15 | update_paste_page: '粘贴表格数据', 16 | multilevel: '多级菜单', 17 | directive_page: '指令', 18 | level_1: 'Level-1', 19 | level_2: 'Level-2', 20 | level_2_1: 'Level-2-1', 21 | level_2_3: 'Level-2-3', 22 | level_2_2: 'Level-2-2', 23 | level_2_2_1: 'Level-2-2-1', 24 | level_2_2_2: 'Level-2-2-2', 25 | excel: 'Excel', 26 | 'upload-excel': '上传excel', 27 | 'export-excel': '导出excel', 28 | tools_methods_page: '工具函数', 29 | drag_list_page: '拖拽列表', 30 | i18n_page: '多语言', 31 | modalTitle: '模态框题目', 32 | content: '这是模态框内容', 33 | buttonText: '显示模态框', 34 | 'i18n-tip': '注:仅此页做了多语言,其他页面没有在多语言包中添加语言内容', 35 | error_store_page: '错误收集', 36 | error_logger_page: '错误日志', 37 | query: '带参路由', 38 | params: '动态路由', 39 | cropper_page: '图片裁剪', 40 | message_page: '消息中心', 41 | tree_table_page: '树状表格', 42 | rbac: "用户及授权", 43 | rbac_user_page: "用户管理", 44 | rbac_role_page: "角色管理", 45 | rbac_permission_page: "权限管理", 46 | rbac_menu_page: "菜单管理", 47 | rbac_icon_page: "图标管理", 48 | rbac_role_permission_page: "角色权限分配", 49 | login: "登录" 50 | } 51 | -------------------------------------------------------------------------------- /DncZeus.App/src/locale/lang/zh-TW.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: '首頁', 3 | components: '组件', 4 | count_to_page: '数字渐变', 5 | tables_page: '多功能表格', 6 | split_pane_page: '分割窗口', 7 | markdown_page: 'Markdown編輯器', 8 | editor_page: '富文本編輯器', 9 | icons_page: '自定義圖標', 10 | img_cropper_page: '圖片編輯器', 11 | update: '上傳數據', 12 | join_page: 'QQ群', 13 | doc: '文檔', 14 | update_table_page: '上傳CSV文件', 15 | update_paste_page: '粘貼表格數據', 16 | multilevel: '多级菜单', 17 | directive_page: '指令', 18 | level_1: 'Level-1', 19 | level_2: 'Level-2', 20 | level_2_1: 'Level-2-1', 21 | level_2_3: 'Level-2-3', 22 | level_2_2: 'Level-2-2', 23 | level_2_2_1: 'Level-2-2-1', 24 | level_2_2_2: 'Level-2-2-2', 25 | excel: 'Excel', 26 | 'upload-excel': '上傳excel', 27 | 'export-excel': '導出excel', 28 | tools_methods_page: '工具函數', 29 | drag_list_page: '拖拽列表', 30 | i18n_page: '多語言', 31 | modalTitle: '模態框題目', 32 | content: '這是模態框內容', 33 | buttonText: '顯示模態框', 34 | 'i18n-tip': '注:僅此頁做了多語言,其他頁面沒有在多語言包中添加語言內容', 35 | error_store_page: '錯誤收集', 36 | error_logger_page: '錯誤日誌', 37 | query: '帶參路由', 38 | params: '動態路由', 39 | cropper_page: '圖片裁剪', 40 | message_page: '消息中心', 41 | tree_table_page: '樹狀表格' 42 | } 43 | -------------------------------------------------------------------------------- /DncZeus.App/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import store from './store' 7 | import iView from 'iview' 8 | import i18n from '@/locale' 9 | import config from '@/config' 10 | import importDirective from '@/directive' 11 | import installPlugin from '@/plugin' 12 | import 'iview/dist/styles/iview.css' 13 | 14 | import './index.less' 15 | import '@/assets/icons/iconfont.css' 16 | import TreeTable from 'tree-table-vue' 17 | 18 | import { initRouter } from '@/libs/router-util' 19 | 20 | 21 | // 实际打包时应该不引入mock 22 | /* eslint-disable */ 23 | // if (process.env.NODE_ENV !== 'production') require('@/mock') 24 | 25 | import hasPermission from '@/directive/hasPermission.js'; 26 | Vue.use(hasPermission); 27 | 28 | Vue.use(iView, { 29 | i18n: (key, value) => i18n.t(key, value) 30 | }) 31 | Vue.use(TreeTable) 32 | /** 33 | * @description 注册admin内置插件 34 | */ 35 | installPlugin(Vue) 36 | /** 37 | * @description 生产环境关掉提示 38 | */ 39 | Vue.config.productionTip = false 40 | /** 41 | * @description 全局注册应用配置 42 | */ 43 | Vue.prototype.$config = config 44 | /** 45 | * 注册指令 46 | */ 47 | importDirective(Vue) 48 | 49 | /* eslint-disable no-new */ 50 | new Vue({ 51 | el: '#app', 52 | router, 53 | i18n, 54 | store, 55 | created(){ 56 | 57 | }, 58 | mounted() { 59 | var target = this; 60 | //initRouter(target); 61 | // 调用方法,动态生成路由 62 | setTimeout(function(){ 63 | //initRouter(target); 64 | },1500); 65 | }, 66 | render: h => h(App) 67 | }) 68 | -------------------------------------------------------------------------------- /DncZeus.App/src/mock/data.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { doCustomTimes } from '@/libs/util' 3 | const Random = Mock.Random 4 | 5 | export const getTableData = req => { 6 | let tableData = [] 7 | doCustomTimes(5, () => { 8 | tableData.push(Mock.mock({ 9 | name: '@name', 10 | email: '@email', 11 | createTime: '@date' 12 | })) 13 | }) 14 | return tableData 15 | } 16 | 17 | export const getDragList = req => { 18 | let dragList = [] 19 | doCustomTimes(5, () => { 20 | dragList.push(Mock.mock({ 21 | name: Random.csentence(10, 13), 22 | id: Random.increment(10) 23 | })) 24 | }) 25 | return dragList 26 | } 27 | 28 | export const uploadImage = req => { 29 | return Promise.resolve() 30 | } 31 | -------------------------------------------------------------------------------- /DncZeus.App/src/mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { login, logout, getUserInfo } from './login' 3 | import { getTableData, getDragList, uploadImage } from './data' 4 | import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount } from './user' 5 | 6 | // 配置Ajax请求延时,可用来测试网络延迟大时项目中一些效果 7 | Mock.setup({ 8 | timeout: 1000 9 | }) 10 | 11 | // 登录相关和获取用户信息 12 | Mock.mock(/\/login/, login) 13 | Mock.mock(/\/get_info/, getUserInfo) 14 | Mock.mock(/\/logout/, logout) 15 | Mock.mock(/\/get_table_data/, getTableData) 16 | Mock.mock(/\/get_drag_list/, getDragList) 17 | Mock.mock(/\/save_error_logger/, 'success') 18 | Mock.mock(/\/image\/upload/, uploadImage) 19 | Mock.mock(/\/message\/init/, getMessageInit) 20 | Mock.mock(/\/message\/content/, getContentByMsgId) 21 | Mock.mock(/\/message\/has_read/, hasRead) 22 | Mock.mock(/\/message\/remove_readed/, removeReaded) 23 | Mock.mock(/\/message\/restore/, restoreTrash) 24 | Mock.mock(/\/message\/count/, messageCount) 25 | 26 | export default Mock 27 | -------------------------------------------------------------------------------- /DncZeus.App/src/mock/login.js: -------------------------------------------------------------------------------- 1 | import { getParams } from '@/libs/util' 2 | const USER_MAP = { 3 | super_admin: { 4 | name: 'super_admin', 5 | user_id: '1', 6 | access: ['super_admin', 'admin'], 7 | token: 'super_admin', 8 | avator: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png' 9 | }, 10 | admin: { 11 | name: 'admin', 12 | user_id: '2', 13 | access: ['admin'], 14 | token: 'admin', 15 | avator: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4' 16 | } 17 | } 18 | 19 | export const login = req => { 20 | req = JSON.parse(req.body) 21 | return {token: USER_MAP[req.userName].token} 22 | } 23 | 24 | export const getUserInfo = req => { 25 | const params = getParams(req.url) 26 | return USER_MAP[params.token] 27 | } 28 | 29 | export const logout = req => { 30 | return null 31 | } 32 | -------------------------------------------------------------------------------- /DncZeus.App/src/mock/user.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { doCustomTimes } from '@/libs/util' 3 | const Random = Mock.Random 4 | 5 | export const getMessageInit = () => { 6 | let unreadList = [] 7 | doCustomTimes(3, () => { 8 | unreadList.push(Mock.mock({ 9 | title: Random.cword(10, 15), 10 | create_time: '@date', 11 | msg_id: Random.increment(100) 12 | })) 13 | }) 14 | let readedList = [] 15 | doCustomTimes(4, () => { 16 | readedList.push(Mock.mock({ 17 | title: Random.cword(10, 15), 18 | create_time: '@date', 19 | msg_id: Random.increment(100) 20 | })) 21 | }) 22 | let trashList = [] 23 | doCustomTimes(2, () => { 24 | trashList.push(Mock.mock({ 25 | title: Random.cword(10, 15), 26 | create_time: '@date', 27 | msg_id: Random.increment(100) 28 | })) 29 | }) 30 | return { 31 | unread: unreadList, 32 | readed: readedList, 33 | trash: trashList 34 | } 35 | } 36 | 37 | export const getContentByMsgId = () => { 38 | return ` 这是消息内容,这个内容是使用富文本编辑器编辑的,所以你可以看到一些格式你可以查看Mock返回的数据格式,和api请求的接口,来确定你的后端接口的开发使用你的真实接口后,前端页面基本不需要修改即可满足基本需求快来试试吧${Random.csentence(100, 200)}` 39 | } 40 | 41 | export const hasRead = () => { 42 | return true 43 | } 44 | 45 | export const removeReaded = () => { 46 | return true 47 | } 48 | 49 | export const restoreTrash = () => { 50 | return true 51 | } 52 | 53 | export const messageCount = () => { 54 | return 3 55 | } 56 | -------------------------------------------------------------------------------- /DncZeus.App/src/plugin/error-store/index.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | export default { 3 | install (Vue, options) { 4 | if (options.developmentOff && process.env.NODE_ENV === 'development') return 5 | Vue.config.errorHandler = (error, vm, mes) => { 6 | let info = { 7 | type: 'script', 8 | code: 0, 9 | mes: error.message, 10 | url: window.location.href 11 | } 12 | Vue.nextTick(() => { 13 | store.dispatch('addErrorLog', info) 14 | }) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DncZeus.App/src/plugin/index.js: -------------------------------------------------------------------------------- 1 | import config from '@/config' 2 | const { plugin } = config 3 | 4 | export default (Vue) => { 5 | for (let name in plugin) { 6 | const value = plugin[name] 7 | Vue.use(require(`./${name}`).default, typeof value === 'object' ? value : undefined) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /DncZeus.App/src/router/before-close.js: -------------------------------------------------------------------------------- 1 | import { Modal } from 'iview' 2 | 3 | const beforeClose = { 4 | before_close_normal: (resolve) => { 5 | Modal.confirm({ 6 | title: '确定要关闭这一页吗', 7 | onOk: () => { 8 | console.log('close tab...') 9 | resolve(true) 10 | console.log('tab closed.') 11 | }, 12 | onCancel: () => { 13 | resolve(false) 14 | } 15 | }) 16 | } 17 | } 18 | 19 | export default beforeClose 20 | -------------------------------------------------------------------------------- /DncZeus.App/src/router/static-routers.js: -------------------------------------------------------------------------------- 1 | // 不需要授权的路由名称 2 | let staticRouters = ["home", "message_page", "error_store_page", "error_logger_page", "argu", "params", "query", "error_401", "error_500", "error_404","join","join_page"] 3 | export default staticRouters; 4 | -------------------------------------------------------------------------------- /DncZeus.App/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import user from './module/user' 5 | import app from './module/app' 6 | 7 | Vue.use(Vuex) 8 | 9 | export default new Vuex.Store({ 10 | state: { 11 | // 12 | }, 13 | mutations: { 14 | // 15 | }, 16 | actions: { 17 | // 18 | }, 19 | modules: { 20 | user, 21 | app 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/argu-page/params.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ID: {{ $route.params.id }} 5 | 调用closeTag方法关闭本页 6 | 7 | 8 | 9 | 10 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/argu-page/query.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ID: {{ $route.query.id }} 5 | 调用closeTag方法关闭本页 6 | 7 | 8 | 9 | 10 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/demo/demo-page.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 这是一个用于演示的页面 4 | 新增(有权限才显示) 5 | 6 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/401.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/404.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/500.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/back-btn-group.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 返回首页 4 | 返回上一页({{ second }}s) 5 | 6 | 7 | 8 | 39 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/error-content.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{ code }} 7 | {{ desc }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 29 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-page/error.less: -------------------------------------------------------------------------------- 1 | .error-page{ 2 | width: 100%; 3 | height: 100%; 4 | position: relative; 5 | background: #f8f8f9; 6 | .content-con{ 7 | width: 700px; 8 | height: 600px; 9 | position: absolute; 10 | left: 50%; 11 | top: 50%; 12 | transform: translate(-50%, -60%); 13 | img{ 14 | display: block; 15 | width: 100%; 16 | height: 100%; 17 | } 18 | .text-con{ 19 | position: absolute; 20 | left: 0px; 21 | top: 0px; 22 | h4{ 23 | position: absolute; 24 | left: 0px; 25 | top: 0px; 26 | font-size: 80px; 27 | font-weight: 700; 28 | color: #348EED; 29 | } 30 | h5{ 31 | position: absolute; 32 | width: 700px; 33 | left: 0px; 34 | top: 100px; 35 | font-size: 20px; 36 | font-weight: 700; 37 | color: #67647D; 38 | } 39 | } 40 | .back-btn-group{ 41 | position: absolute; 42 | right: 0px; 43 | bottom: 20px; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/error-store/error-store.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | iview-admin会自动将你程序中的错误收集起来,你可以将错误日志发给后端保存起来。如果你不需要这个功能,将'./src/config/index.js'里的plugin的'error-store'属性删掉即可。 5 | 另外在开发环境下,你程序中的错误都会被收集起来,这样可能不利于你排查错误,你可以将'./src/config/index.js'的'error-store'的'developmentOff'设为true。 6 | 如果你只是想收集错误日志,不希望登录用户看到错误日志,你可以不提供查看日志的入口,只需将'./src/config/index.js'的'error-store'的'showInHeader'设为false。 7 | 8 | 9 | 10 | 11 | 点击测试触发程序错误 12 | 点击测试触发ajax接口请求错误 13 | 14 | 15 | ajax接口请求是请求easy-mock的一个不存在接口,所以服务端会报404错误,错误收集机制会收集这个错误,测试的时候有一定网络延迟,所以点击按钮之后稍等一会才会收集到错误。 16 | 17 | 18 | 19 | 20 | 21 | 22 | 36 | 37 | 40 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/join-page.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | QQ扫一扫二维码加群 8 | 本群为使用DncZeus/.NET Core或者对DncZeus/.NET Core感兴趣的开发者提供交流平台。在这里,解决你开发中的疑惑,共同进步。 9 | 10 | 本框架 [DncZeus] 由 码友网 创建者Rector主导开发和维护。 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 29 | 30 | 43 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/login/login.less: -------------------------------------------------------------------------------- 1 | .login{ 2 | width: 100%; 3 | height: 100%; 4 | /*background-image: url('../../assets/images/login-bg.jpg'); 5 | background-size: cover; 6 | background-position: center;*/ 7 | position: relative; 8 | &-con{ 9 | position: absolute; 10 | right: 160px; 11 | top: 50%; 12 | transform: translateY(-60%); 13 | width: 380px; 14 | &-header{ 15 | font-size: 16px; 16 | font-weight: 300; 17 | text-align: center; 18 | padding: 30px 0; 19 | } 20 | .form-con{ 21 | padding: 20px 0 0; 22 | } 23 | .login-tip{ 24 | font-size: 10px; 25 | text-align: center; 26 | color: #c3c3c3; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/multimenu/level-2-1.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 二级菜单01 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/multimenu/level-2-2-1.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 三级菜单01 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/multimenu/level-2-2-2.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 三级菜单02 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/multimenu/level-2-2.vue: -------------------------------------------------------------------------------- 1 | - 2 | 3 | 二级菜单02 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/single-page/error-logger.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 导出日志记录 4 | 注:这里只会显示成功保存到服务端的错误日志,而且页面错误日志不会在浏览器持久化存储,刷新页面即会丢失 5 | 6 | 7 | 8 | 9 | 88 | 89 | 92 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/single-page/home/home.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{ infor.title }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 78 | 79 | 84 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/single-page/home/index.js: -------------------------------------------------------------------------------- 1 | import home from './home.vue' 2 | export default home 3 | -------------------------------------------------------------------------------- /DncZeus.App/src/view/tools-methods/tools-methods.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 添加一个标签 7 | 8 | 9 | 动态路由,添加params 10 | 11 | 12 | 13 | 14 | 15 | 16 | 添加一个标签 17 | 18 | 19 | 动态路由,添加query 20 | 21 | 22 | 23 | 24 | 25 | 26 | 关闭工具方法页 27 | 28 | 29 | 手动关闭页面 30 | 31 | 32 | 33 | 34 | 35 | 36 | 76 | 77 | 79 | -------------------------------------------------------------------------------- /DncZeus.App/tests/e2e/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "cypress" 4 | ], 5 | "env": { 6 | "mocha": true, 7 | "cypress/globals": true 8 | }, 9 | "rules": { 10 | "strict": "off" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /DncZeus.App/tests/e2e/plugins/index.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/guides/guides/plugins-guide.html 2 | 3 | module.exports = (on, config) => Object.assign({}, config, { 4 | fixturesFolder: 'tests/e2e/fixtures', 5 | integrationFolder: 'tests/e2e/specs', 6 | screenshotsFolder: 'tests/e2e/screenshots', 7 | videosFolder: 'tests/e2e/videos', 8 | supportFile: 'tests/e2e/support/index.js' 9 | }) 10 | -------------------------------------------------------------------------------- /DncZeus.App/tests/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/api/introduction/api.html 2 | 3 | describe('My First Test', () => { 4 | it('Visits the app root url', () => { 5 | cy.visit('/') 6 | cy.contains('h1', 'Welcome to Your Vue.js App') 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /DncZeus.App/tests/e2e/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /DncZeus.App/tests/e2e/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /DncZeus.App/tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | mocha: true 4 | }, 5 | rules: { 6 | 'import/no-extraneous-dependencies': 'off' 7 | } 8 | } -------------------------------------------------------------------------------- /DncZeus.App/tests/unit/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai' 2 | import { shallow } from '@vue/test-utils' 3 | import HelloWorld from '@/components/HelloWorld.vue' 4 | 5 | describe('HelloWorld.vue', () => { 6 | it('renders props.msg when passed', () => { 7 | const msg = 'new message' 8 | const wrapper = shallow(HelloWorld, { 9 | propsData: { msg } 10 | }) 11 | expect(wrapper.text()).to.include(msg) 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /DncZeus.App/vue.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | const resolve = dir => { 4 | return path.join(__dirname, dir) 5 | } 6 | 7 | // 项目部署基础 8 | // 默认情况下,我们假设你的应用将被部署在域的根目录下, 9 | // 例如:https://www.my-app.com/ 10 | // 默认:'/' 11 | // 如果您的应用程序部署在子路径中,则需要在这指定子路径 12 | // 例如:https://www.foobar.com/my-app/ 13 | // 需要将它改为'/my-app/' 14 | const BASE_URL = process.env.NODE_ENV === 'production' 15 | ? '/' 16 | : '/' 17 | 18 | module.exports = { 19 | // Project deployment base 20 | // By default we assume your app will be deployed at the root of a domain, 21 | // e.g. https://www.my-app.com/ 22 | // If your app is deployed at a sub-path, you will need to specify that 23 | // sub-path here. For example, if your app is deployed at 24 | // https://www.foobar.com/my-app/ 25 | // then change this to '/my-app/' 26 | publicPath: BASE_URL, 27 | // tweak internal webpack configuration. 28 | // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md 29 | chainWebpack: config => { 30 | config.resolve.alias 31 | .set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components')) 32 | .set('_c', resolve('src/components')) 33 | .set('_conf', resolve('config')) 34 | }, 35 | // 打包时不生成.map文件 36 | productionSourceMap: false, 37 | // 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串 38 | devServer: { 39 | //proxy: 'http://localhost:9000' 40 | host: "localhost", 41 | port: 9000, 42 | //禁用host检查,不然在部分流利器中会报[WDS disconnected]的错误 43 | // 参考:https://github.com/webpack/webpack-dev-server/issues/851 44 | //disableHostCheck: true 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /DncZeus.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.168 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DncZeus.Api", "DncZeus.Api\DncZeus.Api.csproj", "{33B1926D-E1BF-4B94-BC27-4CCD24CB3642}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {33B1926D-E1BF-4B94-BC27-4CCD24CB3642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {33B1926D-E1BF-4B94-BC27-4CCD24CB3642}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {33B1926D-E1BF-4B94-BC27-4CCD24CB3642}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {33B1926D-E1BF-4B94-BC27-4CCD24CB3642}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {2D32BF04-CF2E-444D-B690-EE983D9D0BC5} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Docs/00.faq.md: -------------------------------------------------------------------------------- 1 | # DncZeus常见问题 2 | 3 | ## 如何修改前端的服务端口? 4 | 5 | 打开[/DncZeus.App/vue.config.js],前端服务端口在module.exports中配置,如下: 6 | 7 | ``` 8 | devServer: { 9 | // proxy: 'localhost:3000' 10 | port: 9000, 11 | //禁用host检查,不然在部分流利器中会报[WDS disconnected]的错误 12 | // 参考:https://github.com/webpack/webpack-dev-server/issues/851 13 | disableHostCheck: true 14 | } 15 | ``` 16 | 17 | 其中的`port`即为前端服务的端口号。 18 | 19 | ## 如何运行前端项目? 20 | 21 | 在DncZeus.App目录下打开一个命令行工具,在命令行中输入如下命令: 22 | 23 | ``` 24 | npm run dev 25 | ``` 26 | 27 | ## 如何打包前端项目? 28 | 29 | 在DncZeus.App目录下打开一个命令行工具,在命令行中输入如下命令: 30 | 31 | ``` 32 | npm run build 33 | ``` 34 | 35 | 待此命令运行完成后,将在DncZeus.App目录下生成一个名为[dist]的文件夹(如果有此文件夹,则会自动清除再生成),[dist]中所有的资源即为DncZeus前端项目的打包资源。 36 | 37 | ## 如何在前端项目中修改后端服务API接口的基地址? 38 | 39 | DncZeus在前端项目中调用的后端服务基地址为:http://localhost:54321/api/v1/。 40 | 41 | 如果需要修改,请打开[/DncZeus.App/src/config/index.js],找到`baseUrl`和`authUrl`两个属性,其中的`dev`属性为开发环境时用的API服务基地址,`pro`属性为生成环境时用的API服务基地址。 42 | 43 | 44 | ## 目前版本的DncZeus支持MySQL数据库吗? 45 | 46 | 目前版本的DncZeus还不支持MySQL数据库,但有热心的开发者已经做了MySQL的适配,请参考[https://www.cnblogs.com/swindyChen/p/10173585.html?tdsourcetag=s_pctim_aiomsg][1] 47 | 48 | [1]: https://www.cnblogs.com/swindyChen/p/10173585.html?tdsourcetag=s_pctim_aiomsg 49 | -------------------------------------------------------------------------------- /Docs/01.gett-started.md: -------------------------------------------------------------------------------- 1 | ## **关于 DncZeus** 2 | 3 | **DncZeus = Dnc + Zeus** 4 | 5 | "Dnc"--.Net Core 的缩写; 6 | 7 | "Zeus"--中文译为**宙斯**,是古希腊神话中的众神之王,奥林匹斯十二主神之首,统治宇宙万物的至高无上的主神(在古希腊神话中主神专指宙斯),人们常用“众神和人类的父亲”、“神王”来称呼他,是希腊神话诸神中最伟大的神。 8 | 9 | **DncZeus**的愿景就是做一个.NET Core 领域的简易精致的通用后台权限管理模板系统基础框架,努力向.NET Core 领域的"宙斯"看齐。 10 | 11 | ## 项目简介 12 | 13 | **DncZeus**是一个基于 ASP.NET Core 2 + Vue.js 的前后端分离的通用后台管理系统框架。后端使用.NET Core 2 + Entity Framework Core 构建,UI 则是目前流行的基于 Vue.js 的 iView。项目实现了前后端的动态权限管理和控制以及基于 JWT 的用户令牌认证机制,让前后端的交互更流畅。 14 | 15 | **DncZeus**并不是一个完整的业务系统,但她提供完成业务系统的绝大多数开发场景,让每一位.NET 开发者都能基于**DncZeus**快速开发出交互、体验以及功能具佳的.NET Core 单页应用程序(SPA)。 16 | 17 | ## 支持DncZeus(求Start :)) 18 | 19 | 如果你觉得DncZeus对你或者他人有用,请为DncZeus点个赞,求扩散,让更多人获得帮助!!! 20 | 21 | 项目开源地址:[https://github.com/lampo1024/DncZeus][1] 22 | 23 | ## 在线体验(Demo) 24 | 25 | 超级管理员:administrator 26 | 管理员:admin 27 | 28 | 密码:111111 29 | 30 | 在线体验地址(demo):[https://dnczeus.codedefault.com][2] 31 | 32 | 试试以不同用户名登录系统,可以体验不同角色的不同菜单权限。 33 | 34 | **由于是个人项目,资金有限,体验服是低配,请大家爱惜,轻戳,不胜感激!!!** 35 | 36 | ## 适合人群 37 | 38 | 由于 DncZeus 考虑到初级.NET 开发者都可以使用,所以后端项目未涉及过多架构和封装(代码逻辑一目了然),但为了你更好地熟悉和运用 DncZeus,你需要了解: 39 | 40 | - ASP.NET Core 41 | - Vue.js 42 | - iView 43 | - iview-admin 44 | 45 | ASP.NET Core 的知识能确保你可以看懂和了解后端是如何实现和工作的,而 Vue.js 框架则是前端实现的基石,当然 iView 这个基于 Vue.js 的 UI 框架也是必须要了解的,因为 DncZeus 正是基于 [iview-admin][1](iView 的一个后台管理系统示例项目)来实现的前端 UI 交互。 46 | 47 | 如果你对这两个方面的知识还不熟悉,建议你可以先学习一些理论再来运用 DncZeus 这个框架。关于 ASP.NET Core 和 Vue.js 的入门请参考: 48 | 49 | - [ASP.NET Core 官方文档][4] 50 | - [Vue.js 官方文档][5] 51 | - [iview-admin][3] 52 | 53 | ## 功能 54 | 55 | DncZeus实现了从后端的RBAC管理到前端访问路径/按钮的统一控制集成功能,主要包括: 56 | 57 | ### 后端 58 | 59 | * 用户管理 60 | * 角色管理 61 | * 菜单管理 62 | * 权限管理 63 | * 用户-角色分配 64 | * 角色-权限分配 65 | * JWT令牌认证 66 | * Swagger UI接口文档集成 67 | * AutoMapper自动实现映射 68 | * 自定义全局错误异常拦截和处理 69 | 70 | ### 前端 71 | 72 | * 基于Vue.js(iview-admin)构建 73 | * 登录和注销 74 | * 分离的路由和菜单配置 75 | * Ajax请求和响应拦截 76 | * 消息中心管理 77 | * 多国语言 78 | * 全屏 79 | * 单页应用程序(SPA) 80 | * 多标签选项卡(支持无刷新) 81 | * 多标签页关闭控制 82 | * 可收缩的左侧菜单 83 | * 全局状态管理 84 | * 日志记录和错误捕获 85 | * 按钮级别的控制指令(v-can) 86 | * 路由拦截和访问控制 87 | 88 | 89 | [1]: https://github.com/lampo1024/DncZeus 90 | [2]: https://dnczeus.codedefault.com 91 | [3]: https://github.com/iview/iview-admin 92 | [4]: https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.2 93 | [5]: https://vuejs.org/ -------------------------------------------------------------------------------- /Docs/03.download-and-restore.md: -------------------------------------------------------------------------------- 1 | # 下载项目&安装依赖 2 | 3 | ## 下载项目 4 | 5 | ### 使用Git工具下载 6 | 7 | 首先请确保你本地开发环境已安装了git管理工具,然后在需要存放本项目的目录打开git命令行工具**Git Bash Here**,在命令行中输入如下命令: 8 | 9 | ``` 10 | git clone https://github.com/lampo1024/DncZeus.git 11 | ``` 12 | 13 | 以上命令就把DncZeus的远程代码拉取到你的本地开发机上。 14 | 15 | 16 | ### 手动下载 17 | 18 | 如果你不愿意使用git管理工具下载DncZeus的远程代码,你也可以在github托管地址手动下载,打开地址[https://github.com/lampo1024/DncZeus][4],找到页面中的按钮"Clone or download",如下图示: 19 | 20 | ![手动下载DncZeus][5] 21 | 22 | 在弹出的对话框中点击按钮"Download ZIP"即可开始下载DncZeus的源代码,如下图: 23 | 24 | ![手动下载DncZeus源代码][6] 25 | 26 | ## 安装依赖 27 | 28 | ### 前端项目 29 | 30 | 在将DncZeus的源代码下载到本地之后,如果你使用的git管理工具,**可以不用**退出当前的git管理工具,输入如下命令: 31 | 32 | ``` 33 | cd DncZeus/DncZeus.App 34 | ``` 35 | 36 | 进入到DncZeus的前端项目目录[DncZeus.App](如果是手动下载的源代码,请在此目录打开命令行工具)。在命令行中输入如下命令进行前端依赖包的还原操作: 37 | 38 | ``` 39 | npm install 40 | ``` 41 | 42 | 或者 43 | 44 | ``` 45 | npm i 46 | ``` 47 | 48 | 或者你如果喜欢使用yarn,还可以使用yarn来还原: 49 | 50 | ``` 51 | yarn install 52 | ``` 53 | 54 | ### 后端项目 55 | 56 | 在Visual Studio中打开解决方案[DncZeus.sln]。首先根据自己的开发环境(SQL Server数据库类型,本示例默认是SQL Server Localdb)修改配置文件`appsettings.json`中的数据库连接字符串,示例默认连接字符串为: 57 | 58 | ``` 59 | "ConnectionStrings": { 60 | "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=DncZeus;Trusted_Connection=True;MultipleActiveResultSets=true" 61 | } 62 | ``` 63 | 64 | 再打开包管理控制台(Package Manager Console),执行如下命令生成数据库表结构: 65 | 66 | ``` 67 | Update-Database -verbose 68 | ``` 69 | 70 | 最后,打开项目根目录中的脚本文件夹[Scripts],执行脚本文件[Init_data.sql]以初始化系统数据。 71 | 72 | 恭喜你,到这里所有的准备工作就完成了。 73 | 74 | 赶紧体验DncZeus框架吧!!! 75 | 76 | 77 | ## 运行 78 | 79 | 1. 使用Visual Studio开发工具打开DncZeus根目录中的VS解决方案文件[DncZeus.sln](或者你喜欢的话,使用VS Code来进行ASP.NET Core的开发也是可以的),设置DncZeus.Api项目为默认启动项并运行此项目。 80 | 81 | > 这时在浏览器中打开地址:http://localhost:54321/swagger ,便可以查看到DncZeus已经实现的后端API接口服务了。 82 | 83 | 2. 在命令行中进入到DncZeus的前端项目目录[DncZeus.App],运行如下命令以启动前端项目服务: 84 | 85 | ``` 86 | npm run dev 87 | ``` 88 | 89 | 成功运行后会自动在浏览器中打开地址: http://localhost:9000 90 | 91 | [1]: https://github.com/iview/iview-admin 92 | [2]: https://docs.microsoft.com/en-us/aspnet/core/?view=aspnetcore-2.2 93 | [3]: https://vuejs.org/ 94 | [4]: https://github.com/lampo1024/DncZeus 95 | [5]: https://statics.codedefault.com/uploads/2018/12/1.png 96 | [6]: https://statics.codedefault.com/uploads/2018/12/2.png 97 | [7]: https://dnczeus.codedefault.com -------------------------------------------------------------------------------- /Docs/04.solution-structure-introduction.md: -------------------------------------------------------------------------------- 1 | # DncZeus项目结构解析 2 | 3 | ## 前言 4 | 5 | DncZeus是一个基于ASP.NET Core WebApi + Vue.js的前后端分离的项目框架。既然是前后端分离,那么就应该有前端项目和后端项目。本文就从前后端的项目结构上来解析DncZeus的组成: 6 | 7 | * 前端项目:[DncZeus.App] 8 | * 后端项目:[DncZeus.Api] 9 | * 数据库脚本:[Scripts] 10 | 11 | DncZeus项目文件结构如下图: 12 | 13 | ![DncZeus项目文件结构][1] 14 | 15 | ## 前端项目(DncZeus.App) 16 | 17 | 这里使用VS Code打开前端项目DncZeus.App,文件目录结构如下: 18 | 19 | ![文件目录DncZeus前端项目DncZeus.App文件目录结构][2] 20 | 21 | ### 前端项目文件夹 22 | 23 | * dist:存放打包后项目资源的文件夹,每一次运行`npm run build`命令后,都会先删除此文件夹中的所有文件,然后再将新的项目打包文件资源文件放入其中。 24 | * node_modules:前端依赖包的文件夹,项目本身不包含此文件夹(只有在使用npm或者yarn包管理工具后才会有)。 25 | * public:项目的公共资源文件夹,主要存放了前端项目首页的模板文件(index.html)以及网站图标(favicon.ico)。 26 | * src:前端项目中最重要的文件夹,所有系统源代码均存放于此文件夹中。 27 | * vue.config.js:前端项目的环境配置文件。你可以在此文件中指定项目生成的路径,以及配置本地前端服务的端口(默认前端服务端口为:9000)。 28 | 29 | ### src文件夹 30 | 31 | * api:存放所有与后端的Ajax接口方法 32 | * assets:存放前端项目[DncZeus.App]需用的静态资源文件,包括但不限于图片,图标等 33 | * components:存放前端项目[DncZeus.App]的所有通用的Vue组件 34 | * config:存放前端项目[DncZeus.App]的全局参数配置 35 | * directive:存放前端项目[DncZeus.App]的Vue指令 36 | * libs:存放前端项目[DncZeus.App]的通用方法,工具函数以及Ajax请求的拦截和封装等 37 | * locale:存放前端项目[DncZeus.App]的多国语言包 38 | * mock:存放前端项目[DncZeus.App]模拟测试数据(可忽略) 39 | * plugin:存放前端项目[DncZeus.App]的Vue插件 40 | * router:存放前端项目[DncZeus.App]的路由拦截和路由配置等 41 | * store:存放前端项目[DncZeus.App]的全局状态管理(基于vuex) 42 | * view:存放前端项目[DncZeus.App]的视图页面,所有业务有关的页面视图均放到此文件夹中 43 | 44 | ## 后端项目(DncZeus.Api) 45 | 46 | DncZeus.App其实就是一个常规的ASP.NET Core WebApi应用程序。 47 | 48 | 由于考虑到项目的简单,易懂,所以只创建了一个单项目,并且目前没有对其进行复杂的架构和封装。相信只要有一点.NET开发基础的都应该可以明白项目的目录结构。所以,这里不再详细分解每个文件夹的作用和意义。 49 | 50 | [1]: https://statics.codedefault.com/img/dnczeus/docs/dnczeus-document-004-solution-structure.png 51 | [2]: https://statics.codedefault.com/img/dnczeus/docs/dnczeus-document-005-frontent-folder-structure-001.png -------------------------------------------------------------------------------- /Docs/99.refs.md: -------------------------------------------------------------------------------- 1 | issues: 2 | https://www.cnblogs.com/zhaogaojian/p/10163745.html -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Rector 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 | -------------------------------------------------------------------------------- /Scripts/(脚本必看,非常重要)v2.0.0.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/(脚本必看,非常重要)v2.0.0.txt -------------------------------------------------------------------------------- /Scripts/v1.0.0/(非常重要)初次运行必看.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v1.0.0/(非常重要)初次运行必看.txt -------------------------------------------------------------------------------- /Scripts/v1.0.0/(非常重要)升级必看.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v1.0.0/(非常重要)升级必看.txt -------------------------------------------------------------------------------- /Scripts/v1.0.0/v1.0.0(SQL脚本).7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v1.0.0/v1.0.0(SQL脚本).7z -------------------------------------------------------------------------------- /Scripts/v2.0.0/MySQL结构和示例数据脚本.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v2.0.0/MySQL结构和示例数据脚本.zip -------------------------------------------------------------------------------- /Scripts/v2.0.0/PostgreSQL结构和示例数据脚本.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v2.0.0/PostgreSQL结构和示例数据脚本.zip -------------------------------------------------------------------------------- /Scripts/v2.0.0/SQL Server结构和示例数据脚本.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lampo1024/DncZeus/4063bea7fec3d9303b942cc073951a6141e121fe/Scripts/v2.0.0/SQL Server结构和示例数据脚本.zip --------------------------------------------------------------------------------
${Random.csentence(100, 200)}
QQ扫一扫二维码加群
本群为使用DncZeus/.NET Core或者对DncZeus/.NET Core感兴趣的开发者提供交流平台。在这里,解决你开发中的疑惑,共同进步。
10 | 本框架 [DncZeus] 由 码友网 创建者Rector主导开发和维护。 11 |
{{ infor.title }}
动态路由,添加params
动态路由,添加query
手动关闭页面