Skip to content

Commit

Permalink
Merge pull request #23 from MangoGovo/dev
Browse files Browse the repository at this point in the history
fix: 修复考试信息查询不全
  • Loading branch information
XiMo-210 authored Dec 13, 2024
2 parents 826c616 + ff93eea commit 7de3a6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/service/zfService/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func login(username string, password string) (*model.User, error) {
} else {
URL = apis.CAPTCHA_BREAKER_URL
}
captcha, err := f.Get(URL + "?request=" + f.Cookie[0].Value + "&route=" + f.Cookie[1].Value)
captcha, err := f.Get(URL + "?session=" + f.Cookie[0].Value + "&route=" + f.Cookie[1].Value)
if err != nil {
return nil, err
}
Expand Down
8 changes: 1 addition & 7 deletions app/service/zfService/zfService.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func GetLessonsTable(stu *model.User, year string, term string) (interface{}, er
}
func GetExamInfo(stu *model.User, year string, term string) (interface{}, error) {
var result model.ExamInfo
resultMap := make(map[string]*model.Exam)
for i := 0; i < 7; i++ {
res, err := fetchTermRelatedInfo(stu, zf.ZfExamInfo(), year, term, i)
if err != nil {
Expand All @@ -38,12 +37,7 @@ func GetExamInfo(stu *model.User, year string, term string) (interface{}, error)
//return nil, err
}
examInfo := model.TransformExamInfo(&f)
for _, v := range examInfo {
resultMap[v.ExamTime] = v
}
}
for _, v := range resultMap {
result = append(result, v)
result = append(result, examInfo...)
}
sort.SliceStable(result, func(i, j int) bool {
return result[i].ExamTime > result[j].ExamTime
Expand Down

0 comments on commit 7de3a6e

Please sign in to comment.