From bef90ef4d7ede8a8765101bd37e9ace608ad60ab Mon Sep 17 00:00:00 2001 From: Mmx233 Date: Wed, 2 Mar 2022 22:49:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=9B=B4=E5=A4=9Adeb?= =?UTF-8?q?ug=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 ++-- util/log.go | 1 + v1/login.go | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b817a6c..2a48f96 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -.idea/ -Config.json +/.idea/ +/Config* /GoBuilder.bat /autoLogin* /BitSrunLoginGo* \ No newline at end of file diff --git a/util/log.go b/util/log.go index 333a9aa..44b5853 100644 --- a/util/log.go +++ b/util/log.go @@ -82,6 +82,7 @@ func (c *loG) Fatal(a ...interface{}) { func (c *loG) CatchRecover() { if e := recover(); e != nil { + c.Debug("发生恐慌") var buf [4096]byte c.Fatal(e, "\n", string(buf[:runtime.Stack(buf[:], false)])) } diff --git a/v1/login.go b/v1/login.go index 6058e8a..19ca19c 100644 --- a/v1/login.go +++ b/v1/login.go @@ -25,6 +25,7 @@ func Login(c *srunTransfer.Login) error { util.Log.Info("Step1: 正在获取客户端ip") { + util.Log.Debug("GET ", G.UrlLoginPage) if _, body, e := tool.HTTP.GetString(&tool.GetRequest{ Url: G.UrlLoginPage, Redirect: true, @@ -38,6 +39,7 @@ func Login(c *srunTransfer.Login) error { util.Log.Info("Step2: 正在获取Token") { + util.Log.Debug("GET ", G.UrlGetChallengeApi) if _, data, e := tool.HTTP.GetString(&tool.GetRequest{ Url: G.UrlGetChallengeApi, Query: map[string]interface{}{ @@ -76,6 +78,7 @@ func Login(c *srunTransfer.Login) error { chkstr += G.Token + G.EncryptedInfo G.EncryptedChkstr = util.Sha1(chkstr) + util.Log.Debug("GET ", G.UrlLoginApi) if _, res, e := tool.HTTP.GetString(&tool.GetRequest{ Url: G.UrlLoginApi, Query: map[string]interface{}{ @@ -102,9 +105,7 @@ func Login(c *srunTransfer.Login) error { return e } else { util.Log.Info("登录结果: " + G.LoginResult) - if c.Debug { - util.Log.Info(res) - } + util.Log.Debug(res) } if G.LoginResult != "ok" {