From 7c255f383a7e5055b2e25c9cdb2abfe9b45daad0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com>
Date: Wed, 27 Oct 2021 18:01:09 +0800
Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=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/MenuController.cs | 43 ++++--------
.../Controllers/RoleController.cs | 12 ++--
.../Controllers/UserController.cs | 69 +++++--------------
.../Yi.Framework.Service/UserService.cs | 2 +-
Yi.Vue/src/api/menuApi.js | 4 +-
Yi.Vue/src/api/userApi.js | 14 ++--
6 files changed, 48 insertions(+), 96 deletions(-)
diff --git a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs
index 8d464936..c377a2f7 100644
--- a/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs
+++ b/Yi.Framework/Yi.Framework.ApiMicroservice/Controllers/MenuController.cs
@@ -25,11 +25,13 @@ namespace Yi.Framework.ApiMicroservice.Controllers
_menuService = menuService;
_userService =userService;
}
+ ///
+ /// 这个是要递归的,但是要过滤掉删除的,所以,可以写一个通用过滤掉删除的方法
+ ///
+ ///
[HttpGet]
- public async Task GetMenu()
- {
-
- return Result.Success().SetData(await _menuService.GetTopMenu());
+ public async Task GetMenuInMould()
+ {
}
///
@@ -59,44 +61,26 @@ namespace Yi.Framework.ApiMicroservice.Controllers
///
/// 增
+ /// 现在,top菜单只允许为一个
///
///
///
[HttpPost]
- public async Task AddMenu(menu _menu)
+ public async Task AddTopMenu(menu _menu)
{
- _menu.is_top = (short)Common.Enum.TopFlagEnum.Top;
- await _menuService.AddAsync(_menu);
- return Result.Success();
}
///
/// 给一个菜单设置一个接口,Id1为菜单id,Id2为接口id
+ /// 用于给菜单设置接口
///
///
///
[HttpPost]
public async Task SetMouldByMenu(IdDto idDto)
{
- if (await _menuService.SetMouldByMenu(idDto.id2,idDto.id1))
- {
- return Result.Success();
- }
- return Result.Error();
}
- ///
- /// 得到该用户有哪些菜单,关联mould
- ///
- ///
- [HttpGet]
- public async Task GetMenuByUser()
- {
- var _user = this.HttpContext.GetCurrentUserInfo();
- var menuList= await _userService.GetMenusByUser(_user);
- return Result.Success().SetData(menuList);
-
- }
///
/// 给一个菜单添加子节点(注意:添加,不是覆盖)
@@ -106,19 +90,16 @@ namespace Yi.Framework.ApiMicroservice.Controllers
[HttpPost]
public async Task AddChildrenMenu(ChildrenDto