Compare commits
9 Commits
c31b925c93
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 154878d3f0 | |||
| fa887867c5 | |||
| 0d304414ac | |||
| 07530d7a06 | |||
| eaf4872cd7 | |||
| 25d5aa16a8 | |||
| 86f7035c80 | |||
| c790836506 | |||
| f775bfee53 |
@@ -0,0 +1,27 @@
|
||||
package cn.code.nl.gateway;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.servlet.ServletUtils;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 默认 Controller
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class DefaultController {
|
||||
|
||||
/**
|
||||
* 测试接口:打印 query、header、body
|
||||
*/
|
||||
@RequestMapping(value = { "/gateway/h" })
|
||||
@PermitAll
|
||||
public CommonResult<String> test() {
|
||||
return CommonResult.success("欢迎进入诺力项目网关");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,10 +7,10 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
@@ -2,6 +2,7 @@ spring:
|
||||
application:
|
||||
name: gateway-server
|
||||
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
|
||||
@@ -230,6 +231,7 @@ spring:
|
||||
|
||||
server:
|
||||
port: 48080
|
||||
address: 0.0.0.0
|
||||
|
||||
logging:
|
||||
file:
|
||||
|
||||
@@ -7,12 +7,12 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -7,12 +7,12 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -7,12 +7,12 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
FROM eclipse-temurin:21-jre
|
||||
|
||||
## 创建目录,并使用它作为工作目录
|
||||
RUN mkdir -p /nl-module-lms-server
|
||||
WORKDIR /nl-module-lms-server
|
||||
RUN mkdir -p /nl-module-system-server
|
||||
WORKDIR /nl-module-system-server
|
||||
## 将后端项目的 Jar 文件,复制到镜像中
|
||||
COPY ./target/nl-module-lms-server.jar app.jar
|
||||
COPY ./target/nl-module-system-server.jar app.jar
|
||||
|
||||
## 设置 TZ 时区
|
||||
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||||
|
||||
@@ -4,15 +4,15 @@ spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 192.168.81.193:8848 # Nacos 服务器地址
|
||||
username: # Nacos 账号
|
||||
password: # Nacos 密码
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -36,7 +36,7 @@ spring:
|
||||
time-to-live: 1h # 设置过期时间为 1 小时
|
||||
|
||||
server:
|
||||
port: 48083
|
||||
port: 48081
|
||||
|
||||
logging:
|
||||
file:
|
||||
|
||||
@@ -7,12 +7,12 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.security.config.annotation.web.configurers.AuthorizeH
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false, value = "baseSecurityConfiguration")
|
||||
@Configuration(proxyBeanMethods = false, value = "wmsSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
/*
|
||||
@@ -93,7 +93,7 @@ public class SecurityConfiguration {
|
||||
|
||||
3. 遵循了项目中每个模块定义各自安全配置的标准模式
|
||||
* */
|
||||
@Bean("baseAuthorizeRequestsCustomizer")
|
||||
@Bean("wmsAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ spring:
|
||||
username: nacos
|
||||
password: nacos
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: test # 命名空间。这里使用 dev 开发环境
|
||||
namespace: e682c31c-a86b-4bbd-b655-9e19d7215b2a # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
@@ -3,7 +3,7 @@ VITE_BASE=/
|
||||
# 请求路径
|
||||
VITE_BASE_URL=http://127.0.0.1:48080
|
||||
# 接口地址
|
||||
VITE_GLOB_API_URL=http://127.0.0.1:48080/admin-api
|
||||
VITE_GLOB_API_URL=/admin-api
|
||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持S3服务
|
||||
VITE_UPLOAD_TYPE=server
|
||||
|
||||
|
||||
Reference in New Issue
Block a user