Skip to content

Commit

Permalink
feat: v1.0.0 released
Browse files Browse the repository at this point in the history
  • Loading branch information
MissterHao committed May 21, 2021
1 parent 3d422b5 commit a153c48
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wannaclass",
"version": "0.9.1",
"version": "1.0.0",
"description": "Get class from yzu course api.",
"main": "app.js",
"scripts": {
Expand Down
39 changes: 21 additions & 18 deletions renderer/CourseSelWorker.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,27 @@
}
rows.forEach((element) => {
console.log(element);
apibackend.selCourseInline(element).then((res) => {
console.log(res);
if (res["data"] === "選課系統尚未開放!") {
// setStatus(element.id, Math.floor(Math.random() * 10))
setStatus(element.id, 0)
} else if (res["data"].indexOf("已選過")) {
// 2 => 已選過
setStatus(element.id, 2)
} else if (res["data"].indexOf("加選訊息")) {
// 1 => 已選 任務完成
setStatus(element.id, 1)
} else {
// -9999 其他未知訊息
setStatus(element.id, -9999)
}
}).catch((error) => {
console.error(error)
})

if(element.status!=2 || element.status!=3){
apibackend.selCourseInline(element).then((res) => {
console.log(res);
if (res["data"] === "選課系統尚未開放!") {
// setStatus(element.id, Math.floor(Math.random() * 10))
setStatus(element.id, 0)
} else if (res["data"].indexOf("已選過")) {
// 2 => 已選過
setStatus(element.id, 2)
} else if (res["data"].indexOf("加選訊息")) {
// 1 => 已選 任務完成
setStatus(element.id, 1)
} else {
// -9999 其他未知訊息
setStatus(element.id, -9999)
}
}).catch((error) => {
console.error(error)
})
}
});
});
}
Expand Down

0 comments on commit a153c48

Please sign in to comment.