Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
b47e5d4c
提交
b47e5d4c
authored
6月 25, 2022
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【新增】`yudao.error-code.enable` 错误码的开关,默认在 `local` 环境关闭自动生成错误码
上级
383ff130
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
10 行增加
和
0 行删除
+10
-0
ErrorCodeProperties.java
...yudao/framework/errorcode/config/ErrorCodeProperties.java
+4
-0
YudaoErrorCodeAutoConfiguration.java
...ork/errorcode/config/YudaoErrorCodeAutoConfiguration.java
+2
-0
application-local.yaml
...odule-infra-biz/src/main/resources/application-local.yaml
+2
-0
application-local.yaml
...dule-system-biz/src/main/resources/application-local.yaml
+2
-0
没有找到文件。
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/ErrorCodeProperties.java
浏览文件 @
b47e5d4c
...
...
@@ -17,6 +17,10 @@ import java.util.List;
@Validated
public
class
ErrorCodeProperties
{
/**
* 是否开启
*/
private
Boolean
enable
=
true
;
/**
* 错误码枚举类
*/
...
...
yudao-framework/yudao-spring-boot-starter-biz-error-code/src/main/java/cn/iocoder/yudao/framework/errorcode/config/YudaoErrorCodeAutoConfiguration.java
浏览文件 @
b47e5d4c
...
...
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoader;
import
cn.iocoder.yudao.framework.errorcode.core.loader.ErrorCodeLoaderImpl
;
import
cn.iocoder.yudao.module.system.api.errorcode.ErrorCodeApi
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* @author 芋道源码
*/
@Configuration
@ConditionalOnProperty
(
prefix
=
"yudao.error-code"
,
value
=
"enable"
,
matchIfMissing
=
true
)
// 允许使用 yudao.error-code.enable=false 禁用访问日志
@EnableConfigurationProperties
(
ErrorCodeProperties
.
class
)
@EnableScheduling
// 开启调度任务的功能,因为 ErrorCodeRemoteLoader 通过定时刷新错误码
public
class
YudaoErrorCodeAutoConfiguration
{
...
...
yudao-module-infra/yudao-module-infra-biz/src/main/resources/application-local.yaml
浏览文件 @
b47e5d4c
...
...
@@ -136,4 +136,6 @@ yudao:
-
${management.endpoints.web.base-path}/**
# 不处理 Actuator 的请求
access-log
:
# 访问日志的配置项
enable
:
false
error-code
:
# 错误码相关配置项
enable
:
false
demo
:
false
# 关闭演示模式
yudao-module-system/yudao-module-system-biz/src/main/resources/application-local.yaml
浏览文件 @
b47e5d4c
...
...
@@ -152,6 +152,8 @@ yudao:
refund-notify-url
:
http://niubi.natapp1.cc/api/pay/refund/notify
access-log
:
# 访问日志的配置项
enable
:
false
error-code
:
# 错误码相关配置项
enable
:
false
demo
:
false
# 关闭演示模式
justauth
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论