From 8a0022d75b03edc6070fea46b55c9b63ef533281 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 24 二月 2025 19:05:26 +0800
Subject: [PATCH] 修改管理后台bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
index 10e4b2f..288c608 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/api/SystemUserController.java
@@ -17,6 +17,7 @@
 import com.panzhihua.sangeshenbian.warpper.LoginVo;
 import com.panzhihua.sangeshenbian.warpper.SystemUserList;
 import com.panzhihua.sangeshenbian.warpper.SystemUserListVo;
+import com.panzhihua.sangeshenbian.warpper.TokenVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
@@ -65,7 +66,7 @@
 	@PostMapping("/login")
 	@ApiOperation(value = "登录", tags = {"三个身边后台-登录"})
 	@OperLog(operModul = "三个身边后台",operType = 0,businessType = "登录")
-	public R<LoginReturnVO> login(@RequestBody LoginVo vo){
+	public R<TokenVo> login(@RequestBody LoginVo vo){
 		String key = "login:" + vo.getPhone();
 		Integer size = (Integer) redisTemplate.opsForValue().get(key);
 		if(null != size && max_err.equals(size)){
@@ -92,7 +93,18 @@
 		//创建token
 		R<LoginReturnVO> reult = tokenService.loginThreeAround(systemUser.getId());
 		redisTemplate.delete(key);
-		return reult;
+		LoginReturnVO loginReturnVO = reult.getData();
+		TokenVo tokenVo = new TokenVo();
+		BeanUtils.copyProperties(loginReturnVO, tokenVo);
+		List<SystemRoleMenu> list = systemRoleMenuService.list(new LambdaQueryWrapper<SystemRoleMenu>().eq(SystemRoleMenu::getSystemRoleId, systemUser.getSystemRoleId()));
+		List<Integer> collect = list.stream().map(SystemRoleMenu::getSystemMenuId).collect(Collectors.toList());
+		Set<String> collect1 = new HashSet<>();
+		if(collect.size() > 0){
+			List<SystemMenu> systemMenus = systemMenuService.listByIds(collect);
+			collect1 = systemMenus.stream().map(SystemMenu::getUrl).collect(Collectors.toSet());
+		}
+		tokenVo.setMenu(collect1);
+		return R.ok(tokenVo);
 	}
 	
 	

--
Gitblit v1.7.1