improve: error log when login fails

This commit is contained in:
Revincx
2022-10-16 10:46:46 +08:00
parent 9771d8143a
commit 83c46068c7
2 changed files with 6 additions and 5 deletions

View File

@@ -2,7 +2,6 @@ package BitSrun
import (
"encoding/json"
"errors"
"github.com/Mmx233/BitSrunLoginGo/global"
"github.com/Mmx233/BitSrunLoginGo/util"
@@ -119,9 +118,11 @@ func Login(c *srunTransfer.Login) error {
}
G.LoginResult = result.(string)
log.Infoln("登录结果: " + G.LoginResult)
if G.LoginResult != "ok" {
return errors.New(G.LoginResult)
if G.LoginResult == "ok" {
log.Infoln("已成功登录~")
} else {
log.Errorln("登陆失败: ", e)
return nil
}
}