From 358dee1262d9abf8e6ec37cfce2dcce104166870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Tue, 19 Oct 2021 11:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9t4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SwaggerDoc.xml | 6 +++++ .../Yi.Framework.ApiMicroservice/YIDB.db | Bin 65536 -> 65536 bytes .../Yi.Framework.Interface/T4Iservice.tt | 5 ++-- .../Yi.Framework.Model/T4DataContext.tt | 5 ++-- .../Yi.Framework.Service/MenuService.cs | 3 --- .../Yi.Framework.Service/MouldService.cs | 2 -- .../Yi.Framework.Service/RoleService.cs | 4 --- .../Yi.Framework.Service/T4Service.cs | 8 +++--- .../Yi.Framework.Service/T4Service.tt | 7 +++--- Yi.Vue/src/api/userApi.js | 6 +++++ Yi.Vue/src/views/AdmUser.vue | 23 ++++++++++-------- 11 files changed, 39 insertions(+), 30 deletions(-) diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml index b1bf5f4c..c66eed0d 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml @@ -168,5 +168,11 @@ + + + 根据http上下文的用户得到该用户有哪些角色 + + + diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db index c5e78f306af2571c085471e654124020dfb6e706..f084e71bbfc4f2793b42572ec571c0ae6734dd82 100644 GIT binary patch delta 521 zcmW+zO=}cE5bc_-o}Qk;c{8pCf`=>-rh}-6KOiW2G{lQPK+uB+LCoHAS#RD%CU>tM z6oe5x3Bd&q@u0G>sB1O}s0kWHGzxxz*7T)bSMln-uBv{Y`+a_}xk$d*T0Gp z+Cr3dnzDGD9_{)}%^Wup3%x9{WF)fVx#`08i zVfh|+@I@Jn75-ocTNvX9#!Y$ZDe5=34pd4hOUAI(jv`IkxfHv?AGQ2FyvGRZSZ~S` zPf(BUOdSz^LME~?JEF)kJLmRcPg$%HK4Sx~@EhBBiM6KeKEyebX(G=i6{y%)fzp^* zpfF&k$yLTkmK#xyUBQWze2VX)I3RqI{|@mE&+rQaS;BpswM?yI7O>(pU}T`wySeA+ZiSJ~)9;V*vTqf9fwBwXP3d9Ek_ Q_80Bwk#4&ptK|g$0krOHk^lez delta 459 zcmW-dJ4*vW6oqGY?(FWYxM$ZFq>3Oc!Ac8zHMWv8{tx>!@fV295AY8N3fo!)MJqv3 z62xds@PQbg_y8ZEGt-=JigV}QbLw@f*J-O;;aT3ROpJ?cU`7Yai+P&#qNtb+u;OTe z@ldbS#`2}w1`RXDe6$&U@PQ}Xp@(*!&hA5>t&U_;2+pNPo>1HqTqqSef6Mycaf22f zaFM4|JJ7B5vB`kA^$VXA=blHTlo~V>0gf4N@rX;D;@eCf=jr%17AO*2r7|#EQYn3d zL`pI!kdy|oBxM{4g+}8DZ|0{xhA;GSfHwAUf-4hk6Z1ZC#nZ?kQSJ`&uVW&8#{!XK zETs*>3(g#eHd2O?4jQF=y73yXRYP4mJQo?tIykb`J;%Cyxf?ZY>N7Oa&y(&h<`^T> wOJqgaYh~cnw@T#Rb`x2H+v20c@QY8p;2ziLxT4ppq&t5@iS>KJsV7X+|3g|`g#Z8m diff --git a/Yi.Framework/Yi.Framework.Interface/T4Iservice.tt b/Yi.Framework/Yi.Framework.Interface/T4Iservice.tt index 5dc74831..8e402816 100644 --- a/Yi.Framework/Yi.Framework.Interface/T4Iservice.tt +++ b/Yi.Framework/Yi.Framework.Interface/T4Iservice.tt @@ -6,8 +6,9 @@ <#@ import namespace="System.Collections.Generic" #> <#@ output extension=".cs" #> <# - - DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\"); + string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径 + string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\"); + DirectoryInfo dir = new DirectoryInfo(dirPath); FileInfo[] finfo = dir.GetFiles(); string filenames = string.Empty; List filenameList = new List(); diff --git a/Yi.Framework/Yi.Framework.Model/T4DataContext.tt b/Yi.Framework/Yi.Framework.Model/T4DataContext.tt index c41c4ba3..ecc01244 100644 --- a/Yi.Framework/Yi.Framework.Model/T4DataContext.tt +++ b/Yi.Framework/Yi.Framework.Model/T4DataContext.tt @@ -6,8 +6,9 @@ <#@ import namespace="System.Collections.Generic" #> <#@ output extension=".cs" #> <# - - DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\"); + string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径 + string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\"); + DirectoryInfo dir = new DirectoryInfo(dirPath); FileInfo[] finfo = dir.GetFiles(); string filenames = string.Empty; List filenameList = new List(); diff --git a/Yi.Framework/Yi.Framework.Service/MenuService.cs b/Yi.Framework/Yi.Framework.Service/MenuService.cs index 33285967..0da06e45 100644 --- a/Yi.Framework/Yi.Framework.Service/MenuService.cs +++ b/Yi.Framework/Yi.Framework.Service/MenuService.cs @@ -11,9 +11,6 @@ namespace Yi.Framework.Service { public partial class MenuService:BaseService, IMenuService { - public MenuService(DbContext Db) : base(Db) { } - - public async Task AddChildrenMenu(menu _menu, menu _children) { var menu_data = await _Db.Set().Include(u => u.children).Where(u => u.id == _menu.id).FirstOrDefaultAsync(); diff --git a/Yi.Framework/Yi.Framework.Service/MouldService.cs b/Yi.Framework/Yi.Framework.Service/MouldService.cs index 9fc6ebc6..ec2ff045 100644 --- a/Yi.Framework/Yi.Framework.Service/MouldService.cs +++ b/Yi.Framework/Yi.Framework.Service/MouldService.cs @@ -11,8 +11,6 @@ namespace Yi.Framework.Service { public partial class MouldService:BaseService, IMouldService { - public MouldService(DbContext Db) : base(Db) { } - public async Task DelListByUpdateAsync(List _ids) { var mouldList =await GetEntitiesAsync(u => _ids.Contains(u.id)); diff --git a/Yi.Framework/Yi.Framework.Service/RoleService.cs b/Yi.Framework/Yi.Framework.Service/RoleService.cs index 68f15d3e..d2e46348 100644 --- a/Yi.Framework/Yi.Framework.Service/RoleService.cs +++ b/Yi.Framework/Yi.Framework.Service/RoleService.cs @@ -11,10 +11,6 @@ namespace Yi.Framework.Service { public partial class RoleService:BaseService, IRoleService { - public RoleService(DbContext Db):base(Db) - { - } - public async Task DelListByUpdateAsync(List _ids) { var userList = await GetEntitiesAsync(u=>_ids.Contains(u.id)); diff --git a/Yi.Framework/Yi.Framework.Service/T4Service.cs b/Yi.Framework/Yi.Framework.Service/T4Service.cs index 00858584..65210424 100644 --- a/Yi.Framework/Yi.Framework.Service/T4Service.cs +++ b/Yi.Framework/Yi.Framework.Service/T4Service.cs @@ -12,21 +12,21 @@ namespace Yi.Framework.Service public partial class MenuService:BaseService,IMenuService { - //public MenuService(DbContext Db):base(Db){ } + public MenuService(DbContext Db):base(Db){ } } public partial class MouldService:BaseService,IMouldService { - //public MouldService(DbContext Db):base(Db){ } + public MouldService(DbContext Db):base(Db){ } } public partial class RoleService:BaseService,IRoleService { - //public RoleService(DbContext Db):base(Db){ } + public RoleService(DbContext Db):base(Db){ } } public partial class UserService:BaseService,IUserService { - //public UserService(DbContext Db):base(Db){ } + public UserService(DbContext Db):base(Db){ } } } diff --git a/Yi.Framework/Yi.Framework.Service/T4Service.tt b/Yi.Framework/Yi.Framework.Service/T4Service.tt index 5becaf0f..7cb13a84 100644 --- a/Yi.Framework/Yi.Framework.Service/T4Service.tt +++ b/Yi.Framework/Yi.Framework.Service/T4Service.tt @@ -6,8 +6,9 @@ <#@ import namespace="System.Collections.Generic" #> <#@ output extension=".cs" #> <# - - DirectoryInfo dir = new DirectoryInfo(@"D:\YiFramework\Yi\Yi.Framework\Yi.Framework.Model\Models\"); + string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径 + string dirPath= Path.Combine(solutionsPath,@"Yi.Framework.Model\Models\"); + DirectoryInfo dir = new DirectoryInfo(dirPath); FileInfo[] finfo = dir.GetFiles(); string filenames = string.Empty; List filenameList = new List(); @@ -37,7 +38,7 @@ namespace Yi.Framework.Service public partial class <#= fn #>Service:BaseService<<#= k #>>,I<#= fn #>Service { - //public <#= fn #>Service(DbContext Db):base(Db){ } + public <#= fn #>Service(DbContext Db):base(Db){ } } <# } #> } diff --git a/Yi.Vue/src/api/userApi.js b/Yi.Vue/src/api/userApi.js index 48e22061..6ca7e20d 100644 --- a/Yi.Vue/src/api/userApi.js +++ b/Yi.Vue/src/api/userApi.js @@ -7,4 +7,10 @@ export default { data: { "ids1": userIds, "ids2": roleIds } }) }, + GetRolesByUser() { + return myaxios({ + url: '/User/GetRolesByUser', + method: 'get' + }) + } } \ No newline at end of file diff --git a/Yi.Vue/src/views/AdmUser.vue b/Yi.Vue/src/views/AdmUser.vue index 4f96cb80..531e79e8 100644 --- a/Yi.Vue/src/views/AdmUser.vue +++ b/Yi.Vue/src/views/AdmUser.vue @@ -1,9 +1,9 @@