合并分支 'master' 到 'dev_third_stage'

Master

查看合并请求 laws-nio/laws-weilai!73
This commit is contained in:
李雪涛
2022-07-09 19:43:04 +08:00
16 changed files with 119 additions and 92 deletions
@@ -36,3 +36,12 @@ ALTER TABLE `project_laws_inventory`
MODIFY COLUMN `design_deliverable_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设计符合性确认-交付物类型' AFTER `remark`,
MODIFY COLUMN `prehomo_deliverable_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'prehomo确认-交付物类型' AFTER `design_due_date`,
MODIFY COLUMN `verify_deliverable_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '验证符合性确认-交付物类型' AFTER `prehomo_due_date`;
-- 2022年7月9日通知标题长度 已同步正式环境
ALTER TABLE `laws_weilai`.`sys_announcement`
MODIFY COLUMN `titile` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '标题' AFTER `id`;
-- 2022年7月9日 增加配置数据 已同步正式环境
INSERT INTO `sys_config` ( `id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `config`, `config_name` )
VALUES
( '3', 'admin', '2022-07-09 18:38:23', 'admin', '2022-07-09 18:38:28', 'A01', 'http://localhost:8080', 'domianPreviewURL' );
@@ -1,76 +0,0 @@
package com.jero.config.init;
import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector;
import org.apache.coyote.http11.Http11NioProtocol;
import org.apache.tomcat.util.descriptor.web.SecurityCollection;
import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
import org.apache.tomcat.util.scan.StandardJarScanner;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Description: TomcatFactoryConfig
* @author: scott
* @date: 2021年01月25日 11:40
*/
@Configuration
public class TomcatFactoryConfig {
/**
* tomcat-embed-jasper引用后提示jar找不到的问题
*/
@Bean
public TomcatServletWebServerFactory tomcatFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
@Override
protected void postProcessContext(Context context) {
((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
}
};
factory.addConnectorCustomizers(connector -> {
connector.setProperty("relaxedPathChars", "[]{}");
connector.setProperty("relaxedQueryChars", "[]{}");
});
return factory;
}
//TODO 配置https证书 部署服务器的时候解开。
/* @Value("${server.port-https}")
private String serverPortHttp;
@Value("${server.port}")
private String serverPortHttps;
@Bean
public TomcatServletWebServerFactory tomcatFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() {
@Override
protected void postProcessContext(Context context) {
((StandardJarScanner) context.getJarScanner()).setScanManifest(false);
SecurityConstraint securityConstraint = new SecurityConstraint();
securityConstraint.setUserConstraint("CONFIDENTIAL");
SecurityCollection securityCollection = new SecurityCollection();
securityCollection.addPattern("/*");
securityConstraint.addCollection(securityCollection);
context.addConstraint(securityConstraint);
}
};
factory.addConnectorCustomizers(connector -> {
connector.setProperty("relaxedPathChars", "[]{}");
connector.setProperty("relaxedQueryChars", "[]{}");
});
factory.addAdditionalTomcatConnectors(redirectConnector());
return factory;
}
private Connector redirectConnector() {
Connector connector = new Connector(Http11NioProtocol.class.getName());
connector.setScheme("http");
connector.setPort(Integer.parseInt(serverPortHttp));
connector.setSecure(false);
connector.setRedirectPort(Integer.parseInt(serverPortHttps));
return connector;
}*/
}
@@ -4746,7 +4746,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String content = sysUser.getUsername() + " pushed " + StringUtils.join(serialNumberList, ",") + " to you. Please be reminded to check it out.";
String contentInfo = sysUser.getUsername() + " pushed " + StringUtils.join(hrefList, ",") + " to you. Please be reminded to check it out.";
String title = StringUtils.join(hrefList, ",") + "has been pushed to you, please check";
String title = StringUtils.join(serialNumberList, ",") + "has been pushed to you, please check";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
@@ -0,0 +1,65 @@
package com.jero.config;
import com.jero.modules.project.service.impl.ProjectLawsInventoryEOServiceImpl;
import lombok.Data;
import org.apache.catalina.connector.Connector;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
//@PropertySource("classpath:config/tomcat.https.properties")
@ConfigurationProperties(prefix = "jero.tomcat.https")
@Data
public class TomcatSslConnectorProperties {
@Value("${jero.path.upload}")
private String tempStoreJks;
private Integer port;
private Boolean ssl = true;
private Boolean secure = true;
private String scheme = "https";
private String keystore;
private String keystorePassword;
private String keystoreType;
//这里为了节省空间,省略了getters和setters,读者在实践的时候要加上
public void configureConnector(Connector connector) {
if (port != null) {
connector.setPort(port);
}
if (secure != null) {
connector.setSecure(secure);
}
if (scheme != null) {
connector.setScheme(scheme);
}
if (ssl != null) {
connector.setProperty("SSLEnabled", ssl.toString());
}
InputStream inputStream = ProjectLawsInventoryEOServiceImpl.class.getClassLoader().getResourceAsStream(keystore);
String keystorePath = tempStoreJks + File.separator + keystore;
File keystoreFile = new File(keystorePath);
if (!keystoreFile.exists()){
try {
FileUtils.copyInputStreamToFile(inputStream, keystoreFile);
} catch (IOException e) {
e.printStackTrace();
}
}
if (keystoreFile != null && keystoreFile.exists()) {
connector.setProperty("keystoreFile", keystorePath);
connector.setProperty("keystorePass", keystorePassword);
connector.setProperty("keystoreType", keystoreType);
}
}
}
@@ -0,0 +1,28 @@
package com.jero.config;
import org.apache.catalina.connector.Connector;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@Configuration
@EnableConfigurationProperties(TomcatSslConnectorProperties.class)
public class TomcatWebConfiguration extends WebMvcConfigurerAdapter {
@Bean
public TomcatServletWebServerFactory servletContainer(TomcatSslConnectorProperties properties) {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addAdditionalTomcatConnectors(createSslConnector(properties));
return factory;
}
private Connector createSslConnector(TomcatSslConnectorProperties properties) {
Connector connector = new Connector();
properties.configureConnector(connector);
return connector;
}
}
@@ -12,12 +12,6 @@ server:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
##配置https证书 部署服务器的时候解开。
# port-https: 8089 #自定义https端口
# ssl:
# key-store: classpath:bxxt.hzwlsoft.com.jks
# key-store-password: w933m5y1kz0xj8w
# key-store-type: JKS
management:
endpoints:
web:
@@ -209,6 +203,15 @@ jero :
exportPdfTempPath: D://opt//exportPdfTemp/
#仿宋体字体文件路径 设置
simfangFontFilePath: D://opt//simfangFontFilePath//simfang.ttf
tomcat:
https:
port: 8089
secure: true
scheme: https
ssl: true
keystore: grp.jks
keystorePassword: 501937
keystoreType: JKS
shiro:
excludeUrls: /test/jeroDemo/demo3,/test/jeroDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
#阿里云oss存储配置
+1 -1
View File
@@ -3,7 +3,7 @@
*/
window._CONFIG = {}
window._CONFIG['domianURL'] = '/jero-boot' // 路由转发 devServer
window._CONFIG['domianPreviewURL'] = localStorage.getItem('domianWebSocketURL') ? localStorage.getItem('domianWebSocketURL') : ''
window._CONFIG['domianPreviewURL'] = localStorage.getItem('domianPreviewURL') ? localStorage.getItem('domianPreviewURL') : ''
window._CONFIG['domianWebSocketURL'] = localStorage.getItem('domianWebSocketURL') ? localStorage.getItem('domianWebSocketURL') : ''
// 单点登录地址
window._CONFIG['staticDomainURL'] = window._CONFIG['domianURL'] + '/sys/common/download'
@@ -171,7 +171,7 @@
// 预览
handlePreview(file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
+1 -1
View File
@@ -267,7 +267,7 @@
},
handlePreview(file) {
if (file && file.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}
+1
View File
@@ -33,6 +33,7 @@ router.beforeEach((to, from, next) => {
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result.sysAllDictItems, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set('domianWebSocketURL', res.result.domianWebSocketURL)
Vue.ls.set('onlinePreviewDomainURL', res.result.onlinePreviewDomainURL)
Vue.ls.set('domianPreviewURL', res.result.domianPreviewURL)
store.commit('SET_TOKEN', res.result.token)
store.commit('SET_INFO', res.result.userInfo)
store.commit('SET_NAME', {
+2 -3
View File
@@ -86,6 +86,7 @@ const user = {
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set('domianWebSocketURL', result.domianWebSocketURL)
Vue.ls.set('onlinePreviewDomainURL', result.onlinePreviewDomainURL)
Vue.ls.set('domianPreviewURL', result.domianPreviewURL)
commit('SET_TOKEN', result.token)
commit('SET_INFO', userInfo)
commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
@@ -131,11 +132,9 @@ const user = {
const menuData = response.result.menu
const authData = response.result.auth
const allAuthData = response.result.allAuth
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
const onlinePreviewDomainURL = response.result.onlinePreviewDomainURL
const domianWebSocketURL = response.result.domianWebSocketURL
//Vue.ls.set(USER_AUTH,authData);
sessionStorage.setItem(USER_AUTH, JSON.stringify(authData))
sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData))
-1
View File
@@ -3,7 +3,6 @@ import Vuex from 'vuex'
import store from '@/store/'
Vue.use(Vuex)
// console.log(window._CONFIG['domianWebSocketURL'])
export default new Vuex.Store({
state: {
-1
View File
@@ -3,7 +3,6 @@ import Vuex from 'vuex'
import store from '@/store/'
Vue.use(Vuex)
// console.log(window._CONFIG['domianWebSocketURL'])
export default new Vuex.Store({
state: {
@@ -168,7 +168,7 @@
},
handlePreview(record) {
if (record && record.url) {
var fileFullUrl = `${window._CONFIG['domianWebSocketURL']}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
var fileFullUrl = `${window._CONFIG['domianPreviewURL']}/sys/common/download/${record.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileName}`
let url = `${window._CONFIG['onlinePreviewDomainURL']}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
window.open(url)
}