File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import {
3939 getExamTypeNameByCode ,
4040 getPageHTML ,
4141 getThisTermScoresDataURL ,
42+ getAllPassingScoresURL ,
4243 LoadHTMLToDealWithError
4344} from './utils'
4445
@@ -595,7 +596,7 @@ function filterCourseScoreInfoList(list: CourseScoreInfo[]): CourseScoreInfo[] {
595596}
596597
597598export async function requestAllPassingScores ( ) : Promise < CourseScoreInfo [ ] > {
598- const url = '/student/integratedQuery/scoreQuery/allPassingScores/callback'
599+ const url = await getAllPassingScoresURL ( )
599600 try {
600601 const { lnList } = ( await $ . get ( url ) ) as APIAllPassingScoresDTO
601602 const records = lnList . reduce (
Original file line number Diff line number Diff line change @@ -50,6 +50,19 @@ export async function getThisTermScoresDataURL(): Promise<string> {
5050 }
5151}
5252
53+ export async function getAllPassingScoresURL ( ) : Promise < string > {
54+ const referralUrl = 'student/integratedQuery/scoreQuery/allPassingScores/index'
55+ const referralPageHTML = await getPageHTML ( referralUrl )
56+ const r = / s c o r e Q u e r y \/ ( .+ ?) \/ a l l P a s s i n g S c o r e s / . exec ( referralPageHTML )
57+ if ( ! r ) {
58+ const msg = '无法获取 allPassingScores 接口的完整地址。'
59+ notifyError ( msg , '[均分绩点计算器] 获取数据接口地址失败' )
60+ throw new Error ( msg )
61+ } else {
62+ return `/student/integratedQuery/scoreQuery/${ r [ 1 ] } /allPassingScores/callback`
63+ }
64+ }
65+
5366export function getExamTypeNameByCode (
5467 examTypeCode : string | undefined
5568) : string | undefined {
You can’t perform that action at this time.
0 commit comments