chore: fix typos (#2122)
* refactor: fix typos * Update help.go Co-authored-by: Noah Hsu <i@nn.ci>
This commit is contained in:
@ -146,16 +146,16 @@ func IsNumber(str string) bool {
|
||||
|
||||
var findFromReg = regexp.MustCompile(`data : '(.+?)'`) // 查找from字符串
|
||||
|
||||
// 解析html中的from
|
||||
// 解析html中的form
|
||||
func htmlFormToMap(html string) (map[string]string, error) {
|
||||
froms := findFromReg.FindStringSubmatch(html)
|
||||
if len(froms) != 2 {
|
||||
forms := findFromReg.FindStringSubmatch(html)
|
||||
if len(forms) != 2 {
|
||||
return nil, fmt.Errorf("not find file sgin")
|
||||
}
|
||||
return fromToMap(froms[1]), nil
|
||||
return formToMap(forms[1]), nil
|
||||
}
|
||||
|
||||
func fromToMap(from string) map[string]string {
|
||||
func formToMap(from string) map[string]string {
|
||||
var param = make(map[string]string)
|
||||
for _, kv := range strings.Split(from, "&") {
|
||||
kv := strings.SplitN(kv, "=", 2)[:2]
|
||||
|
@ -119,7 +119,7 @@ func (ca *CookieAuth) getSPCookie(conf *SuccessResponse) (CookieResponse, error)
|
||||
Jar: jar,
|
||||
}
|
||||
|
||||
// Send the previously aquired Token as a Post parameter
|
||||
// Send the previously acquired Token as a Post parameter
|
||||
if _, err = client.Post(u.String(), "text/xml", strings.NewReader(conf.Succ.Token)); err != nil {
|
||||
return CookieResponse{}, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user