From 3fe2997fdf0e07af7630b48164f0b4029da5a727 Mon Sep 17 00:00:00 2001 From: qydysky Date: Mon, 4 Jan 2021 10:49:28 +0800 Subject: [PATCH] =?utf8?q?get=5Fcookie=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- F/api.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/F/api.go b/F/api.go index 1d2f3de..c898e21 100644 --- a/F/api.go +++ b/F/api.go @@ -1,6 +1,7 @@ package F import ( + "sync" "time" "fmt" "os" @@ -586,8 +587,14 @@ func (i *api) Get_Version() { } } +type cookie_lock_item struct{ + sync.RWMutex +} +var cookies_lock = new(cookie_lock_item) func Get_cookie() { if api_limit.TO() {return}//超额请求阻塞,超时将取消 + cookies_lock.Lock() + defer cookies_lock.Unlock() apilog := apilog.Base_add(`获取Cookie`) var img_url string @@ -679,7 +686,7 @@ func Get_cookie() { return } else if !v { if v,ok := p.Json().GetValFromS(res, "message").(string);ok { - apilog.L(`W: `,`登录中`,v) + apilog.L(`W: `,`登录中`,v,max_try,`s`) } continue } else { -- 2.39.2