diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 82507d6..1350f2a 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -156,6 +156,7 @@ declare global { const useAsyncState: typeof import('@vueuse/core').useAsyncState const useAttrs: typeof import('vue').useAttrs const useAuth: typeof import('./src/composables/useAuth').useAuth + const useBack: typeof import('./src/composables/useBack').useBack const useBase64: typeof import('@vueuse/core').useBase64 const useBattery: typeof import('@vueuse/core').useBattery const useBluetooth: typeof import('@vueuse/core').useBluetooth @@ -263,6 +264,7 @@ declare global { const useResizeObserver: typeof import('@vueuse/core').useResizeObserver const useRoute: typeof import('vue-router').useRoute const useRouter: typeof import('vue-router').useRouter + const useRouterBack: typeof import('./src/composables/useRouterBack').useRouterBack const useSSRWidth: typeof import('@vueuse/core').useSSRWidth const useScreenOrientation: typeof import('@vueuse/core').useScreenOrientation const useScreenSafeArea: typeof import('@vueuse/core').useScreenSafeArea @@ -623,6 +625,7 @@ declare module 'vue' { readonly useResizeObserver: UnwrapRef readonly useRoute: UnwrapRef readonly useRouter: UnwrapRef + readonly useRouterBack: UnwrapRef readonly useSSRWidth: UnwrapRef readonly useScreenOrientation: UnwrapRef readonly useScreenSafeArea: UnwrapRef diff --git a/components.d.ts b/components.d.ts index d4552fa..fc91f2d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -51,7 +51,6 @@ declare module 'vue' { IonTabButton: typeof import('@ionic/vue')['IonTabButton'] IonTabs: typeof import('@ionic/vue')['IonTabs'] IonText: typeof import('@ionic/vue')['IonText'] - IonTextarea: typeof import('@ionic/vue')['IonTextarea'] IonTitle: typeof import('@ionic/vue')['IonTitle'] IonToolbar: typeof import('@ionic/vue')['IonToolbar'] LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] @@ -115,7 +114,6 @@ declare global { const IonTabButton: typeof import('@ionic/vue')['IonTabButton'] const IonTabs: typeof import('@ionic/vue')['IonTabs'] const IonText: typeof import('@ionic/vue')['IonText'] - const IonTextarea: typeof import('@ionic/vue')['IonTextarea'] const IonTitle: typeof import('@ionic/vue')['IonTitle'] const IonToolbar: typeof import('@ionic/vue')['IonToolbar'] const LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] diff --git a/package.json b/package.json index f7b7725..61b83e5 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.41.tgz", + "@riwa/api-types": "http://192.168.1.27:9527/api/riwa-api-types-0.0.44.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 c7f0907..12a46dd 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.41.tgz - version: http://192.168.1.27:9527/api/riwa-api-types-0.0.41.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.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))) '@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.41.tgz': - resolution: {tarball: http://192.168.1.27:9527/api/riwa-api-types-0.0.41.tgz} - version: 0.0.41 + '@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 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.41.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.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)))': 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 1f77960..40fafb7 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -51,7 +51,7 @@ export type RwaData = Treaty.Data["data"][number]; -export type MySubscribeRwaData = Treaty.Data; +export type MySubscribeRwaData = Treaty.Data["data"][number]; export type MySubscribeRwaBody = TreatyQuery; diff --git a/src/composables/useRouterBack.ts b/src/composables/useRouterBack.ts new file mode 100644 index 0000000..8927109 --- /dev/null +++ b/src/composables/useRouterBack.ts @@ -0,0 +1,10 @@ +import { router } from "@/router"; + +export function useRouterBack() { + if (window.history.state.back) { + router.back(); + } + else { + router.replace("/"); + } +} diff --git a/src/router/auth.ts b/src/router/auth.ts index 77f2195..985442c 100644 --- a/src/router/auth.ts +++ b/src/router/auth.ts @@ -1,20 +1,6 @@ import type { RouteRecordRaw } from "vue-router"; const routes: Array = [ - // { - // path: "/auth", - // component: () => import("@/views/auth/index.vue"), - // children: [ - // { - // path: "/auth/login", - // component: () => import("@/views/auth/login/index.vue"), - // }, - // { - // path: "/auth/signup", - // component: () => import("@/views/auth/signup/index.vue"), - // }, - // ], - // }, { path: "/auth/login", component: () => import("@/views/auth/login/index.vue"), diff --git a/src/views/auth/login/index.vue b/src/views/auth/login/index.vue index 235f1dd..1f7f0d5 100644 --- a/src/views/auth/login/index.vue +++ b/src/views/auth/login/index.vue @@ -34,6 +34,9 @@ async function handleSignInPhoneNumber(value: PhoneNumberVerifyClient) { useNavigateToRedirect(route.query.redirect as string); } } +function onClose() { + useRouterBack(); +}