修改版本控制及nacos
This commit is contained in:
parent
e8a57e42fb
commit
b38b960882
|
|
@ -17,6 +17,19 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>2.1.0.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
<version>2021.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bns;
|
|||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
|
|
@ -12,12 +13,13 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||
*/
|
||||
@EnableScheduling
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableDiscoveryClient
|
||||
public class LdlzApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(LdlzApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 领导履职启动成功 ლ(´ڡ`ლ)゙");
|
||||
System.err.println("(♥◠‿◠)ノ゙ 领导履职启动成功 ლ(´ڡ`ლ)゙");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,33 @@
|
|||
# 数据源配置
|
||||
spring:
|
||||
application:
|
||||
name: bonus-ldlz
|
||||
cloud:
|
||||
nacos:
|
||||
# nacos.core.auth.enabled=true 开启权限验证
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery:
|
||||
# nacos地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 289db019-a290-4903-ac1a-5d341af8b272
|
||||
config:
|
||||
server-addr: 127.0.0.1:8848
|
||||
namespace: 289db019-a290-4903-ac1a-5d341af8b272
|
||||
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://120.48.23.33:3307/ldlz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ldlz
|
||||
password: E2GWTDG45FRRBSBt
|
||||
url: jdbc:mysql://127.0.0.1:3306/ldlz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: mroot
|
||||
password: bonus@admin123
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: true
|
||||
enabled: false
|
||||
url: jdbc:mysql://120.48.23.33:3307/zyry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: ldlz
|
||||
password: E2GWTDG45FRRBSBt
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ ldlz:
|
|||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
# port: 9001
|
||||
port: 8080
|
||||
port: 38080
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
|
|
@ -71,13 +71,13 @@ spring:
|
|||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 47.104.94.120
|
||||
host: 127.0.0.1
|
||||
# 端口,默认为6379
|
||||
port: 6380
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 13
|
||||
# 密码
|
||||
password: 1qazZAQ!1
|
||||
password:
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class ResourcesConfig implements WebMvcConfigurer
|
|||
CorsConfiguration config = new CorsConfiguration();
|
||||
config.setAllowCredentials(true);
|
||||
// 设置访问源地址
|
||||
config.addAllowedOriginPattern("*");
|
||||
config.addAllowedOrigin("*");
|
||||
// 设置访问源请求头
|
||||
config.addAllowedHeader("*");
|
||||
// 设置访问源请求方法
|
||||
|
|
|
|||
36
pom.xml
36
pom.xml
|
|
@ -29,21 +29,49 @@
|
|||
<poi.version>4.1.2</poi.version>
|
||||
<velocity.version>2.3</velocity.version>
|
||||
<jwt.version>0.9.1</jwt.version>
|
||||
<spring-cloud.version>Greenwich.SR1</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2.1.0.RELEASE</spring-cloud-alibaba.version>
|
||||
<spring-boot.version>2.1.1.RELEASE</spring-boot.version>
|
||||
</properties>
|
||||
|
||||
<!-- 依赖声明 -->
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringBoot的依赖配置 -->
|
||||
|
||||
<!-- SpringCloud 微服务 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba 微服务 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.plugin</groupId>
|
||||
<artifactId>spring-plugin-core</artifactId>
|
||||
<version>2.0.0.RELEASE</version>
|
||||
</dependency>
|
||||
<!-- SpringBoot 依赖配置 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-dependencies</artifactId>
|
||||
<version>${spring-boot.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- 阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
|
|
|
|||
Loading…
Reference in New Issue