@@ -46,7 +46,7 @@ function parseMainPageTable(html: string): Array<{ barcode: string; returnDate:
4646 const parser = new DOMParser ( )
4747 const doc = parser . parseFromString ( html , 'text/html' )
4848 const table = doc . getElementById ( 'contentTable' ) as HTMLTableElement
49- const rows = Array . from ( table . querySelectorAll ( 'tr' ) ) . slice ( 1 ) // 跳过表头
49+ const rows = table ? Array . from ( table . querySelectorAll ( 'tr' ) ) . slice ( 1 ) : [ ] // 跳过表头
5050 return rows . map ( ( row ) => {
5151 const cells = row . querySelectorAll ( 'td' )
5252 return {
@@ -106,8 +106,8 @@ async function toBookInfoArrayType(originData: Array<OriginBookItem>): Promise<A
106106}
107107
108108export async function getDetailInfo ( loadingInfo : Ref < string > ) : Promise < Array < BookInfo > > {
109- loadingInfo . value = " 登录中"
110- console . log ( " 登录中" )
109+ loadingInfo . value = ' 登录中'
110+ console . log ( ' 登录中' )
111111 const { ul, pl } = await NativeRPC . call < { ul : string ; pl : string } > ( 'spider.getulpl' )
112112 console . log ( 'part1 finished' )
113113 const { lib_home : libraryMainPage } = await NativeRPC . call < { lib_home : string } > ( 'spider.run' , {
@@ -139,10 +139,10 @@ export async function getDetailInfo(loadingInfo: Ref<string>): Promise<Array<Boo
139139 }
140140 }
141141 console . log ( 'finish' )
142- if ( bookDataArray . length === 0 ) {
143- loadingInfo . value = "暂无借阅记录"
144- } else {
145- loadingInfo . value = ""
142+ if ( bookDataArray . length === 0 ) {
143+ loadingInfo . value = 'none'
144+ } else {
145+ loadingInfo . value = ''
146146 }
147147 return bookDataArray . reverse ( )
148148}
0 commit comments