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 b2c233d8..4d20b1b8 100644 Binary files a/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db and b/Yi.Framework/Yi.Framework.ApiMicroservice/YIDB.db differ 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 @@