Skip to content

Commit

Permalink
修复BUG
Browse files Browse the repository at this point in the history
1.重复打包
2.添加账号无限发请求
3.jsonrpc连通性测试
  • Loading branch information
Yincmewy committed Jul 22, 2024
1 parent 2c4bd18 commit 88dba1b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/components/dialog/VipAccountEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const getAndSaveCookie = async (v: string) => {
};
const checkQrCode = async () => {
if (stringIsEmpty(qrcode.value.sign)) return;
try {
controller = new AbortController();
const {data: response} = await unicastQrCode(qrcode.value.sign, controller.signal);
Expand All @@ -92,7 +93,8 @@ const checkQrCode = async () => {
} else {
throw new Error();
}
} catch {
} catch (e) {
console.error(e);
checkQrCode().then(undefined);
}
};
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Parsed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ const start = () => {
message.warn('请选择下载方式!');
return;
}
// 清除缓存
results.length = 0;
blocked.value = true;
starting.value = true;
dialogStore.interceptUnload = true;
Expand All @@ -121,9 +123,6 @@ const stop = () => {
blocked.value = false;
starting.value = false;
dialogStore.interceptUnload = false;
// 清除缓存
results.slice(0, results.length);
};
const onWorkerMessage = async (m: WorkerResponse) => {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/package-download-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ import JSZip from 'jszip';
import {useMessage} from '@/hooks/useMessage';
import FileSaver from 'file-saver';
import type {ParsedFile} from '@/types';
import { useSystemConfigStore } from '@/store';

function getREADME() {
const systemConfig = useSystemConfigStore();
return `免责声明
本网站提供的内容仅供参考。本站不在服务器上存储任何文件。所有链接均为外部下载链接,不由本站托管或控制。我们不保证通过这些链接下载的文件的准确性、可靠性或合法性。
使用本网站即表示您理解并同意以下条款:
1. 我们不对因使用下载的文件而造成的任何损害或损失负责。
2. 您有责任确保您下载文件的使用符合适用的版权法律。
3. 链接的包含不意味着我们认可这些网站的内容。我们不对链接网站的内容负责。
4. 下载的文件仅供学习参考。
UserAgent:${systemConfig.parse_ua}
`;
}

Expand Down
6 changes: 4 additions & 2 deletions src/utils/test-jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import axios from 'axios';

export function testJsonrpc(host: string, port: number) {
return new Promise<boolean>(resolve => {
axios.post(`http://${host}:${port}/jsonrpc`)
axios.post(`http://${host}:${port}/jsonrpc`, {}, {
timeout: 1000 * 5
})
.then(() => resolve(true))
.catch(e => {
if (e.response !== undefined && e.response.status === 400) {
if (e.response !== undefined) {
resolve(true);
return;
}
Expand Down
10 changes: 6 additions & 4 deletions src/worker/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ function doParse(data: WorkerRequestBody, n: number, max: number) {
}
}).finally(() => {
if (n >= max) {
Main.postMessage({
type: 'done',
n, max
} as WorkerResponse);
setTimeout(() => {
Main.postMessage({
type: 'done',
n, max
} as WorkerResponse);
}, 500);
} else {
Main.postMessage({
type: 'progress',
Expand Down

0 comments on commit 88dba1b

Please sign in to comment.