增加性接口,修复登录错误

This commit is contained in:
2022-11-24 20:55:35 +08:00
parent dad0f34764
commit 65149386c4
5 changed files with 14 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ func SDULogin(username string, password string) (*dto.SDULoginData, error) {
}
result1 := string(resp.Body())
if resp.StatusCode()/100 != 2 {
return nil, errors.New(result1)
return nil, errors.New("账号或密码错误")
}
resp, err = Client.R().SetBody("service=https://service.sdu.edu.cn/tp_up/view?m=up").
Post("https://pass.sdu.edu.cn/cas/restlet/tickets/" + result1)