update
This commit is contained in:
@@ -65,6 +65,8 @@ services:
|
|||||||
- "28080:8080"
|
- "28080:8080"
|
||||||
networks:
|
networks:
|
||||||
- physical-boot
|
- physical-boot
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
# physical-kkfileview:
|
# physical-kkfileview:
|
||||||
# restart: on-failure
|
# restart: on-failure
|
||||||
# container_name: physical-kkfileview
|
# container_name: physical-kkfileview
|
||||||
@@ -83,22 +85,22 @@ services:
|
|||||||
- physical-boot
|
- physical-boot
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
physical-crawler:
|
# physical-crawler:
|
||||||
container_name: physical-crawler
|
# container_name: physical-crawler
|
||||||
restart: on-failure
|
# restart: on-failure
|
||||||
depends_on:
|
# depends_on:
|
||||||
- physical-mysql
|
# - physical-mysql
|
||||||
- physical-minio
|
# - physical-minio
|
||||||
image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
|
# image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
|
||||||
networks:
|
# networks:
|
||||||
- physical-boot
|
# - physical-boot
|
||||||
ports:
|
# ports:
|
||||||
- "25000:5000"
|
# - "25000:5000"
|
||||||
environment:
|
# environment:
|
||||||
- FLASK_ENV=production
|
# - FLASK_ENV=production
|
||||||
- PYTHON-UNBUFFERED=1 # 禁用 Python 输出缓冲
|
# - PYTHON-UNBUFFERED=1 # 禁用 Python 输出缓冲
|
||||||
volumes:
|
# volumes:
|
||||||
- ./crawler_files:/app/downloaded_files
|
# - ./crawler_files:/app/downloaded_files
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
physical-boot:
|
physical-boot:
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ services:
|
|||||||
- 28080:8080
|
- 28080:8080
|
||||||
networks:
|
networks:
|
||||||
- physical-boot
|
- physical-boot
|
||||||
|
volumes:
|
||||||
|
- ./logs:/app/logs
|
||||||
# physical-kkfileview:
|
# physical-kkfileview:
|
||||||
# restart: on-failure
|
# restart: on-failure
|
||||||
# container_name: physical-kkfileview
|
# container_name: physical-kkfileview
|
||||||
@@ -83,20 +85,20 @@ services:
|
|||||||
- physical-boot
|
- physical-boot
|
||||||
ports:
|
ports:
|
||||||
- 8005:80
|
- 8005:80
|
||||||
physical-crawler:
|
# physical-crawler:
|
||||||
container_name: physical-crawler
|
# container_name: physical-crawler
|
||||||
restart: on-failure
|
# restart: on-failure
|
||||||
depends_on:
|
# depends_on:
|
||||||
- physical-mysql
|
# - physical-mysql
|
||||||
- physical-minio
|
# - physical-minio
|
||||||
image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
|
# image: registry.cn-shanghai.aliyuncs.com/physical/physical-crawler
|
||||||
ports:
|
# ports:
|
||||||
- "25000:5000"
|
# - "25000:5000"
|
||||||
environment:
|
# environment:
|
||||||
- FLASK_ENV=production
|
# - FLASK_ENV=production
|
||||||
- PYTHONUNBUFFERED=1 # 禁用 Python 输出缓冲
|
# - PYTHONUNBUFFERED=1 # 禁用 Python 输出缓冲
|
||||||
volumes:
|
# volumes:
|
||||||
- ./crawler_files:/app/downloaded_files
|
# - ./crawler_files:/app/downloaded_files
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
physical-boot:
|
physical-boot:
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ spring:
|
|||||||
# flyway配置
|
# flyway配置
|
||||||
flyway:
|
flyway:
|
||||||
# 是否启用flyway
|
# 是否启用flyway
|
||||||
enabled: true
|
enabled: false
|
||||||
# 编码格式,默认UTF-8
|
# 编码格式,默认UTF-8
|
||||||
encoding: UTF-8
|
encoding: UTF-8
|
||||||
# 迁移sql脚本文件存放路径,官方默认db/migration
|
# 迁移sql脚本文件存放路径,官方默认db/migration
|
||||||
@@ -129,7 +129,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: false
|
||||||
loginUsername: admin
|
loginUsername: admin
|
||||||
loginPassword: 123456
|
loginPassword: 123456
|
||||||
allow:
|
allow:
|
||||||
@@ -237,13 +237,6 @@ jeecg:
|
|||||||
secretKey: ??
|
secretKey: ??
|
||||||
endpoint: oss-cn-beijing.aliyuncs.com
|
endpoint: oss-cn-beijing.aliyuncs.com
|
||||||
bucketName: jeecgdev
|
bucketName: jeecgdev
|
||||||
# ElasticSearch 6设置
|
|
||||||
elasticsearch:
|
|
||||||
cluster-name: jeecg-ES
|
|
||||||
cluster-nodes: 127.0.0.1:9200
|
|
||||||
check-enabled: false
|
|
||||||
# 在线预览文件服务器地址配置
|
|
||||||
file-view-domain: http://fileview.jeecg.com
|
|
||||||
# minio文件上传
|
# minio文件上传
|
||||||
minio:
|
minio:
|
||||||
minio_url: http://192.168.50.100:29000
|
minio_url: http://192.168.50.100:29000
|
||||||
@@ -251,27 +244,6 @@ jeecg:
|
|||||||
minio_name: root
|
minio_name: root
|
||||||
minio_pass: 12345678
|
minio_pass: 12345678
|
||||||
bucketName: physical
|
bucketName: physical
|
||||||
#大屏报表参数设置
|
|
||||||
jmreport:
|
|
||||||
#多租户模式,默认值为空(created:按照创建人隔离、tenant:按照租户隔离) (v1.6.2+ 新增)
|
|
||||||
saasMode:
|
|
||||||
# 平台上线安全配置(v1.6.2+ 新增)
|
|
||||||
firewall:
|
|
||||||
# 数据源安全 (开启后,不允许使用平台数据源、SQL解析加签并且不允许查询数据库)
|
|
||||||
dataSourceSafe: false
|
|
||||||
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
|
||||||
lowCodeMode: dev
|
|
||||||
#xxl-job配置
|
|
||||||
xxljob:
|
|
||||||
enabled: false
|
|
||||||
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
|
||||||
appname: ${spring.application.name}
|
|
||||||
accessToken: ''
|
|
||||||
address: 127.0.0.1:30007
|
|
||||||
ip: 127.0.0.1
|
|
||||||
port: 30007
|
|
||||||
logPath: logs/jeecg/job/jobhandler/
|
|
||||||
logRetentionDays: 30
|
|
||||||
#分布式锁配置
|
#分布式锁配置
|
||||||
redisson:
|
redisson:
|
||||||
address: 127.0.0.1:6379
|
address: 127.0.0.1:6379
|
||||||
@@ -292,9 +264,6 @@ jeecg:
|
|||||||
# proxy:
|
# proxy:
|
||||||
# host: "http://127.0.0.1"
|
# host: "http://127.0.0.1"
|
||||||
# port: "7890"
|
# port: "7890"
|
||||||
#cas单点登录
|
|
||||||
cas:
|
|
||||||
prefixUrl: http://cas.example.org:8443/cas
|
|
||||||
#Mybatis输出sql日志
|
#Mybatis输出sql日志
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
@@ -312,7 +281,7 @@ knife4j:
|
|||||||
password: jeecg1314
|
password: jeecg1314
|
||||||
#第三方登录
|
#第三方登录
|
||||||
justauth:
|
justauth:
|
||||||
enabled: true
|
enabled: false
|
||||||
type:
|
type:
|
||||||
GITHUB:
|
GITHUB:
|
||||||
client-id: ??
|
client-id: ??
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ spring:
|
|||||||
datasource:
|
datasource:
|
||||||
druid:
|
druid:
|
||||||
stat-view-servlet:
|
stat-view-servlet:
|
||||||
enabled: true
|
enabled: false
|
||||||
loginUsername: admin
|
loginUsername: admin
|
||||||
loginPassword: 123456
|
loginPassword: 123456
|
||||||
allow:
|
allow:
|
||||||
@@ -239,13 +239,6 @@ jeecg:
|
|||||||
endpoint: oss-cn-beijing.aliyuncs.com
|
endpoint: oss-cn-beijing.aliyuncs.com
|
||||||
bucketName: jeecgdev
|
bucketName: jeecgdev
|
||||||
staticDomain: https://static.jeecg.com
|
staticDomain: https://static.jeecg.com
|
||||||
# ElasticSearch 设置
|
|
||||||
elasticsearch:
|
|
||||||
cluster-name: jeecg-ES
|
|
||||||
cluster-nodes: 127.0.0.1:9200
|
|
||||||
check-enabled: true
|
|
||||||
# 在线预览文件服务器地址配置
|
|
||||||
file-view-domain: http://fileview.jeecg.com
|
|
||||||
# minio文件上传
|
# minio文件上传
|
||||||
minio:
|
minio:
|
||||||
minio_url: http://physical-minio:9000
|
minio_url: http://physical-minio:9000
|
||||||
@@ -263,26 +256,12 @@ jeecg:
|
|||||||
dataSourceSafe: true
|
dataSourceSafe: true
|
||||||
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
# 低代码开发模式(dev:开发模式,prod:发布模式—关闭在线报表设计功能,分配角色admin、lowdeveloper可以放开限制)
|
||||||
lowCodeMode: prod
|
lowCodeMode: prod
|
||||||
#xxl-job配置
|
|
||||||
xxljob:
|
|
||||||
enabled: false
|
|
||||||
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
|
|
||||||
appname: ${spring.application.name}
|
|
||||||
accessToken: ''
|
|
||||||
address: 127.0.0.1:30007
|
|
||||||
ip: 127.0.0.1
|
|
||||||
port: 30007
|
|
||||||
logPath: logs/jeecg/job/jobhandler/
|
|
||||||
logRetentionDays: 30
|
|
||||||
#分布式锁配置
|
#分布式锁配置
|
||||||
redisson:
|
redisson:
|
||||||
address: physical-redis:6379
|
address: physical-redis:6379
|
||||||
password:
|
password:
|
||||||
type: STANDALONE
|
type: STANDALONE
|
||||||
enabled: true
|
enabled: true
|
||||||
#cas单点登录
|
|
||||||
cas:
|
|
||||||
prefixUrl: http://cas.example.org:8443/cas
|
|
||||||
#Mybatis输出sql日志
|
#Mybatis输出sql日志
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
@@ -300,7 +279,7 @@ knife4j:
|
|||||||
password: jeecg1314
|
password: jeecg1314
|
||||||
#第三方登录
|
#第三方登录
|
||||||
justauth:
|
justauth:
|
||||||
enabled: true
|
enabled: false
|
||||||
type:
|
type:
|
||||||
GITHUB:
|
GITHUB:
|
||||||
client-id: ??
|
client-id: ??
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: jeecg-system
|
name: physical-boot
|
||||||
profiles:
|
profiles:
|
||||||
active: '@profile.name@'
|
active: '@profile.name@'
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration debug="false">
|
<configuration debug="false">
|
||||||
<!--定义日志文件的存储地址 -->
|
<!--定义日志文件的存储地址 -->
|
||||||
<property name="LOG_HOME" value="../logs" />
|
<property name="LOG_HOME" value="./logs" />
|
||||||
|
|
||||||
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
||||||
<!-- 控制台输出 -->
|
<!-- 控制台输出 -->
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!--日志文件输出的文件名 -->
|
<!--日志文件输出的文件名 -->
|
||||||
<FileNamePattern>${LOG_HOME}/jeecgboot-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
<FileNamePattern>${LOG_HOME}/physical-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
<!--日志文件保留天数 -->
|
<!--日志文件保留天数 -->
|
||||||
<MaxHistory>30</MaxHistory>
|
<MaxHistory>30</MaxHistory>
|
||||||
<maxFileSize>10MB</maxFileSize>
|
<maxFileSize>10MB</maxFileSize>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE_HTML" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!--日志文件输出的文件名 -->
|
<!--日志文件输出的文件名 -->
|
||||||
<FileNamePattern>${LOG_HOME}/jeecgboot-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
|
<FileNamePattern>${LOG_HOME}/physical-%d{yyyy-MM-dd}.%i.html</FileNamePattern>
|
||||||
<!--日志文件保留天数 -->
|
<!--日志文件保留天数 -->
|
||||||
<MaxHistory>30</MaxHistory>
|
<MaxHistory>30</MaxHistory>
|
||||||
<MaxFileSize>10MB</MaxFileSize>
|
<MaxFileSize>10MB</MaxFileSize>
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
package org.jeecg.modules.cas.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.jeecg.common.api.vo.Result;
|
|
||||||
import org.jeecg.common.constant.CommonConstant;
|
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
|
||||||
import org.jeecg.common.util.RedisUtil;
|
|
||||||
import org.jeecg.modules.cas.util.CasServiceUtil;
|
|
||||||
import org.jeecg.modules.cas.util.XmlUtils;
|
|
||||||
import org.jeecg.modules.system.entity.SysDepart;
|
|
||||||
import org.jeecg.modules.system.entity.SysUser;
|
|
||||||
import org.jeecg.modules.system.service.ISysDepartService;
|
|
||||||
import org.jeecg.modules.system.service.ISysUserService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* CAS单点登录客户端登录认证
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @Author zhoujf
|
|
||||||
* @since 2018-12-20
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/sys/cas/client")
|
|
||||||
public class CasClientController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService sysUserService;
|
|
||||||
@Autowired
|
|
||||||
private ISysDepartService sysDepartService;
|
|
||||||
@Autowired
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
@Value("${cas.prefixUrl}")
|
|
||||||
private String prefixUrl;
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/validateLogin")
|
|
||||||
public Object validateLogin(@RequestParam(name = "ticket") String ticket,
|
|
||||||
@RequestParam(name = "service") String service,
|
|
||||||
HttpServletRequest request,
|
|
||||||
HttpServletResponse response) throws Exception {
|
|
||||||
Result<JSONObject> result = new Result<JSONObject>();
|
|
||||||
log.info("Rest api login.");
|
|
||||||
try {
|
|
||||||
String validateUrl = prefixUrl + "/p3/serviceValidate";
|
|
||||||
String res = CasServiceUtil.getStValidate(validateUrl, ticket, service);
|
|
||||||
log.info("res." + res);
|
|
||||||
final String error = XmlUtils.getTextForElement(res, "authenticationFailure");
|
|
||||||
if (StringUtils.isNotEmpty(error)) {
|
|
||||||
throw new Exception(error);
|
|
||||||
}
|
|
||||||
final String principal = XmlUtils.getTextForElement(res, "user");
|
|
||||||
if (StringUtils.isEmpty(principal)) {
|
|
||||||
throw new Exception("No principal was found in the response from the CAS server.");
|
|
||||||
}
|
|
||||||
log.info("-------token----username---" + principal);
|
|
||||||
//1. 校验用户是否有效
|
|
||||||
SysUser sysUser = sysUserService.getUserByName(principal);
|
|
||||||
result = sysUserService.checkUserIsEffective(sysUser);
|
|
||||||
if (!result.isSuccess()) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
String token = JwtUtil.sign(sysUser.getUsername(), sysUser.getPassword());
|
|
||||||
// 设置超时时间
|
|
||||||
redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
|
|
||||||
redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME * 2 / 1000);
|
|
||||||
|
|
||||||
//获取用户部门信息
|
|
||||||
JSONObject obj = new JSONObject();
|
|
||||||
List<SysDepart> departs = sysDepartService.queryUserDeparts(sysUser.getId());
|
|
||||||
obj.put("departs", departs);
|
|
||||||
if (departs == null || departs.size() == 0) {
|
|
||||||
obj.put("multi_depart", 0);
|
|
||||||
} else if (departs.size() == 1) {
|
|
||||||
sysUserService.updateUserDepart(principal, departs.get(0).getOrgCode(), null);
|
|
||||||
obj.put("multi_depart", 1);
|
|
||||||
} else {
|
|
||||||
obj.put("multi_depart", 2);
|
|
||||||
}
|
|
||||||
obj.put("token", token);
|
|
||||||
obj.put("userInfo", sysUser);
|
|
||||||
result.setResult(obj);
|
|
||||||
result.success("登录成功");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
//e.printStackTrace();
|
|
||||||
result.error500(e.getMessage());
|
|
||||||
}
|
|
||||||
return new HttpEntity<>(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -47,12 +47,6 @@ public class SysCommentController extends JeecgController<SysComment, ISysCommen
|
|||||||
private ISysBaseAPI sysBaseAPI;
|
private ISysBaseAPI sysBaseAPI;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 在线预览文件地址
|
|
||||||
*/
|
|
||||||
@Value("${jeecg.file-view-domain}/onlinePreview")
|
|
||||||
private String onlinePreviewDomain;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询评论+文件
|
* 查询评论+文件
|
||||||
*
|
*
|
||||||
@@ -143,15 +137,7 @@ public class SysCommentController extends JeecgController<SysComment, ISysCommen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件预览的地址
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/getFileViewDomain")
|
|
||||||
public Result<String> getFileViewDomain() {
|
|
||||||
return Result.OK(onlinePreviewDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user