From b2e8441194668806dab2608df594aa3ace116691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sat, 16 Oct 2021 14:48:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=8E=A7=E5=88=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AccountController.cs | 12 +- .../SwaggerDoc.xml | 7 + .../Yi.Framework.ApiMicroservice/YIDB.db | Bin 65536 -> 65536 bytes .../Yi.Framework.Service/RoleService.cs | 4 +- Yi.Vue/src/api/MenuApi.js | 35 +++ Yi.Vue/src/api/mouldApi.js | 10 + Yi.Vue/src/api/roleApi.js | 7 + Yi.Vue/src/components/ccTreeview.vue | 212 +++++++++++++++--- Yi.Vue/src/views/AdmMenu.vue | 19 +- Yi.Vue/src/views/AdmRoleMenu.vue | 20 +- 10 files changed, 275 insertions(+), 51 deletions(-) create mode 100644 Yi.Vue/src/api/mouldApi.js diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs index 06c7d7cf..24a4c2f8 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/AccountController.cs @@ -35,12 +35,12 @@ namespace Yi.Framework.ApiMicroservice.Controllers [HttpPost] public async Task Login(user _user) { - if (await _userService.Login(_user)) - { - _user.roles = await _userService.GetRolesByUser(_user); - var toke = MakeJwt.app(_user); - return Result.Success().SetData(new { user = new { _user.id, _user.username, _user.introduction, _user.icon, _user.nick }, toke }); - } + //if (await _userService.Login(_user)) + //{ + // _user.roles = await _userService.GetRolesByUser(_user); + // var toke = MakeJwt.app(_user); + // return Result.Success().SetData(new { user = new { _user.id, _user.username, _user.introduction, _user.icon, _user.nick }, toke }); + //} return Result.Error(); } diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml index eee596b1..b83daa02 100644 --- a/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml +++ b/Yi.Framework/Yi.Framework.ApiMicroservice/SwaggerDoc.xml @@ -66,6 +66,13 @@ + + + 给一个菜单添加子节点(注意:添加,不是覆盖) + + + + 更 diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db index b2c233d87e56f739f19854503b45862550172f91..4d20b1b8772eae74cd5d07c76345c6698d7887c5 100644 GIT binary patch delta 994 zcmZ{jOK1~O6o&7exk+=A%=}4)E^4g}NfpylwDAEhT)7g2xRtI%MM~8|l9f=BjkO}R zrLjUlkwj`Ez8h)pRq2 zzLqWB90_Fl`%bqTT0zkl@d5XdKn#1Z6A`Qj^k>NGm-M*4Pv4{y?VVN-V^3a2NtO!2tgL>^R(ae8>Q*lty>m0OCZ zp{8&|iRTOl7Ldsmc_Ua&bZBR(^((bT8s3O2YjL%?*rN zZYSfEs;ZMwPMN|O=RBVdj*hT)16hK<_>CW;&%{$a#zRbF4j=IvFEE3;w5JB9FK5MKyF|HdGUum z5SS!7Wv3w}AjL1mCq)qWGJ#hK#o5n0d|rkH8}S_rMSuD|8f7MxSt=IBsUnuf{{ifW B7JL8z delta 315 zcmZo@U})hk!$ipe>p~$O#v(dJS_aR4E!(nkMb|%uiY#tkjp>0Hoskhi=Ur? z|33e2{^|V1{QmsT{AT=`{4)IfKoy_)ytuiz7(jrLgMopKn-iJCf#5K4vm!rAqnBjtl>XmIcI5~<-iZb)kOHzwVjP$|ev#s4P z)=xE(X9TL0mjr4@Rs&W7QL$)&!lnf*3P4|+X5jzB|DFF6|68CRAM@Ykzs`S=|1{7S m>-i_2K5q$BaUNC0J^q{gSNP8ZRcz+peEzOfA|4VDpdLa diff --git a/Yi.Framework/Yi.Framework.Service/RoleService.cs b/Yi.Framework/Yi.Framework.Service/RoleService.cs index d0450289..e8dc9390 100644 --- a/Yi.Framework/Yi.Framework.Service/RoleService.cs +++ b/Yi.Framework/Yi.Framework.Service/RoleService.cs @@ -47,9 +47,9 @@ namespace Yi.Framework.Service { return false; } - var menuList = _Db.Set().Where(u => menuIds.Contains(u.id)&&u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).ToListAsync(); + var menuList = await _Db.Set().Where(u => menuIds.Contains(u.id)&&u.is_delete == (short)Common.Enum.DelFlagEnum.Normal).ToListAsync(); - role_data.menus = (ICollection)menuList; + role_data.menus =menuList; return await AddAsync(role_data); } } diff --git a/Yi.Vue/src/api/MenuApi.js b/Yi.Vue/src/api/MenuApi.js index ad489f0d..ad21a96b 100644 --- a/Yi.Vue/src/api/MenuApi.js +++ b/Yi.Vue/src/api/MenuApi.js @@ -6,4 +6,39 @@ export default { method: 'get' }) }, + addChildrenMenu(id, data) { + return myaxios({ + url: '/Menu/addChildrenMenu', + method: 'post', + data: { parentId: id, data } + }) + }, + UpdateMenu(data) { + return myaxios({ + url: '/Menu/UpdateMenu', + method: 'put', + data: data + }) + }, + DelListMenu(ids) { + return myaxios({ + url: '/Menu/DelListMenu', + method: 'delete', + data: ids + }) + }, + addMenu(data) { + return myaxios({ + url: '/Menu/addMenu', + method: 'post', + data: data + }) + }, + SetMouldByMenu(menuId, mouldId) { + return myaxios({ + url: '/Menu/SetMouldByMenu', + method: 'post', + data: { id1: menuId, id2: mouldId } + }) + } } \ No newline at end of file diff --git a/Yi.Vue/src/api/mouldApi.js b/Yi.Vue/src/api/mouldApi.js new file mode 100644 index 00000000..eefdde37 --- /dev/null +++ b/Yi.Vue/src/api/mouldApi.js @@ -0,0 +1,10 @@ +import myaxios from '@/util/myaxios' +export default { + getMould() { + return myaxios({ + url: '/Mould/GetMould', + method: 'get' + }) + } + +} \ No newline at end of file diff --git a/Yi.Vue/src/api/roleApi.js b/Yi.Vue/src/api/roleApi.js index 9969b632..599f9fb2 100644 --- a/Yi.Vue/src/api/roleApi.js +++ b/Yi.Vue/src/api/roleApi.js @@ -5,5 +5,12 @@ export default { url: '/Role/getRole', method: 'get' }) + }, + setMenuByRole(roleList, menuList) { + return myaxios({ + url: '/Role/setMenuByRole', + method: 'post', + data: { ids1: roleList, ids2: menuList } + }) } } \ No newline at end of file diff --git a/Yi.Vue/src/components/ccTreeview.vue b/Yi.Vue/src/components/ccTreeview.vue index 1cfe2189..956ecd08 100644 --- a/Yi.Vue/src/components/ccTreeview.vue +++ b/Yi.Vue/src/components/ccTreeview.vue @@ -1,37 +1,195 @@ \ No newline at end of file diff --git a/Yi.Vue/src/views/AdmMenu.vue b/Yi.Vue/src/views/AdmMenu.vue index 64241949..4c24ee8d 100644 --- a/Yi.Vue/src/views/AdmMenu.vue +++ b/Yi.Vue/src/views/AdmMenu.vue @@ -1,29 +1,18 @@ \ No newline at end of file diff --git a/Yi.Vue/src/views/AdmRoleMenu.vue b/Yi.Vue/src/views/AdmRoleMenu.vue index 8e16bb2f..0f44ba33 100644 --- a/Yi.Vue/src/views/AdmRoleMenu.vue +++ b/Yi.Vue/src/views/AdmRoleMenu.vue @@ -1,7 +1,7 @@