MCPcopy Index your code
hub / github.com/FloatTech/AnimeAPI / LoginRedirect

Function LoginRedirect

qzone/api.go:93–122  ·  view source on GitHub ↗

LoginRedirect 登录成功回调

(redirectURL string)

Source from the content-addressed store, hash-verified

91
92// LoginRedirect 登录成功回调
93func LoginRedirect(redirectURL string) (cookie string, err error) {
94 client := &http.Client{
95 CheckRedirect: func(req *http.Request, via []*http.Request) error {
96 return http.ErrUseLastResponse
97 },
98 }
99 u, err := url.Parse(redirectURL)
100 if err != nil {
101 return
102 }
103 values, err := url.ParseQuery(u.RawQuery)
104 if err != nil {
105 return
106 }
107 redirectReq, err := http.NewRequest("GET", fmt.Sprintf(checkSigURL, values["uin"][0], values["ptsigx"][0]), nil)
108 if err != nil {
109 return
110 }
111 redirectResp, err := client.Do(redirectReq)
112 if err != nil {
113 return
114 }
115 defer redirectResp.Body.Close()
116 for _, v := range redirectResp.Cookies() {
117 if v.Value != "" {
118 cookie += v.Name + "=" + v.Value + ";"
119 }
120 }
121 return
122}
123
124// Manager qq空间信息管理
125type Manager struct {

Callers 1

TestLoginFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestLoginFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…