提交 c14423ca 编写于 作者: Skyeye云's avatar Skyeye云

自动化部署

上级 2860daf0
......@@ -24,12 +24,8 @@ layui.config({
menuBoxTemplate = $("#menuBoxTemplate").html(),
modelTemplate = $("#modelTemplate").html();
MiniSite.JsLoader.load("../../json/main.js", function(){
$.cookie('sysMainMation', "", {path: '/' });
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
});
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
loadUserMation();
//加载用户信息
......
......@@ -18,12 +18,8 @@ layui.config({
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
MiniSite.JsLoader.load(reqBasePath + "json/main.js", function(){
$.cookie('sysMainMation', "", {path: '/' });
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
});
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
var rowId = GetUrlParam("id");
AjaxPostUtil.request({url:reqBasePath + "fileconsole019", params: {rowId: rowId}, type:'json', callback:function(json){
......
......@@ -20,13 +20,9 @@ layui.config({
tab2: {load: false, initMethod: myAccessList} // 我的获取
};
MiniSite.JsLoader.load(reqBasePath + "json/main.js", function(){
$.cookie('sysMainMation', "", {path: '/' });
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
});
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
element.on('tab(jobDetail)', function(obj){
var mation = tabTable["tab" + obj.index];
if(!isNull(mation)){
......
......@@ -10,16 +10,11 @@ layui.config({
var $ = layui.$,
form = layui.form;
form.render();
var rowId = GetUrlParam("id");
MiniSite.JsLoader.load(reqBasePath + "json/main.js", function(){
$.cookie('sysMainMation', "", {path: '/' });
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
});
$(document).attr("title", sysMainMation.mationTitle);
$(".sys-logo").html(sysMainMation.mationTitle);
// 隐藏遮罩层
$(".fileconsole-mask").hide();
......
......@@ -63,8 +63,30 @@
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>
<dependencyManagement>
<!--SpringBoot整合Spring Cloud-->
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!--SpringBoot整合Spring Cloud Alibaba-->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2.1.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- SpringBoot相关配置 -->
......@@ -90,6 +112,30 @@
</exclusions>
</dependency>
<!-- 配置中心注册到nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- 服务注册到nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- SpringCloud alibaba sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- 服务调用 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!--热更新,热加载,不用每次重启启动 -->
<dependency>
<groupId>org.springframework.boot</groupId>
......
......@@ -6,10 +6,14 @@ package com;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@EnableScheduling
@ComponentScan(basePackages = {"com.skyeye"})
@EnableDiscoveryClient
@EnableFeignClients
public class SkyEyeWebApplication {
public static void main(String[] args) {
......
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* @ClassName: ConfigProperties
* @Description:
* @author: skyeye云系列--卫志强
* @date: 2022/3/9 20:20
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
@Component
@ConfigurationProperties(prefix = "skyeye.configuation")
public class ConfigProperties {
private Map<String,String> config;
public Map<String, String> getConfig() {
return config;
}
public void setConfig(Map<String, String> config) {
this.config = config;
}
}
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @ClassName: ConfigrationController
* @Description: 获取配置信息返回给前台
* @author: skyeye云系列--卫志强
* @date: 2022/3/9 20:01
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
@RestController
public class ConfigrationController {
@Autowired
private ConfigProperties configProperties;
@GetMapping(value = "/getConfigRation")
public Map<String, String> getConfigRation(){
return configProperties.getConfig();
}
}
......@@ -36,6 +36,8 @@ public class SessionFilter implements Filter {
public static final String LOGIN_PAGE = "/tpl/index/login.html";
public static final String WEB_API_URL = "http://localhost:8081/";
public static final String CONFIG_URL = "configRation.json";
@Override
public void init(FilterConfig filterConfig) throws ServletException {
......@@ -66,12 +68,17 @@ public class SessionFilter implements Filter {
return;
}
if(CONFIG_URL.equals(url.replaceAll("/", ""))){
request.getRequestDispatcher("/getConfigRation").forward(request, response);
return;
}
// 系统资源过滤/转换请求过滤
if(resourceFiltering(url) || requestFiltering(request, url)){
chain.doFilter(request, response);
return;
}
return;
}
......
server:
servlet:
context-path: /
port: 8080
tomcat:
max-connections: 20000
max-threads: 1000
uri-encoding: utf-8
spring:
banner:
location: banner.txt
resources:
static-locations: classpath:/template/
thymeleaf:
mode: LEGACYHTML5
cache: false
# 热部署
devtools:
freemarker:
cache: false
restart:
additional-paths: src/main/resources
enabled: true
log-condition-evaluation-delta: false
\ No newline at end of file
server:
port: 8080
spring:
application:
name: skyeye-web-${spring.profiles.active} # 服务名
profiles:
active: dev
cloud:
nacos:
discovery:
server-addr: localhost:9000 # 配置服务注册nacos地址
config:
# 指定nacos server的地址
server-addr: localhost:9000
file-extension: yml
namespace: dev
\ No newline at end of file
......@@ -27,6 +27,26 @@ var customerJS = {
"shopUtil": "../../assets/lib/layui/customer/shopUtil.js", // 商城模块相关工具
};
//系统基础信息
var sysMainMation = {}; // 系统基础信息json
if(isNull(localStorage.getItem("sysMainMation"))){
jsGetJsonFile("../../configRation.json", function(data){
sysMainMation = data;
localStorage.setItem("sysMainMation", JSON.stringify(sysMainMation));
});
}else{
sysMainMation = JSON.parse(unescape(localStorage.getItem("sysMainMation")));
}
var skyeyeVersion = sysMainMation.skyeyeVersion;
// 文件路径
var fileBasePath = sysMainMation.fileBasePath;
// 接口请求地址
var reqBasePath = sysMainMation.reqBasePath; // 总项目
var shopBasePath = sysMainMation.shopBasePath; // 商城项目
var webSocketPath = sysMainMation.webSocketPath;//聊天socket-开发
// 编辑加载自定义的js文件
layui.each(customerJS, function(key, jsPath){
if(jsPath.lastIndexOf(".js") >=0){
......
......@@ -4,21 +4,9 @@
* MIT Licensed
*/
var serviceIp = "127.0.0.1";
// 文件路径
var fileBasePath = "http://" + serviceIp + ":8081/";
// 接口请求地址
var reqBasePath = "http://" + serviceIp + ":8081/"; // 总项目
var shopBasePath = "http://" + serviceIp + ":8082/"; // 商城项目
var basePath = "../../assets/lib/winui/";
var maskReqStr = '<div class="mask-req-str"><div class="cent"><i class="fa fa-spin fa-spinner fa-fw"></i><br><br><font>数据请求中</font></div></div>';
var skyeyeVersion = "1.0.0-beta";
var webSocketPath = "";//聊天socket-开发
var returnCitySN = {"cip": "", "cid": "CN", "cname": "CHINA"};//ip json
var sysMainMation = '';//系统基础信息json
var addrs = '';//地址json
//文件类型
var imageType = ["png", "jpg", "xbm", "bmp", "webp", "jpeg", "svgz", "git", "ico", "tiff", "svg", "jiff", "pjpeg", "pjp", "tif", "gif"];
......@@ -90,17 +78,6 @@ MiniSite.JsLoader={
}
};
//系统基础信息
if(isNull(getCookie("sysMainMation"))){
MiniSite.JsLoader.load("../../json/main.js", function(){
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
});
}else{
sysMainMation = JSON.parse(unescape(getCookie("sysMainMation")));
}
webSocketPath = sysMainMation.webSocketPath;
// 用户中英文类型
var languageType = isNull(getCookie("languageType")) ? "zh" : getCookie("languageType");
// 系统中英文
......
......@@ -10,10 +10,10 @@ layui.config({
layui.use(['form'], function (form) {
var $ = layui.$;
form.render();
MiniSite.JsLoader.load("../../json/main.js", function(){
$.cookie('sysMainMation', "", {path: '/' });
setCookie('sysMainMation', JSON.stringify(sysMainMation), 'd30');
jsGetJsonFile("../../configRation.json", function(data){
sysMainMation = data;
localStorage.setItem("sysMainMation", JSON.stringify(sysMainMation));
});
// 主动发起多语言文件加载
......
sysMainMation = {
"mationTitle": "skyeye云办公 作者:卫志强", // 系统名称
"messageSysUrl": "http://" + serviceIp + ":8084/", // 消息系统页面请求地址
"webSocketPath": "ws://" + serviceIp + ":8081/", // 聊天socket-开发
"homePagePath": "http://" + serviceIp + ":8080/", // 前台工程访问地址
"copyright": 'skyeye云系列 | Copyright © 2018~2022 | author:卫志强 | 开源版地址:<a href="https://gitee.com/doc_wei01/skyeye" target="_blank">skyeye</a>' // 版权信息
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册