23 lines
346 B
Go
23 lines
346 B
Go
package httpclient
|
|
|
|
import (
|
|
"likedream-goframe/internal/utils"
|
|
"time"
|
|
|
|
"resty.dev/v3"
|
|
)
|
|
|
|
var Common = resty.New().
|
|
SetCookieJar(nil).
|
|
SetRetryCount(5).
|
|
SetTimeout(30*time.Second).
|
|
SetHeader("User-Agent", "likedream")
|
|
|
|
func init() {
|
|
if !utils.IsDebug() {
|
|
Common.SetDebug(false)
|
|
} else {
|
|
Common.SetProxy("http://127.0.0.1:9000")
|
|
}
|
|
}
|