From 99aa7d336166980da1d247d5a01174927cd94792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B7=B3?= Date: Wed, 22 Feb 2023 16:49:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8A=BD=E8=B1=A1=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.BBS.Vue2/src/api/accountApi.js | 6 -- Yi.BBS.Vue2/src/permission.js | 20 ++--- Yi.BBS.Vue2/src/store/modules/user.js | 12 +-- Yi.BBS.Vue2/src/utils/myaxios.js | 8 +- Yi.Framework.Net6/Yi.Framework.sln | 7 ++ .../Dtos/PagedAllResultRequestDto.cs | 7 ++ .../Dtos/PagedAndSortedResultRequestDto.cs | 15 ++++ .../YiFrameworkSwaggerDoc.xml | 30 ++++++++ .../GlobalOperLogAttribute.cs | 10 +-- .../IOperationLogService.cs | 5 +- .../Yi.Framework.OperLog}/OperEnum.cs | 2 +- .../Yi.Framework.OperLog}/OperLogAttribute.cs | 8 +- .../OperationLogEntity.cs | 5 +- .../OperationLogGetListInputVo.cs | 3 +- .../OperationLogGetListOutputDto.cs | 3 +- .../OperationLogService.cs | 9 +-- .../Yi.Framework.OperLog.csproj | 19 +++++ .../YiFrameworkOperLogModule.cs | 24 ++++++ .../module/Yi.Framework.Template/Program.cs | 4 +- .../ApplicationSwaggerDoc.xml | 19 ----- .../project/BBS/Yi.BBS.Web/YiBBSWebModule.cs | 4 +- .../project/BBS/Yi.BBS.Web/appsettings.json | 2 +- .../project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db | Bin 212992 -> 229376 bytes .../ApplicationSwaggerDoc.xml | 19 ----- .../GlobalSetting/TempService.cs | 70 +++++++++--------- .../project/bbs/Yi.BBS.Web/YiBBSWebModule.cs | 4 +- .../project/bbs/Yi.BBS.Web/appsettings.json | 2 +- .../project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db | Bin 212992 -> 229376 bytes .../ApplicationContractsSwaggerDoc.xml | 55 ++++++++++++-- .../Dtos/User/ProfileUpdateInputVo.cs | 24 ++++++ .../Dtos/Config/ConfigGetListInputVo.cs | 12 ++- .../Dtos/Config/ConfigGetListOutputDto.cs | 24 ++++++ .../ApplicationSwaggerDoc.xml | 19 +++-- .../Identity/UserService.cs | 21 +++++- .../Setting/ConfigService.cs | 5 ++ .../Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs | 68 +++++++++++++++++ .../rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml | 50 ------------- .../rbac/Yi.RBAC.Domain/Yi.RBAC.Domain.csproj | 2 +- .../rbac/Yi.RBAC.Domain/YiRBACDomainModule.cs | 9 +-- .../rbac/Yi.RBAC.Web/YiRBACWebModule.cs | 2 + .../rbac/Yi.RBAC.Web/yi-sqlsugar-dev.db | Bin 135168 -> 135168 bytes Yi.RuoYi.Vue3/src/api/system/user.js | 6 +- Yi.RuoYi.Vue3/src/utils/request.js | 13 ++-- 43 files changed, 415 insertions(+), 212 deletions(-) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Domain/Logs => module/Yi.Framework.OperLog}/GlobalOperLogAttribute.cs (93%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Application.Contracts/Logs => module/Yi.Framework.OperLog}/IOperationLogService.cs (66%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Domain.Shared/Logs => module/Yi.Framework.OperLog}/OperEnum.cs (90%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Domain.Shared/Logs => module/Yi.Framework.OperLog}/OperLogAttribute.cs (82%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Domain/Logs/Entities => module/Yi.Framework.OperLog}/OperationLogEntity.cs (92%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog => module/Yi.Framework.OperLog}/OperationLogGetListInputVo.cs (89%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog => module/Yi.Framework.OperLog}/OperationLogGetListOutputDto.cs (89%) rename Yi.Framework.Net6/src/{project/rbac/Yi.RBAC.Application/Logs => module/Yi.Framework.OperLog}/OperationLogService.cs (72%) create mode 100644 Yi.Framework.Net6/src/module/Yi.Framework.OperLog/Yi.Framework.OperLog.csproj create mode 100644 Yi.Framework.Net6/src/module/Yi.Framework.OperLog/YiFrameworkOperLogModule.cs create mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/User/ProfileUpdateInputVo.cs create mode 100644 Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs diff --git a/Yi.BBS.Vue2/src/api/accountApi.js b/Yi.BBS.Vue2/src/api/accountApi.js index 0540cda7..f0c04757 100644 --- a/Yi.BBS.Vue2/src/api/accountApi.js +++ b/Yi.BBS.Vue2/src/api/accountApi.js @@ -16,12 +16,6 @@ export default { method: 'post', }) }, - logged() { - return myaxios({ - url: '/Account/logged', - method: 'post', - }) - }, register(username, password, email, code) { return myaxios({ url: `/Account/register?code=${code}`, diff --git a/Yi.BBS.Vue2/src/permission.js b/Yi.BBS.Vue2/src/permission.js index 430689bf..9a3f5455 100644 --- a/Yi.BBS.Vue2/src/permission.js +++ b/Yi.BBS.Vue2/src/permission.js @@ -12,14 +12,16 @@ router.beforeEach((to, from, next) => { next({ path: '/login' }); } } else { //如果有user还要向后端请求是否过期 - store.dispatch("Logged").then(resp => { - if (!resp.status) //表示已经过期 - { - store.dispatch("Logout"); - next({ path: '/login' }); - } else { - next(); - } - }) + + next(); + // store.dispatch("Logged").then(resp => { + // if (!resp.status) //表示已经过期 + // { + // store.dispatch("Logout"); + // next({ path: '/login' }); + // } else { + // next(); + // } + // }) } }) \ No newline at end of file diff --git a/Yi.BBS.Vue2/src/store/modules/user.js b/Yi.BBS.Vue2/src/store/modules/user.js index a09eac0c..2d3717a4 100644 --- a/Yi.BBS.Vue2/src/store/modules/user.js +++ b/Yi.BBS.Vue2/src/store/modules/user.js @@ -63,7 +63,7 @@ const actions = { //动作 return new Promise((resolv, reject) => { accountApi.login(form.username.trim(), form.password.trim()).then(resp => { commit('SET_TOKEN', resp.data.token) - commit('SET_USER', resp.data.user) + // commit('SET_USER', resp.data.user) resolv(resp) }).catch(error => { reject(error) @@ -82,16 +82,6 @@ const actions = { //动作 }) }) }, - Logged({ commit }) { - return new Promise((resolv, reject) => { - accountApi.logged().then(resp => { - resolv(resp) - }).catch(error => { - reject(error) - }) - }) - }, - // GetUserInfo({ commit, state }) { // return new Promise((resolv, reject) => { // // getUserInfo(state.token).then(response => { diff --git a/Yi.BBS.Vue2/src/utils/myaxios.js b/Yi.BBS.Vue2/src/utils/myaxios.js index 2e37c708..1f703c8c 100644 --- a/Yi.BBS.Vue2/src/utils/myaxios.js +++ b/Yi.BBS.Vue2/src/utils/myaxios.js @@ -27,7 +27,11 @@ myaxios.interceptors.request.use(function(config) { // 响应拦截器 myaxios.interceptors.response.use(function(response) { - // const resp = response.data + const resp = response.data + if(resp.code!=200) + { + alert(`错误代码:${resp.code},原因:${resp.message}`) + } store.dispatch("closeLoad"); return response; }, function(error) { @@ -35,7 +39,7 @@ myaxios.interceptors.response.use(function(response) { if (resp.code == undefined && resp.msg == undefined) { alert(`错误代码:无,原因:与服务器失去连接`) } else if (resp.code != 200) { - alert(`错误代码:${resp.code},原因:${resp.msg}`) + alert(`错误代码:${resp.code},原因:${resp.message}`) } store.dispatch("closeLoad"); return Promise.reject(error); diff --git a/Yi.Framework.Net6/Yi.Framework.sln b/Yi.Framework.Net6/Yi.Framework.sln index a64529ea..182280d5 100644 --- a/Yi.Framework.Net6/Yi.Framework.sln +++ b/Yi.Framework.Net6/Yi.Framework.sln @@ -95,6 +95,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Version.cs = Version.cs EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Yi.Framework.OperLog", "src\module\Yi.Framework.OperLog\Yi.Framework.OperLog.csproj", "{8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -245,6 +247,10 @@ Global {FC559052-36EC-4379-B447-298FAD6045F4}.Debug|Any CPU.Build.0 = Debug|Any CPU {FC559052-36EC-4379-B447-298FAD6045F4}.Release|Any CPU.ActiveCfg = Release|Any CPU {FC559052-36EC-4379-B447-298FAD6045F4}.Release|Any CPU.Build.0 = Release|Any CPU + {8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A604A6B-D1FA-4CFF-BCF5-557519B10FCB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -289,6 +295,7 @@ Global {0C031C7D-6F80-4559-977C-AC001036EC44} = {07C9E949-DB5E-4315-A497-FF73746667D8} {60E54034-792C-4A90-BCDF-4D5FFB45089E} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} {FC559052-36EC-4379-B447-298FAD6045F4} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} + {8A604A6B-D1FA-4CFF-BCF5-557519B10FCB} = {EEF5F221-0E32-4A3D-B647-B4B5E7305806} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6C1A3808-0F4F-43FB-A9FE-5F27A3BB2ECF} diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAllResultRequestDto.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAllResultRequestDto.cs index 45384dfa..0c7a918b 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAllResultRequestDto.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAllResultRequestDto.cs @@ -10,7 +10,14 @@ namespace Yi.Framework.Ddd.Dtos { public class PagedAllResultRequestDto : PagedAndSortedResultRequestDto, IPagedAllResultRequestDto, IPagedAndSortedResultRequestDto, IPageTimeResultRequestDto { + /// + /// 查询开始时间条件 + /// public DateTime? StartTime { get; set; } + + /// + /// 查询结束时间条件 + /// public DateTime? EndTime { get; set; } } } diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAndSortedResultRequestDto.cs b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAndSortedResultRequestDto.cs index cde6606f..d5d114b0 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAndSortedResultRequestDto.cs +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/Dtos/PagedAndSortedResultRequestDto.cs @@ -9,9 +9,24 @@ namespace Yi.Framework.Ddd.Dtos { public class PagedAndSortedResultRequestDto : IPagedAndSortedResultRequestDto { + /// + /// 查询当前页条件 + /// public int PageNum { get; set; } = 1; + + /// + /// 查询分页大小条件 + /// public int PageSize { get; set; } = int.MaxValue; + + /// + /// 查询排序字段条件 + /// public string? SortBy { get; set; } + + /// + /// 查询排序类别条件 + /// public OrderByEnum SortType { get; set; } = OrderByEnum.Desc; } } diff --git a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml index 182fbb53..17d6484d 100644 --- a/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/framework/Yi.Framework.Ddd/YiFrameworkSwaggerDoc.xml @@ -4,6 +4,36 @@ Yi.Framework.Ddd + + + 查询开始时间条件 + + + + + 查询结束时间条件 + + + + + 查询当前页条件 + + + + + 查询分页大小条件 + + + + + 查询排序字段条件 + + + + + 查询排序类别条件 + + 注释一下,严格意义这里应该protected,但是我认为 简易程度 与 耦合程度 中是需要进行衡量的 diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/GlobalOperLogAttribute.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/GlobalOperLogAttribute.cs similarity index 93% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/GlobalOperLogAttribute.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/GlobalOperLogAttribute.cs index d7cc28a0..c1460a6f 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/GlobalOperLogAttribute.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/GlobalOperLogAttribute.cs @@ -10,11 +10,11 @@ using System.Text; using System.Threading.Tasks; using Yi.Framework.AspNetCore.Extensions; using Yi.Framework.Core.CurrentUsers; +using Yi.Framework.Core.Helper; using Yi.Framework.Ddd.Repositories; -using Yi.Framework.Model.RABC.Entitys; -using Yi.RBAC.Domain.Shared.Logs; -namespace Yi.RBAC.Domain.Logs + +namespace Yi.Framework.OperLog { public class GlobalOperLogAttribute : ActionFilterAttribute { @@ -22,11 +22,11 @@ namespace Yi.RBAC.Domain.Logs private IRepository _repository; private ICurrentUser _currentUser; //注入一个日志服务 - public GlobalOperLogAttribute(ILogger logger, IRepository repository,ICurrentUser currentUser) + public GlobalOperLogAttribute(ILogger logger, IRepository repository, ICurrentUser currentUser) { _logger = logger; _repository = repository; - _currentUser=currentUser; + _currentUser = currentUser; } public override async void OnResultExecuted(ResultExecutedContext context) diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/IOperationLogService.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/IOperationLogService.cs similarity index 66% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/IOperationLogService.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/IOperationLogService.cs index b676a4b0..3a17ed0f 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/IOperationLogService.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/IOperationLogService.cs @@ -3,15 +3,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Yi.RBAC.Application.Contracts.Logs.Dtos; using Yi.Framework.Ddd.Services.Abstract; -namespace Yi.RBAC.Application.Contracts.Logs +namespace Yi.Framework.OperLog { /// /// OperationLog服务抽象 /// - public interface IOperationLogService : ICrudAppService + public interface IOperationLogService : ICrudAppService { } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperEnum.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperEnum.cs similarity index 90% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperEnum.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperEnum.cs index 188ad1e2..9aa024d3 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperEnum.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperEnum.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.RBAC.Domain.Shared.Logs +namespace Yi.Framework.OperLog { public enum OperEnum { diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperLogAttribute.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperLogAttribute.cs similarity index 82% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperLogAttribute.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperLogAttribute.cs index 49625d7a..5b1102b5 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain.Shared/Logs/OperLogAttribute.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperLogAttribute.cs @@ -4,10 +4,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace Yi.RBAC.Domain.Shared.Logs +namespace Yi.Framework.OperLog { [AttributeUsage(AttributeTargets.Method)] - public class OperLogAttribute : System.Attribute + public class OperLogAttribute : Attribute { /// /// 操作类型 @@ -31,8 +31,8 @@ namespace Yi.RBAC.Domain.Shared.Logs public OperLogAttribute(string title, OperEnum operationType) { - this.Title = title; - this.OperType = operationType; + Title = title; + OperType = operationType; } } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/Entities/OperationLogEntity.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogEntity.cs similarity index 92% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/Entities/OperationLogEntity.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogEntity.cs index ba513734..defd5de9 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Logs/Entities/OperationLogEntity.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogEntity.cs @@ -5,15 +5,14 @@ using System.Text.Json.Serialization; using SqlSugar; using Yi.Framework.Data.Auditing; using Yi.Framework.Ddd.Entities; -using Yi.RBAC.Domain.Shared.Logs; -namespace Yi.Framework.Model.RABC.Entitys +namespace Yi.Framework.OperLog { /// /// 操作日志表 /// [SugarTable("OperationLog")] - public class OperationLogEntity : IEntity, ICreationAuditedObject + public class OperationLogEntity : IEntity, ICreationAuditedObject { [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)] public long Id { get; set; } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListInputVo.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs similarity index 89% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListInputVo.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs index dce0661b..c1be7f4f 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListInputVo.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs @@ -4,9 +4,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Ddd.Dtos; -using Yi.RBAC.Domain.Shared.Logs; -namespace Yi.RBAC.Application.Contracts.Logs.Dtos +namespace Yi.Framework.OperLog { public class OperationLogGetListInputVo : PagedAllResultRequestDto { diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListOutputDto.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListOutputDto.cs similarity index 89% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListOutputDto.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListOutputDto.cs index 0f727957..1e3191b6 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Logs/Dtos/OperationLog/OperationLogGetListOutputDto.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListOutputDto.cs @@ -4,9 +4,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Yi.Framework.Ddd.Dtos; -using Yi.RBAC.Domain.Shared.Logs; -namespace Yi.RBAC.Application.Contracts.Logs.Dtos +namespace Yi.Framework.OperLog { public class OperationLogGetListOutputDto : IEntityDto { diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/OperationLogService.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs similarity index 72% rename from Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/OperationLogService.cs rename to Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs index b267768a..d2843854 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/OperationLogService.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs @@ -1,18 +1,15 @@ -using Yi.RBAC.Application.Contracts.Logs; using NET.AutoWebApi.Setting; -using Yi.RBAC.Application.Contracts.Logs.Dtos; -using Yi.RBAC.Domain.Logs.Entities; using Yi.Framework.Ddd.Services; -using Yi.Framework.Model.RABC.Entitys; using Yi.Framework.Ddd.Dtos; +using Yi.Framework.Core.Attributes; -namespace Yi.RBAC.Application.Logs +namespace Yi.Framework.OperLog { /// /// OperationLog服务实现 /// [AppService] - public class OperationLogService : CrudAppService, + public class OperationLogService : CrudAppService, IOperationLogService, IAutoApiService { public override Task> GetListAsync(OperationLogGetListInputVo input) diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/Yi.Framework.OperLog.csproj b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/Yi.Framework.OperLog.csproj new file mode 100644 index 00000000..a77b0b8f --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/Yi.Framework.OperLog.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/YiFrameworkOperLogModule.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/YiFrameworkOperLogModule.cs new file mode 100644 index 00000000..ee0db3bc --- /dev/null +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/YiFrameworkOperLogModule.cs @@ -0,0 +1,24 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using StartupModules; +using Yi.Framework.Core; +using Yi.Framework.Core.Attributes; + +namespace Yi.Framework.OperLog +{ + [DependsOn(typeof(YiFrameworkCoreModule))] + public class YiFrameworkOperLogModule : IStartupModule + { + public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context) + { + } + + public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) + { + services.AddControllers(options => { + options.Filters.Add(); + }); + services.AddSingleton(); + } + } +} \ No newline at end of file diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs index 1d6c5a27..7ec9ebe8 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.Template/Program.cs @@ -20,9 +20,9 @@ TemplateFactory templateFactory = new(); //string modelName = "Dictionary"; //string nameSpaces = "Yi.RBAC"; //List entityNames = new() { "_", "_" }; -string modelName = "Logs"; +string modelName = "Setting"; string nameSpaces = "Yi.RBAC"; -List entityNames = new() { "_" }; +List entityNames = new() { "File" }; foreach (var entityName in entityNames) diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml index 9dc71566..00dc323b 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Application/ApplicationSwaggerDoc.xml @@ -120,25 +120,6 @@ 临时服务,之后用其他模块代替 - - - 登录 - - - - - - - 判断是否有登录 - - - - - - 退出登录 - - - 获取用户信息 diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/YiBBSWebModule.cs b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/YiBBSWebModule.cs index 9a9129cb..f7417fd2 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/YiBBSWebModule.cs +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/YiBBSWebModule.cs @@ -10,6 +10,7 @@ using Yi.Framework.Core.Autofac; using Yi.RBAC.Application; using Yi.Framework.AspNetCore; using Yi.Framework.Data.Json; +using Yi.Framework.OperLog; namespace Yi.BBS.Web { @@ -31,7 +32,8 @@ namespace Yi.BBS.Web { //NETServiceTest所在程序集添加进动态api配置 opt.CreateConventional(typeof(YiBBSApplicationModule).Assembly, option => option.RootPath = string.Empty); - //opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty); + opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty); + opt.CreateConventional(typeof(YiFrameworkOperLogModule).Assembly, option => option.RootPath = string.Empty); }); //添加swagger diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json index bf88b491..1d927cdf 100644 --- a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json +++ b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/appsettings.json @@ -16,7 +16,7 @@ "DbConnOptions": { "Url": "DataSource=yi-sqlsugar-dev.db", "DbType": "Sqlite", - "EnabledDbSeed": false, + "EnabledDbSeed": true, "EnabledReadWrite": false, "EnabledCodeFirst": true, "EntityAssembly": null, diff --git a/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/BBS/Yi.BBS.Web/yi-sqlsugar-dev.db index 4bc8b298f3c68ae4dda27581a7b861743030bbd9..1516839bd898822ba9be143c7fa317f8c9ed5637 100644 GIT binary patch delta 1828 zcmbW1TTI(#6vzG9aV`aH=mkm+ zMqMIa{Kg`90>|we@H7&qWpY;am)l<>ew+FzkT~x%`XZTv%NR6^fxkR747(D@-f`LH^WY*N5NcLOXK{i7#*M zE#E%vq1+yKSM{(?BYDfNk&CMg%_@_HQb>Ev+O8Ibg|rPdG&NcMUWy;T-xwK3!k%fJLJ!Mimd>w7->K1pKT|J;tT9rPZ*WhdFuj@8fHP}qDn))iY!&oD( z@dsQQxkB4+=~bEQsNv2&nX0uz+G=vvd#@XUK8HiSc&g7?z@&CwWY8kS7im5J)??U*Wcr0t{5q>&d zXE+PtrrBeE>k%QzABJ)O1_`wMRep%K%&$YWya3XIW`nCpF*d`vjvN4s(1|#M6-t;6lN3QZwdgcyL z353E@CBZGYCSrMuGQ+fxnKMPaB?gzEu)swJ?!$j^AP5y7e!(hOG4d|SD=01oqj)ke z2l+aG2;ZnXdH(Kp-`cmnD_3l)PnB|Rb`yttjS#Snn z$nG_BgmKRA@N)}0!ca^G;d6LB_6IhB$(a68f(6^rQ(S4@s}~C{l|uPb->XRGvmw<4 zAtp%X6cR*5^0e6!(Yrg*6)|&5M875_$})oak$O)z<+|?Z?_^>Ul7!8+JH5X1&F$UT z`tJHnJ10~7!Ea}nUi2^RAgg~eapZ{jgUJ&G9y}&;I8%HvdiF%($7q8LZR^ycQ&Ih& zw469AY->RAEw(l6;@kKS_*N`W_ytY}9|H7By1ZyM!Ug$Lsd{kIlVtvo)Fj1w&`px@ F{R2X~a5w+} delta 364 zcmYL^%S!@L9EI=i&QqI*6Qn&5O{lbll7a}Ktq2KIgb)NhU}z&m(INzCEQnU6xVRB5 z1SOHOG{I{-*R3O|RsVv!j9wN*2hQd!KE7j`ifPKJ0WF9Sn(Fi~-n4%bf|b=Xm3MZw zer?}YvjJ-|8q=mi3X;GhgtsCinR&rQOKDhCh8RE+7)UKDW#vG=mrulL(aL=ZPs}Ly z2!!PX3U5fGj`tbe_{^T%D^^qtnRL|`iILW?jnteBDJZ8RJ*(+Pe`ZIhGp9l t7AvAD+=wAAEX0{8Csj3@pP|tz_HY;>60hS|`j&-b{#Iw*lzqYPE8oRfWNZKc diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/ApplicationSwaggerDoc.xml index 9dc71566..00dc323b 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/ApplicationSwaggerDoc.xml @@ -120,25 +120,6 @@ 临时服务,之后用其他模块代替 - - - 登录 - - - - - - - 判断是否有登录 - - - - - - 退出登录 - - - 获取用户信息 diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/GlobalSetting/TempService.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/GlobalSetting/TempService.cs index 48815354..eea37a3d 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/GlobalSetting/TempService.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Application/GlobalSetting/TempService.cs @@ -14,43 +14,43 @@ namespace Yi.BBS.Application.GlobalSetting [AppService] public class TempService : ApplicationService, IAutoApiService { - /// - /// 登录 - /// - /// - /// - [Route("/api/account/login")] - public Task PostLoginAsync() - { - bool loginSucces = true; - if (!loginSucces) - { - throw new UserFriendlyException("登录失败", (int)BbsHttpStatusEnum.LoginFailed, "用户或者密码错误"); - } - var dto = new LoginDto("token"); - dto.User = new LoginUserInfoDto { Icon = "", Id = 0, Level = 1, UserName = "橙子" }; - return Task.FromResult(dto); - } + ///// + ///// 登录 + ///// + ///// + ///// + //[Route("/api/account/login")] + //public Task PostLoginAsync() + //{ + // bool loginSucces = true; + // if (!loginSucces) + // { + // throw new UserFriendlyException("登录失败", (int)BbsHttpStatusEnum.LoginFailed, "用户或者密码错误"); + // } + // var dto = new LoginDto("token"); + // dto.User = new LoginUserInfoDto { Icon = "", Id = 0, Level = 1, UserName = "橙子" }; + // return Task.FromResult(dto); + //} - /// - /// 判断是否有登录 - /// - /// - [Route("/api/account/logged")] - public Task PostLogged() - { - return Task.FromResult(true); - } + ///// + ///// 判断是否有登录 + ///// + ///// + //[Route("/api/account/logged")] + //public Task PostLogged() + //{ + // return Task.FromResult(true); + //} - /// - /// 退出登录 - /// - /// - [Route("/api/account/logout")] - public Task PostlogOut() - { - return Task.CompletedTask; - } + ///// + ///// 退出登录 + ///// + ///// + //[Route("/api/account/logout")] + //public Task PostlogOut() + //{ + // return Task.CompletedTask; + //} /// /// 获取用户信息 diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/YiBBSWebModule.cs b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/YiBBSWebModule.cs index 9a9129cb..f7417fd2 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/YiBBSWebModule.cs +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/YiBBSWebModule.cs @@ -10,6 +10,7 @@ using Yi.Framework.Core.Autofac; using Yi.RBAC.Application; using Yi.Framework.AspNetCore; using Yi.Framework.Data.Json; +using Yi.Framework.OperLog; namespace Yi.BBS.Web { @@ -31,7 +32,8 @@ namespace Yi.BBS.Web { //NETServiceTest所在程序集添加进动态api配置 opt.CreateConventional(typeof(YiBBSApplicationModule).Assembly, option => option.RootPath = string.Empty); - //opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty); + opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty); + opt.CreateConventional(typeof(YiFrameworkOperLogModule).Assembly, option => option.RootPath = string.Empty); }); //添加swagger diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json index bf88b491..1d927cdf 100644 --- a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json +++ b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/appsettings.json @@ -16,7 +16,7 @@ "DbConnOptions": { "Url": "DataSource=yi-sqlsugar-dev.db", "DbType": "Sqlite", - "EnabledDbSeed": false, + "EnabledDbSeed": true, "EnabledReadWrite": false, "EnabledCodeFirst": true, "EntityAssembly": null, diff --git a/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/bbs/Yi.BBS.Web/yi-sqlsugar-dev.db index 4bc8b298f3c68ae4dda27581a7b861743030bbd9..1516839bd898822ba9be143c7fa317f8c9ed5637 100644 GIT binary patch delta 1828 zcmbW1TTI(#6vzG9aV`aH=mkm+ zMqMIa{Kg`90>|we@H7&qWpY;am)l<>ew+FzkT~x%`XZTv%NR6^fxkR747(D@-f`LH^WY*N5NcLOXK{i7#*M zE#E%vq1+yKSM{(?BYDfNk&CMg%_@_HQb>Ev+O8Ibg|rPdG&NcMUWy;T-xwK3!k%fJLJ!Mimd>w7->K1pKT|J;tT9rPZ*WhdFuj@8fHP}qDn))iY!&oD( z@dsQQxkB4+=~bEQsNv2&nX0uz+G=vvd#@XUK8HiSc&g7?z@&CwWY8kS7im5J)??U*Wcr0t{5q>&d zXE+PtrrBeE>k%QzABJ)O1_`wMRep%K%&$YWya3XIW`nCpF*d`vjvN4s(1|#M6-t;6lN3QZwdgcyL z353E@CBZGYCSrMuGQ+fxnKMPaB?gzEu)swJ?!$j^AP5y7e!(hOG4d|SD=01oqj)ke z2l+aG2;ZnXdH(Kp-`cmnD_3l)PnB|Rb`yttjS#Snn z$nG_BgmKRA@N)}0!ca^G;d6LB_6IhB$(a68f(6^rQ(S4@s}~C{l|uPb->XRGvmw<4 zAtp%X6cR*5^0e6!(Yrg*6)|&5M875_$})oak$O)z<+|?Z?_^>Ul7!8+JH5X1&F$UT z`tJHnJ10~7!Ea}nUi2^RAgg~eapZ{jgUJ&G9y}&;I8%HvdiF%($7q8LZR^ycQ&Ih& zw469AY->RAEw(l6;@kKS_*N`W_ytY}9|H7By1ZyM!Ug$Lsd{kIlVtvo)Fj1w&`px@ F{R2X~a5w+} delta 364 zcmYL^%S!@L9EI=i&QqI*6Qn&5O{lbll7a}Ktq2KIgb)NhU}z&m(INzCEQnU6xVRB5 z1SOHOG{I{-*R3O|RsVv!j9wN*2hQd!KE7j`ifPKJ0WF9Sn(Fi~-n4%bf|b=Xm3MZw zer?}YvjJ-|8q=mi3X;GhgtsCinR&rQOKDhCh8RE+7)UKDW#vG=mrulL(aL=ZPs}Ly z2!!PX3U5fGj`tbe_{^T%D^^qtnRL|`iILW?jnteBDJZ8RJ*(+Pe`ZIhGp9l t7AvAD+=wAAEX0{8Csj3@pP|tz_HY;>60hS|`j&-b{#Iw*lzqYPE8oRfWNZKc diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/ApplicationContractsSwaggerDoc.xml b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/ApplicationContractsSwaggerDoc.xml index e4d97274..cf583a46 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/ApplicationContractsSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/ApplicationContractsSwaggerDoc.xml @@ -94,16 +94,61 @@ 登录信息 - - - OperationLog服务抽象 - - Config输入创建对象 + + + 配置查询参数 + + + + + 配置名称 + + + + + 配置键 + + + + + 配置名称 + + + + + 配置主键 + + + + + 配置值 + + + + + 配置类型 + + + + + 排序字段 + + + + + 备注 + + + + + 创建时间 + + Config服务抽象 diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/User/ProfileUpdateInputVo.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/User/ProfileUpdateInputVo.cs new file mode 100644 index 00000000..f5696f2a --- /dev/null +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Identity/Dtos/User/ProfileUpdateInputVo.cs @@ -0,0 +1,24 @@ +using Mapster; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.RBAC.Domain.Shared.Identity.EnumClasses; + +namespace Yi.RBAC.Application.Contracts.Identity.Dtos.User +{ + public class ProfileUpdateInputVo + { + public string? Name { get; set; } + public int? Age { get; set; } + public string? Icon { get; set; } + public string? Nick { get; set; } + public string? Email { get; set; } + public string? Address { get; set; } + public long? Phone { get; set; } + public string? Introduction { get; set; } + public string? Remark { get; set; } + public SexEnum? Sex { get; set; } + } +} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListInputVo.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListInputVo.cs index 4d1c0a30..1782cec4 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListInputVo.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListInputVo.cs @@ -7,10 +7,20 @@ using Yi.Framework.Ddd.Dtos; namespace Yi.RBAC.Application.Contracts.Setting.Dtos { + /// + /// òѯ + /// public class ConfigGetListInputVo : PagedAllResultRequestDto { + /// + /// + /// public string? ConfigName { get; set; } + + /// + /// ü + /// public string? ConfigKey { get; set; } - public DateTime CreationTime { get; set; } + } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListOutputDto.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListOutputDto.cs index 73819616..1b1da511 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListOutputDto.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application.Contracts/Setting/Dtos/Config/ConfigGetListOutputDto.cs @@ -10,12 +10,36 @@ namespace Yi.RBAC.Application.Contracts.Setting.Dtos public class ConfigGetListOutputDto : IEntityDto { public long Id { get; set; } + /// + /// + /// public string ConfigName { get; set; } = string.Empty; + + /// + /// + /// public string ConfigKey { get; set; } = string.Empty; + /// + /// ֵ + /// public string ConfigValue { get; set; } = string.Empty; + /// + /// + /// public string? ConfigType { get; set; } + /// + /// ֶ + /// public int OrderNum { get; set; } + + /// + /// ע + /// public string? Remark { get; set; } + + /// + /// ʱ + /// public DateTime CreationTime { get; set; } } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/ApplicationSwaggerDoc.xml b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/ApplicationSwaggerDoc.xml index 75e1f5ac..38916e3c 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/ApplicationSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/ApplicationSwaggerDoc.xml @@ -171,6 +171,13 @@ + + + 更新个人中心 + + + + 更新状态 @@ -179,15 +186,17 @@ - - - OperationLog服务实现 - - Config服务实现 + + + 多查 + + + + diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs index c41f34d4..aa1ce658 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/UserService.cs @@ -12,6 +12,8 @@ using SqlSugar; using Mapster; using Microsoft.AspNetCore.Mvc; using Yi.Framework.Auth.JwtBearer.Authorization; +using Yi.RBAC.Application.Contracts.Identity.Dtos.User; +using Yi.Framework.Core.CurrentUsers; namespace Yi.RBAC.Application.Identity { @@ -31,6 +33,9 @@ namespace Yi.RBAC.Application.Identity [Autowired] private IUserRepository _userRepository { get; set; } + [Autowired] + private ICurrentUser _currentUser { get; set; } + /// /// 查询用户 /// @@ -135,6 +140,20 @@ namespace Yi.RBAC.Application.Identity return await MapToGetOutputDtoAsync(entity); } + /// + /// 更新个人中心 + /// + /// + /// + public async Task UpdateProfileAsync(ProfileUpdateInputVo input) + { + var entity = await _repository.GetByIdAsync(_currentUser.Id); + _mapper.Map(input, entity); + await _repository.UpdateAsync(entity); + var dto = _mapper.Map(entity); + return dto; + } + /// /// 更新状态 /// @@ -142,7 +161,7 @@ namespace Yi.RBAC.Application.Identity /// /// [Route("/api/user/{id}/{state}")] - public async Task UpdateStateAsync([FromRoute] long id,[FromRoute] bool state) + public async Task UpdateStateAsync([FromRoute] long id, [FromRoute] bool state) { var entity = await _repository.GetByIdAsync(id); if (entity is null) diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Setting/ConfigService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Setting/ConfigService.cs index 3cf4e1f8..c996a43a 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Setting/ConfigService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Setting/ConfigService.cs @@ -19,6 +19,11 @@ namespace Yi.RBAC.Application.Setting public class ConfigService : CrudAppService, IConfigService, IAutoApiService { + /// + /// 多查 + /// + /// + /// public override async Task> GetListAsync(ConfigGetListInputVo input) { var entity = await MapToEntityAsync(input); diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs new file mode 100644 index 00000000..b16193da --- /dev/null +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DataSeeds/UserDataSeed.cs @@ -0,0 +1,68 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Yi.Framework.Data.DataSeeds; +using Yi.Framework.Ddd.Repositories; +using Yi.RBAC.Domain.Identity.Entities; +using Yi.RBAC.Domain.Shared.Identity.EnumClasses; + +namespace Yi.RBAC.Domain.DataSeeds +{ + [AppService(typeof(IDataSeed))] + public class UserDataSeed : AbstractDataSeed + { + public UserDataSeed(IRepository repository) : base(repository) + { + } + + public override List GetSeedData() + { + var entities=new List(); + UserEntity user1 = new UserEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + Name = "大橙子", + UserName = "cc", + Nick = "橙子", + Password = "123456", + Email = "454313500@qq.com", + Phone = 13800000000, + Sex = SexEnum.Male, + Address = "深圳", + Age = 20, + Introduction = "还有谁?", + OrderNum = 999, + Remark = "描述是什么呢?", + State = true + }; + user1.BuildPassword(); + entities.Add(user1); + + UserEntity user2 = new UserEntity() + { + Id = SnowFlakeSingle.Instance.NextId(), + Name = "大测试", + UserName = "test", + Nick = "测试", + Password = "123456", + Email = "454313500@qq.com", + Phone = 15900000000, + Sex = SexEnum.Woman, + Address = "深圳", + Age = 18, + Introduction = "还有我!", + OrderNum = 1, + Remark = "我没有描述!", + State = true + + }; + user2.BuildPassword(); + entities.Add(user2); + + return entities; + } + } +} diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml index e60d99a5..d7fd7578 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/DomainSwaggerDoc.xml @@ -790,55 +790,5 @@ 描述 - - - 操作日志表 - - - - - 操作模块 - - - - - 操作类型 - - - - - 请求方法 - - - - - 操作人员 - - - - - 操作Ip - - - - - 操作地点 - - - - - 操作方法 - - - - - 请求参数 - - - - - 请求结果 - - diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Yi.RBAC.Domain.csproj b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Yi.RBAC.Domain.csproj index d8fd344f..3eb4861c 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Yi.RBAC.Domain.csproj +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/Yi.RBAC.Domain.csproj @@ -12,12 +12,12 @@ - + diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/YiRBACDomainModule.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/YiRBACDomainModule.cs index 5a2e9966..40ecf429 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/YiRBACDomainModule.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Domain/YiRBACDomainModule.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Yi.Framework.Core.Attributes; using Yi.Framework.Data; using Yi.Framework.EventBus; +using Yi.Framework.OperLog; using Yi.Framework.ThumbnailSharp; using Yi.RBAC.Domain.Logs; using Yi.RBAC.Domain.Shared; @@ -20,7 +21,8 @@ namespace Yi.RBAC.Domain typeof(YiRBACDomainSharedModule), typeof(YiFrameworkDataModule), typeof(YiFrameworkThumbnailSharpModule), - typeof(YiFrameworkEventBusModule) + typeof(YiFrameworkEventBusModule), + typeof(YiFrameworkOperLogModule) )] public class YiRBACDomainModule : IStartupModule { @@ -31,10 +33,7 @@ namespace Yi.RBAC.Domain public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context) { services.AddHeiCaptcha(); - services.AddControllers(options => { - options.Filters.Add(); - }); - services.AddSingleton(); + } } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/YiRBACWebModule.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/YiRBACWebModule.cs index de6f4604..275e2fd7 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/YiRBACWebModule.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/YiRBACWebModule.cs @@ -7,6 +7,7 @@ using Yi.Framework.Core; using Yi.Framework.Core.Attributes; using Yi.Framework.Core.Autofac; using Yi.Framework.Data.Json; +using Yi.Framework.OperLog; using Yi.RBAC.Application; using Yi.RBAC.Sqlsugar; @@ -32,6 +33,7 @@ namespace Yi.RBAC.Web { //NETServiceTest所在程序集添加进动态api配置 opt.CreateConventional(typeof(YiRBACApplicationModule).Assembly, option => option.RootPath = string.Empty); + opt.CreateConventional(typeof(YiFrameworkOperLogModule).Assembly, option => option.RootPath = string.Empty); }); //添加swagger diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/yi-sqlsugar-dev.db b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Web/yi-sqlsugar-dev.db index 2ebb7ed8ccf616efd81a43a166437207064ad417..ecff1f8fe80d1f5c63f53a794a6fb9637048ffd6 100644 GIT binary patch delta 559 zcmZozz|pXPV}dke&O{k!#+;1_3-x(<-!ZUqCo%9F^Bv|++RSGV!Y$Mo&n(HtA;=-v zXlW}csm>tDI>}C~zTCpa-#5b1*Rd)x&oekDGRrxm$k)f++0-?uG|J1w+%w6{*)%)1 zq$t-cNY}~9GBGkfFuB;n+|o4L(;zoAGC4gW%QZ65+p;((*dnkbDbv`+($dkx-_oVj z+sioLu+X9^tTZbpEv?ci(AKuNq$o2l9f=f4cPK2>OU}=Qh%qo*p6=Q^d5)d>W*3`P zj4b@h3|A+AvQ^2WuQMl4u#=el-;Sqwh28cQc8oC-d06Aa@V?lL!aYaoAu^AuwSe>RHxX&o=`fSdcr*k&w0;y+nb{QI(>lpx{p?^t6YEgJ* zUP^v>v4WvNa`N+;yPxiz`h4^5=ey@eF(Vsw`p`RwQO0B#HGSQE#<0yS3(oNif!!p) Uz{11K#wa!eWa{=O?-^wj0D{@c4gdfE delta 259 zcmZozz|pXPV}dke`a~IL#`KK|3-x*Vl^IxhTp0L``402G+stPW!aX@b;n8Lnn^lY~ zjX}(klRw$2t;oV zDt7(iU?=wnHUw@x56sYhy1OFHP=lr)e3vM{i&&~^0z_k6zdqx=r E0HfqrFaQ7m diff --git a/Yi.RuoYi.Vue3/src/api/system/user.js b/Yi.RuoYi.Vue3/src/api/system/user.js index bf3f580e..d930f452 100644 --- a/Yi.RuoYi.Vue3/src/api/system/user.js +++ b/Yi.RuoYi.Vue3/src/api/system/user.js @@ -69,7 +69,7 @@ export function changeUserStatus(userId, isDel) { // 查询用户个人信息 export function getUserProfile() { return request({ - url: '/account/getUserAllInfo', + url: '/account', method: 'get' }) } @@ -77,9 +77,9 @@ export function getUserProfile() { // 修改用户个人信息 export function updateUserProfile(data) { return request({ - url: '/user/UpdateProfile', + url: `/user/profile`, method: 'put', - data: { user: data } + data: data }) } diff --git a/Yi.RuoYi.Vue3/src/utils/request.js b/Yi.RuoYi.Vue3/src/utils/request.js index 7903a0a4..29dfbe0b 100644 --- a/Yi.RuoYi.Vue3/src/utils/request.js +++ b/Yi.RuoYi.Vue3/src/utils/request.js @@ -74,14 +74,11 @@ service.interceptors.request.use(config => { // 响应拦截器 service.interceptors.response.use(res => { - // // 未设置状态码则默认成功状态 - // const code = res.data.code || 200; - // // 获取错误信息 - // const msg = errorCode[code] || res.data.message || errorCode['default'] - - const code=200; - const msg="成功"; - + // 未设置状态码则默认成功状态 + const code = res.data.code || 200; + // 获取错误信息 + const msg = errorCode[code] || res.data.message || errorCode['default'] + // 二进制数据则直接返回 if(res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer'){ return res