🎇 delete useless cookieJar

pull/548/head
微凉 2021-11-15 19:06:44 +08:00
parent c03646dedf
commit 74d86f8cc4
1 changed files with 2 additions and 4 deletions

View File

@ -14,9 +14,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"golang.org/x/net/publicsuffix"
mathRand "math/rand" mathRand "math/rand"
"net/http/cookiejar"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strconv" "strconv"
@ -245,9 +243,9 @@ type LoginResp struct {
func (c Cloud189) Login(account *model.Account) error { func (c Cloud189) Login(account *model.Account) error {
client, ok := client189Map[account.Name] client, ok := client189Map[account.Name]
if !ok { if !ok {
cookieJar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List}) //cookieJar, _ := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
client = resty.New() client = resty.New()
client.SetCookieJar(cookieJar) //client.SetCookieJar(cookieJar)
client.SetRetryCount(3) client.SetRetryCount(3)
} }
url := "https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=https%3A%2F%2Fcloud.189.cn%2Fmain.action" url := "https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=https%3A%2F%2Fcloud.189.cn%2Fmain.action"