fix password resty api
此提交包含在:
@@ -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
|
||||
}
|
||||
|
新增問題並參考
封鎖使用者