🚸 发送通知

#195
This commit is contained in:
BTMuli
2026-01-02 00:09:20 +08:00
parent 0288e38c95
commit 3a9610af7c
3 changed files with 12 additions and 1 deletions

View File

@@ -50,6 +50,7 @@ import postReq from "@req/postReq.js";
import useAppStore from "@store/app.js";
import useUserStore from "@store/user.js";
import TGLogger from "@utils/TGLogger.js";
import TGNotify from "@utils/TGNotify.js";
import { storeToRefs } from "pinia";
import { ref, shallowRef, watch } from "vue";
@@ -320,6 +321,7 @@ async function autoSign(ck: TGApp.App.Account.Cookie, skip: boolean, ch?: string
}
if (skip) {
await TGLogger.Script("已设置跳过验证,打卡失败");
await TGNotify.normal("自动打卡触发验证", `UID:${ck.stuid}`);
return;
}
await TGLogger.Script(`[米游币任务]社区签到触发验证码,正在尝试验证`);

View File

@@ -64,6 +64,7 @@ import TSUserAccount from "@Sqlm/userAccount.js";
import useBBSStore from "@store/bbs.js";
import useUserStore from "@store/user.js";
import TGLogger from "@utils/TGLogger.js";
import TGNotify from "@utils/TGNotify.js";
import { storeToRefs } from "pinia";
import { onMounted, ref, shallowRef, watch } from "vue";
@@ -277,7 +278,11 @@ async function trySign(
if ("retcode" in signResp) {
if (signResp.retcode === 1034) {
if (skip) {
await TGLogger.Script("已设置跳过验证,签到失败");
await TGLogger.Script("已设置跳过验证,打卡失败");
await TGNotify.normal(
"自动打卡触发验证",
`${item.account.regionName}-${item.account.gameUid}-${item.account.nickname}`,
);
break;
}
await TGLogger.Script(`[签到任务]触发验证码,正在尝试验证`);

View File

@@ -80,6 +80,7 @@ import painterReq from "@req/painterReq.js";
import TSUserAccount from "@Sqlm/userAccount.js";
import useUserStore from "@store/user.js";
import { exit } from "@tauri-apps/plugin-process";
import TGNotify from "@utils/TGNotify.js";
import { storeToRefs } from "pinia";
import { onBeforeMount, onMounted, ref, shallowRef, useTemplateRef } from "vue";
import { useRoute, useRouter } from "vue-router";
@@ -133,12 +134,15 @@ async function tryAutoRun(): Promise<void> {
} else {
uids = targetUids.value;
}
const startTime = Date.now();
for (const uid of uids) {
await loadAccount(uid);
await tryExecAll();
}
if (exitAfter.value) {
showSnackbar.success("任务执行完成,即将自动退出");
const costTime = Date.now() - startTime;
await TGNotify.normal("自动脚本执行完成", `耗时${Math.floor(costTime / 1000)}s`);
await new Promise<void>((resolve) => setTimeout(resolve, 1000));
await exit();
}