feat: 添加更多debug日志
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,5 @@
|
|||||||
.idea/
|
/.idea/
|
||||||
Config.json
|
/Config*
|
||||||
/GoBuilder.bat
|
/GoBuilder.bat
|
||||||
/autoLogin*
|
/autoLogin*
|
||||||
/BitSrunLoginGo*
|
/BitSrunLoginGo*
|
||||||
@@ -82,6 +82,7 @@ func (c *loG) Fatal(a ...interface{}) {
|
|||||||
|
|
||||||
func (c *loG) CatchRecover() {
|
func (c *loG) CatchRecover() {
|
||||||
if e := recover(); e != nil {
|
if e := recover(); e != nil {
|
||||||
|
c.Debug("发生恐慌")
|
||||||
var buf [4096]byte
|
var buf [4096]byte
|
||||||
c.Fatal(e, "\n", string(buf[:runtime.Stack(buf[:], false)]))
|
c.Fatal(e, "\n", string(buf[:runtime.Stack(buf[:], false)]))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ func Login(c *srunTransfer.Login) error {
|
|||||||
|
|
||||||
util.Log.Info("Step1: 正在获取客户端ip")
|
util.Log.Info("Step1: 正在获取客户端ip")
|
||||||
{
|
{
|
||||||
|
util.Log.Debug("GET ", G.UrlLoginPage)
|
||||||
if _, body, e := tool.HTTP.GetString(&tool.GetRequest{
|
if _, body, e := tool.HTTP.GetString(&tool.GetRequest{
|
||||||
Url: G.UrlLoginPage,
|
Url: G.UrlLoginPage,
|
||||||
Redirect: true,
|
Redirect: true,
|
||||||
@@ -38,6 +39,7 @@ func Login(c *srunTransfer.Login) error {
|
|||||||
|
|
||||||
util.Log.Info("Step2: 正在获取Token")
|
util.Log.Info("Step2: 正在获取Token")
|
||||||
{
|
{
|
||||||
|
util.Log.Debug("GET ", G.UrlGetChallengeApi)
|
||||||
if _, data, e := tool.HTTP.GetString(&tool.GetRequest{
|
if _, data, e := tool.HTTP.GetString(&tool.GetRequest{
|
||||||
Url: G.UrlGetChallengeApi,
|
Url: G.UrlGetChallengeApi,
|
||||||
Query: map[string]interface{}{
|
Query: map[string]interface{}{
|
||||||
@@ -76,6 +78,7 @@ func Login(c *srunTransfer.Login) error {
|
|||||||
chkstr += G.Token + G.EncryptedInfo
|
chkstr += G.Token + G.EncryptedInfo
|
||||||
G.EncryptedChkstr = util.Sha1(chkstr)
|
G.EncryptedChkstr = util.Sha1(chkstr)
|
||||||
|
|
||||||
|
util.Log.Debug("GET ", G.UrlLoginApi)
|
||||||
if _, res, e := tool.HTTP.GetString(&tool.GetRequest{
|
if _, res, e := tool.HTTP.GetString(&tool.GetRequest{
|
||||||
Url: G.UrlLoginApi,
|
Url: G.UrlLoginApi,
|
||||||
Query: map[string]interface{}{
|
Query: map[string]interface{}{
|
||||||
@@ -102,9 +105,7 @@ func Login(c *srunTransfer.Login) error {
|
|||||||
return e
|
return e
|
||||||
} else {
|
} else {
|
||||||
util.Log.Info("登录结果: " + G.LoginResult)
|
util.Log.Info("登录结果: " + G.LoginResult)
|
||||||
if c.Debug {
|
util.Log.Debug(res)
|
||||||
util.Log.Info(res)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if G.LoginResult != "ok" {
|
if G.LoginResult != "ok" {
|
||||||
|
|||||||
Reference in New Issue
Block a user