Commit 5fc75492 authored by co_dengxiongwen's avatar co_dengxiongwen

接口调整

parent b0f184b0
diff a/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java b/microservice-admin/src/main/java/com/devplatform/admin/modules/sys/controller/SysLoginController.java (rejected hunks)
@@ -135,7 +135,6 @@
}
user.setRoleIdList(roleIdList);
String jwtToken = null;
- user.setSysSystem(sysSystem);
try {
jwtToken =
JwtUtil.createJwt("longingJWT", JwtUtil.generalSubject(user), 1000 * 60 * 60 * 24 * 7);
......@@ -16,22 +16,11 @@ import com.devplatform.common.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.*;
/**
* 系统菜单
......@@ -54,34 +43,12 @@ public class SysMenuController extends AbstractController {
@GetMapping("/nav")
public R nav(String stationId) {
List<Map<String, Object>> menuList =
sysMenuService.getUserMenuList(getUserId(), stationId, null);
sysMenuService.getUserMenuList(getUserId(), stationId);
List<Map<String, Object>> nav = sysMenuService.getNav(getUserId(), stationId);
Set<String> permissions = shiroService.getUserPermissions(getUserId());
return R.ok().put("menuList", menuList).put("permissions", permissions).put("nav", nav);
}
/** 导航菜单 */
@ApiOperation(value = "站点子系统获取导航菜单", notes = "站点子系统获取导航菜单")
@GetMapping("/nav1")
public R nav1(String stationId) {
List<Map<String, Object>> menuList =
sysMenuService.getUserMenuList(getUserId(), stationId, "1");
for (Map<String, Object> map1 : menuList) {
ArrayList<Map<String, Object>> list = (ArrayList<Map<String, Object>>) map1.get("list");
Iterator<Map<String, Object>> iterator = list.iterator();
while (iterator.hasNext()) {
Map<String, Object> next = iterator.next();
if ("/sys/takeover".equals(String.valueOf(next.get("path")))) {
iterator.remove();
break;
}
}
}
List<Map<String, Object>> nav = sysMenuService.getNav("1", stationId);
Set<String> permissions = shiroService.getUserPermissions("1");
return R.ok().put("menuList", menuList).put("permissions", permissions).put("nav", nav);
}
/** 所有菜单列表 */
@ApiOperation(value = "根据条件获取分页数据列表", notes = "根据条件获取分页数据列表")
@ApiImplicitParam(
......
......@@ -42,10 +42,9 @@ public interface SysMenuService extends MyBaseService<SysMenuEntity> {
* 获取用户菜单列表
* @param userId
* @param stationId
* @param isActive
* @return
*/
List<Map<String, Object>> getUserMenuList(String userId, String stationId, String isActive);
List<Map<String, Object>> getUserMenuList(String userId, String stationId);
/**
* 删除
......
......@@ -53,19 +53,14 @@ public class SysMenuServiceImpl extends MyBaseServiceImpl<SysMenuDao, SysMenuEnt
@Override
public List<Map<String, Object>> getUserMenuList(
String userId, String stationId, String isActive) {
String userId, String stationId) {
List<Map<String, Object>> list;
// 系统管理员,拥有所有权限
if (Constant.SUPER_ADMIN.equals(userId)) {
list = baseMapper.getAllMenuListByUserId(null, stationId);
} else {
if (isActive != null) {
// 子系统查询
list = baseMapper.getAllMenuListByUserId1(userId);
} else {
// 站点查询
list = baseMapper.getAllMenuListByUserId(userId, stationId);
}
}
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
// 生成树结构
......
......@@ -28,12 +28,11 @@
<if test="stationId != null and stationId != ''">
AND me.station_id = #{stationId}
</if>
AND me.type = 2
-- AND me.type = 2
</select>
<select id="getAllMenuListByUserId" resultType="java.util.Map">
SELECT DISTINCT sm.menu_id AS menuId, sm.parent_id AS parentId, sm.name,sm.name AS title,sm.url, sm.url AS path,
sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status, sm.sys_sign
AS sysSign
sm.perms, sm.type, sm.icon, sm.order_num AS orderNum, sm.is_system_menu AS isSystemMenu, sm.status
FROM sys_menu sm
LEFT JOIN sys_role_menu srm ON sm.menu_id = srm.menu_id
LEFT JOIN sys_user_role sur ON srm.role_id = sur.role_id
......@@ -61,9 +60,7 @@
sm.icon,
sm.order_num AS orderNum,
sm.is_system_menu AS isSystemMenu,
sm.status,
sm.sys_sign
AS sysSign
sm.status
FROM sys_menu sm
LEFT JOIN rt_sys_role_menu srm ON sm.menu_id = srm.menu_id AND srm.byx1 = '2'
LEFT JOIN rt_sys_user_role sur ON srm.role_id = sur.role_id
......
......@@ -16,7 +16,7 @@ eureka:
healthcheck:
enabled: true
serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka
defaultZone: http://user:password123@eureka:8761/eureka
instance:
lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12
......
......@@ -41,6 +41,7 @@ spring:
async:
request-timeout: 60000
redis:
# host: 10.20.72.35
host: 47.94.207.62
port: 6379
password:
......@@ -62,6 +63,9 @@ spring:
url: jdbc:mysql://47.94.207.62:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
username: root
password: superAdmin&321
# url: jdbc:mysql://10.20.72.31:3306/energy?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&allowMultiQueries=true&serverTimezone=GMT%2B8&useSSL=false
# username: root
# password: root
initialSize: 5
minIdle: 0
maxActive: 1000
......@@ -88,7 +92,7 @@ eureka:
healthcheck:
enabled: false
serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka
defaultZone: http://user:password123@eureka:8761/eureka
instance:
lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12
......
......@@ -17,8 +17,8 @@ eureka:
healthcheck:
enabled: true
serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka
# defaultZone: http://user:password123@eureka:8761/eureka
# defaultZone: http://user:password123@eureka:8762/eureka
defaultZone: http://user:password123@eureka:8761/eureka
# defaultZone: http://user:password123@172.19.0.1:8761/eureka
instance:
lease-renewal-interval-in-seconds: 4
......
......@@ -5,7 +5,7 @@ security:
name: user
password: password123
server:
port: 8762
port: 8761
eureka:
client:
register-with-eureka: false
......
......@@ -100,7 +100,7 @@ eureka:
fetch-registry: true
registry-fetch-interval-seconds: 8
serviceUrl:
defaultZone: http://user:password123@eureka:8762/eureka
defaultZone: http://user:password123@eureka:8761/eureka
instance:
lease-renewal-interval-in-seconds: 4
lease-expiration-duration-in-seconds: 12
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment