Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
fix: termId (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolu-lujunji committed Nov 23, 2022
1 parent da89828 commit d8f429b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mooc-helper",
"version": "0.1.0",
"version": "0.1.1",
"private": false,
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "mooc-helper",
"version": "0.1.0"
"version": "0.1.1"
},
"tauri": {
"allowlist": {
Expand Down
3 changes: 3 additions & 0 deletions src/@types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ interface Course {
imgUrl: string;
fromCourseId: number;
schoolPanel: SchoolPanel;
termPanel: {
id: number;
};
}

interface SchoolPanel {
Expand Down
2 changes: 1 addition & 1 deletion src/features/chapter-tree-view/ChapterTreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ChapterTreeView() {
try {
const { status, results } = await courseInfo(
course.id,
course.currentTermId
course.termPanel.id
);
if (status.code === 0) {
setChapters(results.termDto.chapters);
Expand Down
8 changes: 7 additions & 1 deletion src/lib/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ async function requestWeb<T>(options: RequestOptions) {
const response = await ky(options.url, {
prefixUrl: "/api",
method: options.method,
headers: options.headers,
headers: {
...options.headers,
"edu-app-type": "android",
},
searchParams: {
...options.query,
"mob-token": mobToken ?? "",
Expand Down Expand Up @@ -44,6 +47,9 @@ async function requestTauri<T>(options: RequestOptions) {
const client = await getClient();
const response = await client.request<T>({
url: `https://www.icourse163.org/${url}`,
headers: {
"edu-app-type": "android",
},
query: handledQuery,
...other,
});
Expand Down

1 comment on commit d8f429b

@vercel
Copy link

@vercel vercel bot commented on d8f429b Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.