improve: error log when login fails
This commit is contained in:
@@ -31,7 +31,7 @@ func Guardian() {
|
|||||||
if global.Config.Settings.Basic.Interfaces == "" { //单网卡
|
if global.Config.Settings.Basic.Interfaces == "" { //单网卡
|
||||||
e := Login(nil)
|
e := Login(nil)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
log.Errorln("登陆失败: ", e)
|
log.Errorln("错误: ", e)
|
||||||
}
|
}
|
||||||
} else { //多网卡
|
} else { //多网卡
|
||||||
interfaces, e := util.GetInterfaceAddr()
|
interfaces, e := util.GetInterfaceAddr()
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package BitSrun
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/Mmx233/BitSrunLoginGo/global"
|
"github.com/Mmx233/BitSrunLoginGo/global"
|
||||||
"github.com/Mmx233/BitSrunLoginGo/util"
|
"github.com/Mmx233/BitSrunLoginGo/util"
|
||||||
@@ -119,9 +118,11 @@ func Login(c *srunTransfer.Login) error {
|
|||||||
}
|
}
|
||||||
G.LoginResult = result.(string)
|
G.LoginResult = result.(string)
|
||||||
|
|
||||||
log.Infoln("登录结果: " + G.LoginResult)
|
if G.LoginResult == "ok" {
|
||||||
if G.LoginResult != "ok" {
|
log.Infoln("已成功登录~")
|
||||||
return errors.New(G.LoginResult)
|
} else {
|
||||||
|
log.Errorln("登陆失败: ", e)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user