From 83c16fddd66aea3810a5b5e6351867d085101ba8 Mon Sep 17 00:00:00 2001 From: Seven Date: Mon, 5 Jan 2026 14:17:47 +0700 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E8=B0=83=E6=95=B4=20API=20URL=20?= =?UTF-8?q?=E5=92=8C=E5=BA=93=E5=9C=B0=E5=9D=80=EF=BC=9B=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20PWA=20=E5=AE=89=E8=A3=85=E6=94=AF=E6=8C=81=EF=BC=9B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B7=AF=E7=94=B1=E5=92=8C=E7=BB=84=E4=BB=B6=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +-- .env.production | 4 +-- auto-imports.d.ts | 2 ++ capacitor.config.ts | 2 +- components.d.ts | 4 +++ index.html | 8 ++++-- ios/App/App.xcodeproj/project.pbxproj | 4 +-- public/favicon.png | Bin 930 -> 0 bytes src/api/types.ts | 2 +- src/auth/index.ts | 4 +++ src/locales/en-US.json | 14 +++++++++ src/locales/zh-CN.json | 14 +++++++++ src/router/index.ts | 40 ++++++++------------------ src/store/user.ts | 1 + src/views/riwa/index.vue | 2 +- 15 files changed, 66 insertions(+), 39 deletions(-) delete mode 100644 public/favicon.png diff --git a/.env.development b/.env.development index 13ed883..faeec93 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ -VITE_API_URL=http://192.168.1.8:9528 -VITE_TRADINGVIEW_LIBRARY_URL=http://192.168.1.6:6173 +VITE_API_URL=http://192.168.1.6:9528 +VITE_TRADINGVIEW_LIBRARY_URL=http://192.168.1.4:6173 # VITE_TRADINGVIEW_DATA_API_URL=https://demo-feed-data.tradingview.com \ No newline at end of file diff --git a/.env.production b/.env.production index 89a6ea4..3998d71 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ -VITE_API_URL=http://192.168.1.8:9527 -VITE_TRADINGVIEW_LIBRARY_URL=http://192.168.1.6:6173 +VITE_API_URL=http://192.168.1.6:9527 +VITE_TRADINGVIEW_LIBRARY_URL=http://192.168.1.4:6173 # VITE_TRADINGVIEW_DATA_API_URL=https://demo-feed-data.tradingview.com \ No newline at end of file diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 34d3d5e..7327015 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -242,6 +242,7 @@ declare global { const useObjectUrl: typeof import('@vueuse/core').useObjectUrl const useOffsetPagination: typeof import('@vueuse/core').useOffsetPagination const useOnline: typeof import('@vueuse/core').useOnline + const usePWAInstall: typeof import('./src/composables/usePWAInstall').usePWAInstall const usePageLeave: typeof import('@vueuse/core').usePageLeave const useParallax: typeof import('@vueuse/core').useParallax const useParentElement: typeof import('@vueuse/core').useParentElement @@ -606,6 +607,7 @@ declare module 'vue' { readonly useObjectUrl: UnwrapRef readonly useOffsetPagination: UnwrapRef readonly useOnline: UnwrapRef + readonly usePWAInstall: UnwrapRef readonly usePageLeave: UnwrapRef readonly useParallax: UnwrapRef readonly useParentElement: UnwrapRef diff --git a/capacitor.config.ts b/capacitor.config.ts index b41e291..2cdf037 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -5,7 +5,7 @@ const config: CapacitorConfig = { appName: "riwa-ionic", webDir: "dist", server: { - url: "http://192.168.1.5:5173", // Vite默认端口 + url: "http://192.168.1.6:5173", // Vite默认端口 cleartext: true, // 允许HTTP连接 }, plugins: { diff --git a/components.d.ts b/components.d.ts index 2286e4e..f2ac9e1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -58,6 +58,8 @@ declare module 'vue' { IonTitle: typeof import('@ionic/vue')['IonTitle'] IonToolbar: typeof import('@ionic/vue')['IonToolbar'] LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] + PwaInstallButton: typeof import('./src/components/pwa-install-button/index.vue')['default'] + PwaInstallButtonIosInstallGuide: typeof import('./src/components/pwa-install-button/ios-install-guide.vue')['default'] QrScanner: typeof import('./src/components/qr-scanner/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -113,6 +115,8 @@ declare global { const IonTitle: typeof import('@ionic/vue')['IonTitle'] const IonToolbar: typeof import('@ionic/vue')['IonToolbar'] const LayoutDefault: typeof import('./src/components/layout/default.vue')['default'] + const PwaInstallButton: typeof import('./src/components/pwa-install-button/index.vue')['default'] + const PwaInstallButtonIosInstallGuide: typeof import('./src/components/pwa-install-button/ios-install-guide.vue')['default'] const QrScanner: typeof import('./src/components/qr-scanner/index.vue')['default'] const RouterLink: typeof import('vue-router')['RouterLink'] const RouterView: typeof import('vue-router')['RouterView'] diff --git a/index.html b/index.html index a04132f..0ca0c0d 100644 --- a/index.html +++ b/index.html @@ -18,8 +18,12 @@ - - + + + + + + diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj index 6a044b7..84a9b41 100644 --- a/ios/App/App.xcodeproj/project.pbxproj +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -304,7 +304,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = riwa.ionic.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -327,7 +327,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = riwa.ionic.app; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 51888a7bbdb59f04c29c548523eb2638c1c954f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 930 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!x&nMcT-^(N+`Ik{1{5}NM-k9f zx+Ot=!3-}y{#<)Uok@}X^0T)Mjw~(h@l#Ir^NC7r=_#0-8E$a3RKVL~nc3p~*UxA# z4bjg_XJBBO<>}%W5^;EK_{&+V40u?Vtzk_Oy;*YMVqw~ozwz&rPG6d~>D#mR`SK=; zww9K@s-5|}%Dy=+ak|}>#qwwKGH>ZO4~|`P_r2LJy1RYqyXB`=?Mw?@F8Z!h{rcpz z^y94Mdt1KFIr?nR|NE2g?N}2vO^d(4;=OB>WP0Plul!REN;cgwUAJuA?C`^98NGCJ zuf=eS_OHmETd)0azdLJ6Z^FIm6*YNHw|4%lGf`stp1;dK$1sNYdj7ec{*dYEN(RM7|LFZWoy#R9733Kz`kee` zcsH&1+JCz2|7qRT%bgpNUdZ3E%i6T)I?vY6{p)ga_qlB<;GAPn(!{OF;x_wm_K%n( zW67=BbK}Hx+Mo2yW_)0K?|;#s9f!Uw=S;9NQ)S^>UOs1+lefL)nQKa6oJzg9f7^uT zr^QQJHL|;hJ!n29P`>r{pI$??E8ll+Vp%D3sqgGAQ?16Ir>}307i!n%dGB~BKleRm zV`}#;lUe7&`Rm%PqCLs%HOEe${KnWk%jlG>GM}cUf9>%Jt~^m(q1U%2$4$<)xHgTq zd0EM;Wjbazr!IcCcJ{`1i$kvS+;+RTmT^vJdf^@OKlARE7bo`3-BEDmtJB75>uhqr zB>Z2>{qec~lUw13i#jzoi~HY = T extends (...args: any[]) => any diff --git a/src/auth/index.ts b/src/auth/index.ts index aff64bc..da6a200 100644 --- a/src/auth/index.ts +++ b/src/auth/index.ts @@ -15,6 +15,10 @@ export const authClient = createAuthClient({ baseURL, fetchOptions: { credentials: "include", + auth: { + type: "Bearer", + token: () => localStorage.getItem("user-token") || "", + }, }, plugins: [emailOTPClient(), phoneNumberClient(), usernameClient()], }); diff --git a/src/locales/en-US.json b/src/locales/en-US.json index f12254a..27ac2ff 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -437,5 +437,19 @@ "amountMaxError": "Amount cannot exceed available balance {amount}", "fromAccountRequired": "Please select from account", "toAccountRequired": "Please select to account" + }, + "pwa": { + "install": { + "installApp": "Install App", + "addToHomeScreen": "Add to Home Screen", + "howToInstall": "How to Install", + "success": "Installation Successful", + "successMessage": "The app has been successfully added to your device", + "iosTitle": "Install App on iOS", + "iosStep1": "1. Tap the Share button at the bottom toolbar", + "iosStep2": "2. Scroll down and tap 'Add to Home Screen'", + "iosStep3": "3. Tap 'Add' to confirm installation", + "iosNote": "Once installed, you can use it like a native app" + } } } diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index d54e2ea..3930a66 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -443,5 +443,19 @@ "amountMaxError": "划转数量不能超过可用余额 {amount}", "fromAccountRequired": "请选择转出账户", "toAccountRequired": "请选择转入账户" + }, + "pwa": { + "install": { + "installApp": "安装应用", + "addToHomeScreen": "添加到主屏幕", + "howToInstall": "如何安装", + "success": "安装成功", + "successMessage": "应用已成功添加到您的设备", + "iosTitle": "在 iOS 上安装应用", + "iosStep1": "1. 点击底部工具栏的分享按钮", + "iosStep2": "2. 向下滚动并点击添加到主屏幕", + "iosStep3": "3. 点击添加确认安装", + "iosNote": "安装后可以像原生应用一样使用" + } } } diff --git a/src/router/index.ts b/src/router/index.ts index 81788ef..bb64eb6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -142,39 +142,23 @@ const routes: Array = [ }, { path: "/trade-settings/my-subscribe", - component: () => import("@/views/trade-settings/my-subscribe/outlet.vue"), + component: () => import("@/views/trade-settings/my-subscribe/index.vue"), + meta: { requiresAuth: true }, + }, + { + path: "/trade-settings/my-subscribe/:id", + component: () => import("@/views/trade-settings/my-subscribe/detail.vue"), meta: { requiresAuth: true }, - children: [ - { - path: "", - component: () => import("@/views/trade-settings/my-subscribe/index.vue"), - meta: { requiresAuth: true }, - }, - { - path: ":id", - props: true, - component: () => import("@/views/trade-settings/my-subscribe/detail.vue"), - meta: { requiresAuth: true }, - }, - ], }, { path: "/trade-settings/my-issues", - component: () => import("@/views/trade-settings/my-issues/outlet.vue"), + component: () => import("@/views/trade-settings/my-issues/index.vue"), + meta: { requiresAuth: true }, + }, + { + path: "/trade-settings/my-issues/:id", + component: () => import("@/views/trade-settings/my-issues/detail.vue"), meta: { requiresAuth: true }, - children: [ - { - path: "", - component: () => import("@/views/trade-settings/my-issues/index.vue"), - meta: { requiresAuth: true }, - }, - { - path: ":id", - props: true, - component: () => import("@/views/trade-settings/my-issues/detail.vue"), - meta: { requiresAuth: true }, - }, - ], }, { path: "/trade-settings/bank-management/add", diff --git a/src/store/user.ts b/src/store/user.ts index 65e842d..c41e71a 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -19,6 +19,7 @@ export const useUserStore = defineStore("user", () => { } function setToken(value: string) { + localStorage.setItem("user-token", value); token.value = value; } diff --git a/src/views/riwa/index.vue b/src/views/riwa/index.vue index f8c9496..0b62fb8 100644 --- a/src/views/riwa/index.vue +++ b/src/views/riwa/index.vue @@ -15,7 +15,7 @@ import Rwa from "./components/rwa.vue"; - +