Skip to content

Commit

Permalink
fix(script): 对超星繁体字库加载进行异常处理
Browse files Browse the repository at this point in the history
  • Loading branch information
ennnncy committed Apr 10, 2023
1 parent 6b39e40 commit 7a0c825
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/scripts/src/projects/cx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,16 @@ async function mappingRecognize(doc: Document = document) {
}

async function loadTyprMapping() {
$console.log('正在加载繁体字库。');
return await request('https://cdn.ocsjs.com/resources/font/table.json', {
type: 'GM_xmlhttpRequest',
method: 'get',
responseType: 'json'
});
try {
$console.log('正在加载繁体字库。');
return await request('https://cdn.ocsjs.com/resources/font/table.json', {
type: 'GM_xmlhttpRequest',
method: 'get',
responseType: 'json'
});
} catch (err) {
$console.error('载繁体字库加载失败,请刷新页面重试:', String(err));
}
}

/**
Expand Down

0 comments on commit 7a0c825

Please sign in to comment.