Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/generate/academic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export async function getApiV1JwchAcademicScores(options?: {
term: string;
exam_type: string;
elective_type: string;
classroom: string;
}[];
}>('/api/v1/jwch/academic/scores', {
method: 'GET',
Expand Down
6 changes: 3 additions & 3 deletions lib/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ export class NotificationManager {
private static async calMarkDigest(semester: string): Promise<string[]> {
let result: string[] = [];

// 由于只需要知道课程信息,而课程信息在选课结束后就会提供(只是没成绩),所以缓存时间直接给 14
// 由于只需要知道课程信息,而课程信息在选课结束后就会提供(只是没成绩),所以缓存时间直接给 7
const data = await fetchWithCache(
[GRADE_LIST_KEY],
() => getApiV1JwchAcademicScores(),
{ staleTime: 14 * EXPIRE_ONE_DAY }, // 缓存14
{ staleTime: 7 * EXPIRE_ONE_DAY }, // 缓存 7
Comment thread
ozline marked this conversation as resolved.
);

// 如果有数据,则提取需要考试的考场信息,聚合成一个数组
Expand All @@ -156,7 +156,7 @@ export class NotificationManager {
// 过滤出当前学期的课程
const filteredData = data.data.data.filter(item => item.term === semester);
for (const item of filteredData) {
result.push(await md5([item.name, item.term, item.teacher, item.elective_type].join('|'), 32));
result.push(await md5([item.name, item.term, item.teacher, item.elective_type, item.classroom].join('|'), 32));
}
}

Expand Down