| 76 | type desktopMode struct{} |
| 77 | |
| 78 | func (n desktopMode) BuildGetLoginUUIDRequest(ctx context.Context) (*http.Request, error) { |
| 79 | path, err := url.Parse(jslogin) |
| 80 | if err != nil { |
| 81 | return nil, err |
| 82 | } |
| 83 | params := url.Values{} |
| 84 | redirectUrl, err := url.Parse(webwxnewloginpage) |
| 85 | if err != nil { |
| 86 | return nil, err |
| 87 | } |
| 88 | p := url.Values{"mod": {"desktop"}} |
| 89 | redirectUrl.RawQuery = p.Encode() |
| 90 | params.Add("redirect_uri", redirectUrl.String()) |
| 91 | params.Add("appid", appId) |
| 92 | params.Add("fun", "new") |
| 93 | params.Add("lang", "zh_CN") |
| 94 | params.Add("_", strconv.FormatInt(time.Now().UnixNano()/1e6, 10)) |
| 95 | path.RawQuery = params.Encode() |
| 96 | return http.NewRequestWithContext(ctx, http.MethodGet, path.String(), nil) |
| 97 | } |
| 98 | |
| 99 | func (n desktopMode) BuildGetLoginInfoRequest(ctx context.Context, path string) (*http.Request, error) { |
| 100 | req, err := http.NewRequestWithContext(ctx, http.MethodGet, path, nil) |