mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 12:40:25 +08:00
fix: 禁用resty的日志输出
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/shirou/gopsutil/load"
|
||||
"github.com/shirou/gopsutil/mem"
|
||||
"github.com/shirou/gopsutil/net"
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/TheTNB/panel/pkg/shell"
|
||||
"github.com/TheTNB/panel/pkg/types"
|
||||
@@ -88,7 +89,10 @@ func RestartPanel() {
|
||||
|
||||
// IsChina 是否中国大陆
|
||||
func IsChina() bool {
|
||||
logger := zap.NewNop().Sugar()
|
||||
client := resty.New()
|
||||
client.SetLogger(logger)
|
||||
client.SetDisableWarn(true)
|
||||
client.SetTimeout(3 * time.Second)
|
||||
client.SetRetryCount(3)
|
||||
|
||||
@@ -106,7 +110,10 @@ func IsChina() bool {
|
||||
|
||||
// GetPublicIPv4 获取公网IPv4
|
||||
func GetPublicIPv4() (string, error) {
|
||||
logger := zap.NewNop().Sugar()
|
||||
client := resty.New()
|
||||
client.SetLogger(logger)
|
||||
client.SetDisableWarn(true)
|
||||
client.SetTimeout(3 * time.Second)
|
||||
client.SetRetryCount(3)
|
||||
client.SetTransport(&http.Transport{
|
||||
@@ -125,7 +132,10 @@ func GetPublicIPv4() (string, error) {
|
||||
|
||||
// GetPublicIPv6 获取公网IPv6
|
||||
func GetPublicIPv6() (string, error) {
|
||||
logger := zap.NewNop().Sugar()
|
||||
client := resty.New()
|
||||
client.SetLogger(logger)
|
||||
client.SetDisableWarn(true)
|
||||
client.SetTimeout(3 * time.Second)
|
||||
client.SetRetryCount(3)
|
||||
client.SetTransport(&http.Transport{
|
||||
|
||||
Reference in New Issue
Block a user