Skip to content

Commit

Permalink
更新readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SSmJaE committed Apr 19, 2021
1 parent ad95c78 commit 9c84790
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<h1 align="center">签到小工具</h1>

<p align="center">手动签到;自动签到;签到队列</p>

![](./docs/pictures/config.png)
![](./docs/pictures/task.png)


## 声明
- 本项目基于GPL-3.0,完全开源,免费,仅供技术学习和交流,开发者团队并未授权任何组织、机构以及个人将其用于商业或者盈利性质的活动。也从未使用本项目进行任何盈利性活动。未来也不会将其用于开展营利性业务。
- 个人或者组织,机构如果使用本项目产生的各类纠纷,法律问题,均由其本人承担。
- 如果您开始使用本项目,即视为同意项目免责声明中的一切条款,条款更新不再另行通知。
- 如有触及相关平台规定或者权益,烦请联系我们删除。

## 已知问题
- 因为文件锁的原因,登录之后需要重启一下应用,才能同步cookie,下个版本修复
Binary file added docs/pictures/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/pictures/task.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ const createWindow = (): void => {
// and load the index.html of the app.
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY);

// Open the DevTools.
mainWindow.webContents.openDevTools({ mode: "undocked" });
if (process.env.NODE_ENV === "development") {
// Open the DevTools.
mainWindow.webContents.openDevTools({ mode: "undocked" });
}
};

// This method will be called when Electron has finished
Expand Down
14 changes: 12 additions & 2 deletions src/main/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import queryString from "query-string";
import axiosCookieJarSupport from "axios-cookiejar-support";
import tough from "tough-cookie";

import db from "@src/utils/database";
// 和renderer公用一个db,会出现数据未同步的问题,不知道为什么
import low from "lowdb";
import FileSync from "lowdb/adapters/FileSync";

const adapter = new FileSync<IDataBase>("db.json");
const db = low(adapter);

axiosCookieJarSupport(axios);

Expand Down Expand Up @@ -82,7 +87,12 @@ export async function isCookieValid(cookie: string) {
},
});

return response.includes("用户登录") ? false : true;
try {
return response.includes("用户登录") ? false : true;
} catch (error) {
console.error(error);
return false;
}
}

export async function getCourses(): Promise<string> {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/pages/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export default class Login extends mixins(WithLogNotify) {
}
async updateCookie() {
// const uid=
const uid = /UID=(\d*)/.exec(this.cookie)![1];
// 同步至db
userModule.updateUser({
// uid,
// cookie,
uid: parseInt(uid),
cookie: this.cookie,
});
}
Expand Down

0 comments on commit 9c84790

Please sign in to comment.