修改登录失败处理
This commit is contained in:
parent
fe2f73b5a2
commit
dd0d6603a7
@ -4,7 +4,9 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
@ -86,6 +88,10 @@ func (c *Caller) GetLoginInfo(body []byte) (*LoginInfo, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
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() }()
|
defer func() { _ = resp.Body.Close() }()
|
||||||
|
|
||||||
var loginInfo LoginInfo
|
var loginInfo LoginInfo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user