diff --git a/config/config.go b/config/config.go index 227d1ea09..c37db0e93 100755 --- a/config/config.go +++ b/config/config.go @@ -104,6 +104,11 @@ func GetConfigCached() (conf Config, err error) { return *cache.ConfigSingle, err } + // 未填写登录信息, 确保不能从公网访问 + if cache.ConfigSingle.Username == "" && cache.ConfigSingle.Password == "" { + cache.ConfigSingle.NotAllowWanAccess = true + } + // remove err cache.Err = nil return *cache.ConfigSingle, err