File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ func (t *Providers) SetDB(db *gorm.DB) {
35
35
}
36
36
37
37
func (t * Providers ) Init () {
38
- errorRecord = app .Config ("telescope.error_record" , false )
38
+ v := app .GetConfigAny ("telescope.error_record" )
39
+ if b , ok := v .(* bool ); ok && * b {
40
+ errorRecord = true
41
+ }
39
42
if (app .IsDebug () || errorRecord ) && ! t .init {
40
43
t .init = true
41
44
t .Register ()
@@ -74,9 +77,11 @@ type telescopeHook struct {
74
77
isOnlyRoute bool
75
78
}
76
79
77
- // TODO 修正不声明config就报错后,可取消这func,改为依赖注入
78
80
func (t * telescopeHook ) Init () {
79
- t .isOnlyRoute = app .Config ("telescope.is_only_route" , false )
81
+ v := app .GetConfigAny ("telescope.is_only_route" )
82
+ if b , ok := v .(* bool ); ok && * b {
83
+ t .isOnlyRoute = true
84
+ }
80
85
}
81
86
82
87
func (t * telescopeHook ) Levels () []logrus.Level {
You can’t perform that action at this time.
0 commit comments