fix password resty api
This commit is contained in:
父節點
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
|
||||
}
|
||||
|
載入中…
x
新增問題並參考
Block a user