修改登录失败处理
This commit is contained in:
parent
fe2f73b5a2
commit
dd0d6603a7
@ -4,7 +4,9 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
)
|
||||
@ -86,6 +88,10 @@ func (c *Caller) GetLoginInfo(body []byte) (*LoginInfo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// 判断是否重定向
|
||||
if resp.StatusCode != http.StatusMovedPermanently {
|
||||
return nil, fmt.Errorf("%w: try to login with Desktop Mode", ErrForbidden)
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
var loginInfo LoginInfo
|
||||
|
Loading…
x
Reference in New Issue
Block a user