diff --git a/package.json b/package.json index 60b89b30..21308174 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "lint:rust:fix": "cd src-tauri && cargo fmt", "prettier": "prettier . --write", "tauri": "tauri", - "tauri:icon": "tauri icon ./public/icon.png", "vite:dev": "vite dev", "vite:build": "vite build", "prepare": "husky" diff --git a/public/icon.png b/public/icon.png deleted file mode 100644 index 9c655a2b..00000000 Binary files a/public/icon.png and /dev/null differ diff --git a/src/components/viewPost/vp-overlay-search.vue b/src/components/viewPost/vp-overlay-search.vue index e3df412d..32205244 100644 --- a/src/components/viewPost/vp-overlay-search.vue +++ b/src/components/viewPost/vp-overlay-search.vue @@ -23,7 +23,7 @@ import showSnackbar from "@comp/func/snackbar.js"; import Mys from "@Mys/index.js"; import { computed, onMounted, ref, shallowRef, watch } from "vue"; -import { getGameName } from "@/web/utils/tools.js"; +import { getGameName } from "@/utils/toolFunc.js"; type ToPostSearchProps = { modelValue: boolean; gid: string; keyword?: string }; type ToPostSearchEmits = (e: "update:modelValue", v: boolean) => void; diff --git a/src/pages/common/PostNews.vue b/src/pages/common/PostNews.vue index bf8da801..952f2904 100644 --- a/src/pages/common/PostNews.vue +++ b/src/pages/common/PostNews.vue @@ -68,7 +68,7 @@ import { useRoute, useRouter } from "vue-router"; import { type NewsType, NewsTypeEnum, useAppStore } from "@/store/modules/app.js"; import TGLogger from "@/utils/TGLogger.js"; import { createPost } from "@/utils/TGWindow.js"; -import { getGameName } from "@/web/utils/tools.js"; +import { getGameName } from "@/utils/toolFunc.js"; type PostData = { [key in NewsType]: Array }; type RawData = { [key in NewsType]: { isLast: boolean; name: string; lastId: number } }; diff --git a/src/web/request/bbsReq.ts b/src/web/request/bbsReq.ts index a5bb1790..20efdcd3 100644 --- a/src/web/request/bbsReq.ts +++ b/src/web/request/bbsReq.ts @@ -26,6 +26,34 @@ async function getUserFullInfo( return resp.data.user_info; } +/** + * @description 根据gid和id获取用户信息 + * @since Beta v0.6.7 + * @param {number} gid - gid + * @param {string} userId - 用户 id + * @returns {Promise} + */ +async function getOtherUserInfo( + gid: number, + userId: string, +): Promise { + const params = { gids: gid.toString(), uid: userId }; + const resp = await TGHttp( + "https://bbs-api.miyoushe.com/user/wapi/getUserFullInfo", + { method: "GET", headers: getRequestHeader({}, "GET", params, "X4", true), query: params }, + ); + if (resp.retcode !== 0) return resp; + return resp.data.user_info; +} + +/** + * @description 获取用户发布帖子 + * @since Beta v0.6.7 + * @param {string} uid - 用户 uid + * @param [string] offset - 偏移量 + * @returns {Promise} 用户发布帖子 + */ + /** * @description 获取用户收藏帖子 * @since Beta v0.6.3 @@ -49,6 +77,10 @@ async function userFavouritePost( return resp.data; } -const BBSApi = { userInfo: getUserFullInfo, lovePost: userFavouritePost }; +const BBSApi = { + userInfo: getUserFullInfo, + otherUserInfo: getOtherUserInfo, + lovePost: userFavouritePost, +}; export default BBSApi; diff --git a/src/web/request/takumiReq.ts b/src/web/request/takumiReq.ts index 09b1d2fe..b2879e7e 100644 --- a/src/web/request/takumiReq.ts +++ b/src/web/request/takumiReq.ts @@ -17,19 +17,20 @@ const tbAbu: Readonly = "https://api-takumi.mihoyo.com/binding/api/"; * @param {TGApp.App.Account.Cookie} cookie Cookie * @param {TGApp.Sqlite.Account.Game} user 用户 * @param {string} actionType 动作类型 - * @returns {Promise} + * @returns {Promise} */ async function getActionTicketBySToken( cookie: TGApp.App.Account.Cookie, user: TGApp.Sqlite.Account.Game, actionType: string, -): Promise { +): Promise { const ck = { stoken: cookie.stoken, mid: cookie.mid }; const params = { action_type: actionType, stoken: cookie.stoken, uid: user.gameUid }; - return await TGHttp( - `${taAbu}getActionTicketBySToken`, - { method: "GET", headers: getRequestHeader(ck, "GET", params, "K2"), query: params }, - ); + return await TGHttp(`${taAbu}getActionTicketBySToken`, { + method: "GET", + headers: getRequestHeader(ck, "GET", params, "K2"), + query: params, + }); } /** @@ -91,10 +92,11 @@ async function getUserGameRolesByCookie( ): Promise { const ck = { account_id: cookie.account_id, cookie_token: cookie.cookie_token }; const params = { game_biz: "hk4e_cn" }; - const resp = await TGHttp( - `${tbAbu}getUserGameRolesByCookie`, - { method: "GET", headers: getRequestHeader(ck, "GET", params), query: params }, - ); + const resp = await TGHttp(`${tbAbu}getUserGameRolesByCookie`, { + method: "GET", + headers: getRequestHeader(ck, "GET", params), + query: params, + }); if (resp.retcode !== 0) return resp; return resp.data.list; } @@ -105,3 +107,42 @@ const TakumiApi = { }; export default TakumiApi; + +/// 一些类型 /// +type ActionTicketByStokenResp = TGApp.BBS.Response.BaseWithData & { + data: { + ticket: string; + is_verified: boolean; + account_info: { + is_realname: boolean; + mobile: string; + safe_mobile: string; + account_id: string; + account_name: string; + email: string; + is_email_verify: boolean; + area_code: string; + safe_area_code: string; + real_name: string; + identity_code: string; + create_time: string; + create_ip: string; + change_pwd_time: string; + nickname: string; + user_icon_id: number; + safe_level: number; + black_endtime: string; + black_note: string; + gender: number; + real_stat: number; + apple_name: string; + sony_name: string; + tap_name: string; + reactivate_ticket: string; + }; + }; +}; + +type GameAccountsResp = TGApp.BBS.Response.BaseWithData & { + data: { list: Array }; +};