- 后端:修改配置文件,指向服务器
- 增加 .gitattributes ,解决 github 识别项目错误问题
This commit is contained in:
@@ -50,7 +50,6 @@ public class AdminController {
|
||||
public CommonResult<List<AdminMenuTreeNodeVO>> menuResourceTree() {
|
||||
List<ResourceBO> resources = resourceService.getResourcesByTypeAndRoleIds(ResourceConstants.TYPE_MENU, AdminSecurityContextHolder.getContext().getRoleIds());
|
||||
// 创建 AdminMenuTreeNodeVO Map
|
||||
// Map<Integer, AdminMenuTreeNodeVO> treeNodeMap = resources.stream().collect(Collectors.toMap(ResourceBO::getId, ResourceConvert.INSTANCE::convert));
|
||||
Map<Integer, AdminMenuTreeNodeVO> treeNodeMap = new LinkedHashMap<>(); // 使用 LinkedHashMap 的原因,是为了排序 。实际也可以用 Stream API ,就是太丑了。
|
||||
resources.stream().sorted(Comparator.comparing(ResourceBO::getSort)).forEach(resourceBO -> treeNodeMap.put(resourceBO.getId(), ResourceConvert.INSTANCE.convert(resourceBO)));
|
||||
// 处理父子关系
|
||||
|
||||
@@ -2,7 +2,7 @@ spring:
|
||||
boot:
|
||||
admin:
|
||||
client:
|
||||
enabled: true
|
||||
enabled: false # 暂时不用了
|
||||
url: http://127.0.0.1:18097
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ management:
|
||||
exposure:
|
||||
include: "*"
|
||||
server:
|
||||
port: 19083 # 配置独立端口。而该端口,不使用 nginx 对外暴露,从而不配置安全认证。也就是说,内网环境可访问,外网环境不可访问。当然,这么做的前提是,认为内网安全。
|
||||
port: 19083 # 配置独立端口。而该端口,不使用 nginx 对外暴露,从而不配置安全认证。也就是说,内网环境可访问,外网环境不可访问。当然,这么做的前提是,认为内网安全。
|
||||
|
||||
@@ -7,24 +7,24 @@ package cn.iocoder.mall.admin.sdk.context;
|
||||
*/
|
||||
public class AdminSecurityContextHolder {
|
||||
|
||||
private static final ThreadLocal<AdminSecurityContext> securityContext = new ThreadLocal<AdminSecurityContext>();
|
||||
private static final ThreadLocal<AdminSecurityContext> SECURITY_CONTEXT = new ThreadLocal<>();
|
||||
|
||||
public static void setContext(AdminSecurityContext context) {
|
||||
securityContext.set(context);
|
||||
SECURITY_CONTEXT.set(context);
|
||||
}
|
||||
|
||||
public static AdminSecurityContext getContext() {
|
||||
AdminSecurityContext ctx = securityContext.get();
|
||||
AdminSecurityContext ctx = SECURITY_CONTEXT.get();
|
||||
// 为空时,设置一个空的进去
|
||||
if (ctx == null) {
|
||||
ctx = new AdminSecurityContext(null, null);
|
||||
securityContext.set(ctx);
|
||||
SECURITY_CONTEXT.set(ctx);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
securityContext.remove();
|
||||
SECURITY_CONTEXT.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,4 +34,7 @@ public class AdminDO extends DeletableDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
// TODO 芋艿,最后登陆时间、最后登陆 IP
|
||||
// TODO 芋艿,登陆日志
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
spring:
|
||||
# datasource
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.88.14:3306/mall_admin?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
username: root
|
||||
password: ${MALL_MYSQL_PASSWORD}
|
||||
@@ -24,6 +24,7 @@ dubbo:
|
||||
scan:
|
||||
base-packages: cn.iocoder.mall.admin.service
|
||||
provider:
|
||||
filter: -exception
|
||||
AdminAccessLogService:
|
||||
version: 1.0.0
|
||||
AdminService:
|
||||
|
||||
Reference in New Issue
Block a user