fix password resty api

This commit is contained in:
juzeon 2022-11-28 19:01:40 +08:00
父節點 f161616eae
當前提交 79355bab7c

查看文件

@ -2,6 +2,7 @@ package httpclient
import (
"errors"
"fmt"
"github.com/go-resty/resty/v2"
"integrity-checkin/data/dto"
"regexp"
@ -14,10 +15,8 @@ func Setup() {
Client = resty.New().SetTimeout(10 * time.Second)
}
func SDULogin(username string, password string) (*dto.SDULoginData, error) {
resp, err := Client.R().SetFormData(map[string]string{
"username": username,
"password": password,
}).Post("https://pass.sdu.edu.cn/cas/restlet/tickets")
resp, err := Client.R().SetBody(fmt.Sprintf("username=%v&password=%v", username, password)).
Post("https://pass.sdu.edu.cn/cas/restlet/tickets")
if err != nil {
return nil, err
}