27 lines
520 B
Go
27 lines
520 B
Go
package httpclient
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"likedream-goframe/internal/application/cookiejar"
|
|
"likedream-goframe/internal/utils"
|
|
"time"
|
|
|
|
"resty.dev/v3"
|
|
)
|
|
|
|
var Xuexitong = resty.New().
|
|
SetCookieJar(cookiejar.NewAllSavePersistCookieJar()).
|
|
SetRedirectPolicy(resty.FlexibleRedirectPolicy(20)).
|
|
SetTimeout(30 * time.Second).
|
|
SetTLSClientConfig(&tls.Config{
|
|
InsecureSkipVerify: true,
|
|
})
|
|
|
|
func init() {
|
|
if !utils.IsDebug() {
|
|
Xuexitong.SetDebug(false)
|
|
} else {
|
|
Xuexitong.SetProxy("http://127.0.0.1:9000")
|
|
}
|
|
}
|