From 6d9b6b0a1b5893aacd2693ff6aa59f6dbf8b9bb6 Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 22 Dec 2025 05:45:24 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20@riwa/api-types=20?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E8=87=B3=200.0.49=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ src/api/types.ts | 4 +--- src/store/user.ts | 8 ++------ src/views/onchain-address/index.vue | 4 ++-- src/views/user-settings/email.vue | 4 ++-- src/views/user-settings/index.vue | 4 ++-- src/views/user-settings/username.vue | 4 ++-- src/views/user/components/user-info.vue | 4 ++-- 9 files changed, 20 insertions(+), 26 deletions(-) diff --git a/package.json b/package.json index 61b83e5..d74769f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@elysiajs/eden": "^1.4.5", "@ionic/vue": "^8.7.11", "@ionic/vue-router": "^8.7.11", - "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz", + "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz", "@tailwindcss/vite": "^4.1.18", "@vee-validate/yup": "^4.15.1", "@vueuse/core": "^14.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12a46dd..1f46716 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: ^8.7.11 version: 8.7.11(@stencil/core@4.39.0)(vue-router@4.6.3(vue@3.5.25(typescript@5.9.3)))(vue@3.5.25(typescript@5.9.3)) '@riwa/api-types': - specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz - version: http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))) + specifier: http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz + version: http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3))) '@tailwindcss/vite': specifier: ^4.1.18 version: 4.1.18(vite@7.2.7(@types/node@24.10.2)(jiti@2.6.1)(lightningcss@1.30.2)(terser@5.44.1)(yaml@2.8.2)) @@ -1354,9 +1354,9 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz': - resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz} - version: 0.0.44 + '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz': + resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz} + version: 0.0.49 peerDependencies: '@elysiajs/eden': ^1.4.5 @@ -6453,7 +6453,7 @@ snapshots: '@pkgr/core@0.2.9': {} - '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.44.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': + '@riwa/api-types@http://192.168.1.27:9527/api/riwa-api-types-0.0.49.tgz(@elysiajs/eden@1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)))': dependencies: '@elysiajs/eden': 1.4.5(elysia@1.4.18(@sinclair/typebox@0.34.41)(exact-mirror@0.2.5(@sinclair/typebox@0.34.41))(file-type@21.1.1)(openapi-types@12.1.3)(typescript@5.9.3)) diff --git a/src/api/types.ts b/src/api/types.ts index 40fafb7..3518cb6 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -25,9 +25,7 @@ export type WithdrawBody = Omit[0], withdrawMethod: WithdrawMethodEnum; }; -export type UserProfileData = Treaty.Data["userProfile"]; - -export type UserData = Treaty.Data["user"]; +export type UserProfileData = Treaty.Data; export type UpdateUserProfileBody = TreatyBody; diff --git a/src/store/user.ts b/src/store/user.ts index edd7135..65e842d 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -1,15 +1,13 @@ -import type { UserData, UserProfileData } from "@/api/types"; +import type { UserProfileData } from "@/api/types"; import { client, safeClient } from "@/api"; interface State { - user: UserData | null; userProfile: UserProfileData | null; } export const useUserStore = defineStore("user", () => { const token = useStorage("user-token", null); const state = reactive({ - user: null, userProfile: null, }); @@ -17,8 +15,7 @@ export const useUserStore = defineStore("user", () => { async function updateProfile() { const { data } = await safeClient(client.api.user.profile.get(), { silent: true }); - state.userProfile = data.value?.userProfile || null; - state.user = data.value?.user || null; + state.userProfile = data.value || null; } function setToken(value: string) { @@ -28,7 +25,6 @@ export const useUserStore = defineStore("user", () => { function signOut() { token.value = null; state.userProfile = null; - state.user = null; } return { diff --git a/src/views/onchain-address/index.vue b/src/views/onchain-address/index.vue index 27ea5ae..2ecc810 100644 --- a/src/views/onchain-address/index.vue +++ b/src/views/onchain-address/index.vue @@ -2,7 +2,7 @@ import { copyOutline, qrCodeOutline, shareOutline } from "ionicons/icons"; const userStore = useUserStore(); -const { user } = storeToRefs(userStore); +const { userProfile } = storeToRefs(userStore);