MCPcopy
hub / github.com/eatmoreapple/openwechat / BuildGetLoginUUIDRequest

Method BuildGetLoginUUIDRequest

mode.go:78–97  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

76type desktopMode struct{}
77
78func (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
99func (n desktopMode) BuildGetLoginInfoRequest(ctx context.Context, path string) (*http.Request, error) {
100 req, err := http.NewRequestWithContext(ctx, http.MethodGet, path, nil)

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected