From ce5a88954a2df57cde3b9ebd41263339fdfa0d48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Fri, 7 Mar 2025 17:53:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/pageConfig/tc-userBadge.vue | 12 +- src/components/pageHome/ph-comp-pool.vue | 123 ++++++++++--- src/components/pageHome/ph-comp-position.vue | 61 ++++--- src/components/pageHome/ph-position-card.vue | 6 +- src/components/viewPost/tp-text.vue | 4 +- src/pages/common/PageTest.vue | 30 +--- src/plugins/Mys/index.ts | 18 -- src/plugins/Mys/request/doCaptchaLogin.ts | 137 --------------- src/plugins/Mys/request/getEmojis.ts | 27 --- src/plugins/Mys/request/obcReq.ts | 57 ------ src/plugins/Mys/types/Gacha.d.ts | 100 ----------- src/plugins/Mys/types/Obc.d.ts | 50 ------ src/plugins/Mys/types/Position.d.ts | 96 ---------- src/plugins/Mys/utils/getGachaCard.ts | 80 --------- src/plugins/Mys/utils/getPositionCard.ts | 37 ---- .../Mys/types => types/BBS}/CaptchaLogin.d.ts | 94 ++++------ .../Mys/types => types/BBS}/Emoji.d.ts | 59 +++---- src/types/BBS/Obc.d.ts | 143 +++++++++++++++ src/web/request/bbsReq.ts | 28 ++- src/web/request/otherReq.ts | 12 +- src/web/request/passportReq.ts | 166 ++++++++++++++---- src/web/request/takumiReq.ts | 118 +++++++------ 22 files changed, 582 insertions(+), 876 deletions(-) delete mode 100644 src/plugins/Mys/index.ts delete mode 100644 src/plugins/Mys/request/doCaptchaLogin.ts delete mode 100644 src/plugins/Mys/request/getEmojis.ts delete mode 100644 src/plugins/Mys/request/obcReq.ts delete mode 100644 src/plugins/Mys/types/Gacha.d.ts delete mode 100644 src/plugins/Mys/types/Obc.d.ts delete mode 100644 src/plugins/Mys/types/Position.d.ts delete mode 100644 src/plugins/Mys/utils/getGachaCard.ts delete mode 100644 src/plugins/Mys/utils/getPositionCard.ts rename src/{plugins/Mys/types => types/BBS}/CaptchaLogin.d.ts (70%) rename src/{plugins/Mys/types => types/BBS}/Emoji.d.ts (67%) create mode 100644 src/types/BBS/Obc.d.ts diff --git a/src/components/pageConfig/tc-userBadge.vue b/src/components/pageConfig/tc-userBadge.vue index 8ea175c2..32270451 100644 --- a/src/components/pageConfig/tc-userBadge.vue +++ b/src/components/pageConfig/tc-userBadge.vue @@ -122,7 +122,6 @@ import showGeetest from "@comp/func/geetest.js"; import showLoading from "@comp/func/loading.js"; import showSnackbar from "@comp/func/snackbar.js"; import ToGameLogin from "@comp/pageConfig/tco-gameLogin.vue"; -import Mys from "@Mys/index.js"; import TSUserAccount from "@Sqlite/modules/userAccount.js"; import { storeToRefs } from "pinia"; import { computed, ref, shallowRef } from "vue"; @@ -132,6 +131,7 @@ import { useUserStore } from "@/store/modules/user.js"; import TGLogger from "@/utils/TGLogger.js"; import BBSApi from "@/web/request/bbsReq.js"; import PassportApi from "@/web/request/passportReq.js"; +import passportReq from "@/web/request/passportReq.js"; import TakumiApi from "@/web/request/takumiReq.js"; const { isLogin } = storeToRefs(useAppStore()); @@ -398,13 +398,13 @@ async function confirmCopyCookie(): Promise { } async function tryGetCaptcha(phone: string, aigis?: string): Promise { - const captchaResp = await Mys.User.getCaptcha(phone, aigis); + const captchaResp = await passportReq.captcha.create(phone, aigis); if ("retcode" in captchaResp) { if (!captchaResp.data || captchaResp.data === "") { showSnackbar.error(`[${captchaResp.retcode}] ${captchaResp.message}`); return false; } - const aigisResp: TGApp.Plugins.Mys.CaptchaLogin.CaptchaAigis = JSON.parse(captchaResp.data); + const aigisResp: TGApp.BBS.CaptchaLogin.CaptchaAigis = JSON.parse(captchaResp.data); const resp = await showGeetest(JSON.parse(aigisResp.data)); const aigisStr = `${aigisResp.session_id};${btoa(JSON.stringify(resp))}`; return await tryGetCaptcha(phone, aigisStr); @@ -417,14 +417,14 @@ async function tryLoginByCaptcha( captcha: string, actionType: string, aigis?: string, -): Promise { - const loginResp = await Mys.User.login(phone, captcha, actionType, aigis); +): Promise { + const loginResp = await passportReq.captcha.login(phone, captcha, actionType, aigis); if ("retcode" in loginResp) { if (!loginResp.data || loginResp.data === "") { showSnackbar.error(`[${loginResp.retcode}] ${loginResp.message}`); return false; } - const aigisResp: TGApp.Plugins.Mys.CaptchaLogin.CaptchaAigis = JSON.parse(loginResp.data); + const aigisResp: TGApp.BBS.CaptchaLogin.CaptchaAigis = JSON.parse(loginResp.data); const resp = await showGeetest(JSON.parse(aigisResp.data)); const aigisStr = `${aigisResp.session_id};${btoa(JSON.stringify(resp))}`; return await tryLoginByCaptcha(phone, captcha, actionType, aigisStr); diff --git a/src/components/pageHome/ph-comp-pool.vue b/src/components/pageHome/ph-comp-pool.vue index 8ec0e3f5..5c7a5f6d 100644 --- a/src/components/pageHome/ph-comp-pool.vue +++ b/src/components/pageHome/ph-comp-pool.vue @@ -6,6 +6,7 @@ {{ showNew ? "查看当前祈愿" : "查看后续祈愿" }}