Skip to content

Commit

Permalink
fix(script): 修复职教云更新后-资源库不自动学习的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Nov 24, 2023
1 parent 7bce433 commit 2d4d026
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/scripts/src/projects/zjy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ export const ZJYProject = Project.create({

const courseInfo = await start();

if (!courseInfo) return;
if (!courseInfo) {
$console.error('获取课程信息失败,请跟作者反馈。');
return;
}
$message('success', { content: '开始学习:' + courseInfo.name });
$console.info('开始学习:' + courseInfo.name);
if (['ppt', 'doc', 'pptx', 'docx', 'pdf'].some((i) => courseInfo.fileType === i)) {
Expand Down Expand Up @@ -209,7 +212,8 @@ async function watchFile() {
}

async function start(): Promise<CourseType | undefined> {
const info = $el('.guide')?.__vue__?.courseList;
const vue = $el('.guide')?.__vue__;
const info = vue?.courseList || vue?.designData;
if (info?.id !== undefined) {
return info;
} else {
Expand Down

0 comments on commit 2d4d026

Please sign in to comment.