chore: 修改api请求代理

This commit is contained in:
2025-12-12 00:11:08 +07:00
parent 0b0239ec2c
commit 98b8b1aab6
5 changed files with 160 additions and 5 deletions

2
.env
View File

@@ -1 +1 @@
VITE_BASE_API_URL=http://192.168.1.36:9527 # VITE_BASE_API_URL=http://localhost:5173

View File

@@ -22,6 +22,7 @@
"@capacitor/status-bar": "8.0.0", "@capacitor/status-bar": "8.0.0",
"@ionic/vue": "^8.7.11", "@ionic/vue": "^8.7.11",
"@ionic/vue-router": "^8.7.11", "@ionic/vue-router": "^8.7.11",
"@vueuse/core": "^14.1.0",
"better-auth": "^1.4.6", "better-auth": "^1.4.6",
"ionicons": "^8.0.13", "ionicons": "^8.0.13",
"vue": "^3.5.25", "vue": "^3.5.25",
@@ -33,6 +34,7 @@
"@types/node": "^24.10.2", "@types/node": "^24.10.2",
"@vitejs/plugin-legacy": "^7.2.1", "@vitejs/plugin-legacy": "^7.2.1",
"@vitejs/plugin-vue": "^6.0.2", "@vitejs/plugin-vue": "^6.0.2",
"@vitejs/plugin-vue-jsx": "^5.1.2",
"@vue/eslint-config-typescript": "^14.6.0", "@vue/eslint-config-typescript": "^14.6.0",
"@vue/test-utils": "^2.4.6", "@vue/test-utils": "^2.4.6",
"cypress": "^15.7.1", "cypress": "^15.7.1",

146
pnpm-lock.yaml generated
View File

@@ -32,6 +32,9 @@ importers:
'@ionic/vue-router': '@ionic/vue-router':
specifier: ^8.7.11 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)) 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))
'@vueuse/core':
specifier: ^14.1.0
version: 14.1.0(vue@3.5.25(typescript@5.9.3))
better-auth: better-auth:
specifier: ^1.4.6 specifier: ^1.4.6
version: 1.4.6(vue@3.5.25(typescript@5.9.3)) version: 1.4.6(vue@3.5.25(typescript@5.9.3))
@@ -60,6 +63,9 @@ importers:
'@vitejs/plugin-vue': '@vitejs/plugin-vue':
specifier: ^6.0.2 specifier: ^6.0.2
version: 6.0.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3)) version: 6.0.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))
'@vitejs/plugin-vue-jsx':
specifier: ^5.1.2
version: 5.1.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))
'@vue/eslint-config-typescript': '@vue/eslint-config-typescript':
specifier: ^14.6.0 specifier: ^14.6.0
version: 14.6.0(eslint-plugin-vue@10.6.2(@stylistic/eslint-plugin@5.6.1(eslint@9.39.1))(@typescript-eslint/parser@8.49.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1)))(eslint@9.39.1)(typescript@5.9.3) version: 14.6.0(eslint-plugin-vue@10.6.2(@stylistic/eslint-plugin@5.6.1(eslint@9.39.1))(@typescript-eslint/parser@8.49.0(eslint@9.39.1)(typescript@5.9.3))(eslint@9.39.1)(vue-eslint-parser@10.2.0(eslint@9.39.1)))(eslint@9.39.1)(typescript@5.9.3)
@@ -95,7 +101,7 @@ importers:
version: 5.9.3 version: 5.9.3
unplugin-auto-import: unplugin-auto-import:
specifier: ^20.3.0 specifier: ^20.3.0
version: 20.3.0 version: 20.3.0(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3)))
unplugin-vue-components: unplugin-vue-components:
specifier: ^30.0.0 specifier: ^30.0.0
version: 30.0.0(@babel/parser@7.28.5)(vue@3.5.25(typescript@5.9.3)) version: 30.0.0(@babel/parser@7.28.5)(vue@3.5.25(typescript@5.9.3))
@@ -337,6 +343,18 @@ packages:
peerDependencies: peerDependencies:
'@babel/core': ^7.0.0-0 '@babel/core': ^7.0.0-0
'@babel/plugin-syntax-jsx@7.27.1':
resolution: {integrity: sha512-y8YTNIeKoyhGd9O0Jiyzyyqk8gdjnumGTQPsz0xOZOQ2RmkVJeZ1vmmfIvFEKqucBG6axJGBZDE/7iI5suUI/w==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
'@babel/plugin-syntax-typescript@7.27.1':
resolution: {integrity: sha512-xfYCBMxveHrRMnAWl1ZlPXOZjzkN82THFvLhQhFXFt81Z5HnN+EtUkZhv/zcKpmT3fzmWZB0ywiBrbC3vogbwQ==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
'@babel/plugin-syntax-unicode-sets-regex@7.18.6': '@babel/plugin-syntax-unicode-sets-regex@7.18.6':
resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@@ -625,6 +643,12 @@ packages:
peerDependencies: peerDependencies:
'@babel/core': ^7.0.0-0 '@babel/core': ^7.0.0-0
'@babel/plugin-transform-typescript@7.28.5':
resolution: {integrity: sha512-x2Qa+v/CuEoX7Dr31iAfr0IhInrVOWZU/2vJMJ00FOR/2nM0BcBEclpaf9sWCDc+v5e9dMrhSH8/atq/kX7+bA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
'@babel/plugin-transform-unicode-escapes@7.27.1': '@babel/plugin-transform-unicode-escapes@7.27.1':
resolution: {integrity: sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==} resolution: {integrity: sha512-Ysg4v6AmF26k9vpfFuTZg8HRfVWzsh1kVfowA23y9j/Gu6dOuahdUVhkLqpObp3JIv27MLSii6noRnuKN8H0Mg==}
engines: {node: '>=6.9.0'} engines: {node: '>=6.9.0'}
@@ -1356,6 +1380,9 @@ packages:
'@types/unist@3.0.3': '@types/unist@3.0.3':
resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}
'@types/web-bluetooth@0.0.21':
resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==}
'@types/yauzl@2.10.3': '@types/yauzl@2.10.3':
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
@@ -1425,6 +1452,13 @@ packages:
terser: ^5.16.0 terser: ^5.16.0
vite: ^7.0.0 vite: ^7.0.0
'@vitejs/plugin-vue-jsx@5.1.2':
resolution: {integrity: sha512-3a2BOryRjG/Iih87x87YXz5c8nw27eSlHytvSKYfp8ZIsp5+FgFQoKeA7k2PnqWpjJrv6AoVTMnvmuKUXb771A==}
engines: {node: ^20.19.0 || >=22.12.0}
peerDependencies:
vite: ^5.0.0 || ^6.0.0 || ^7.0.0
vue: ^3.0.0
'@vitejs/plugin-vue@6.0.2': '@vitejs/plugin-vue@6.0.2':
resolution: {integrity: sha512-iHmwV3QcVGGvSC1BG5bZ4z6iwa1SOpAPWmnjOErd4Ske+lZua5K9TtAVdx0gMBClJ28DViCbSmZitjWZsWO3LA==} resolution: {integrity: sha512-iHmwV3QcVGGvSC1BG5bZ4z6iwa1SOpAPWmnjOErd4Ske+lZua5K9TtAVdx0gMBClJ28DViCbSmZitjWZsWO3LA==}
engines: {node: ^20.19.0 || >=22.12.0} engines: {node: ^20.19.0 || >=22.12.0}
@@ -1483,6 +1517,22 @@ packages:
'@volar/typescript@2.4.26': '@volar/typescript@2.4.26':
resolution: {integrity: sha512-N87ecLD48Sp6zV9zID/5yuS1+5foj0DfuYGdQ6KHj/IbKvyKv1zNX6VCmnKYwtmHadEO6mFc2EKISiu3RDPAvA==} resolution: {integrity: sha512-N87ecLD48Sp6zV9zID/5yuS1+5foj0DfuYGdQ6KHj/IbKvyKv1zNX6VCmnKYwtmHadEO6mFc2EKISiu3RDPAvA==}
'@vue/babel-helper-vue-transform-on@2.0.1':
resolution: {integrity: sha512-uZ66EaFbnnZSYqYEyplWvn46GhZ1KuYSThdT68p+am7MgBNbQ3hphTL9L+xSIsWkdktwhPYLwPgVWqo96jDdRA==}
'@vue/babel-plugin-jsx@2.0.1':
resolution: {integrity: sha512-a8CaLQjD/s4PVdhrLD/zT574ZNPnZBOY+IhdtKWRB4HRZ0I2tXBi5ne7d9eCfaYwp5gU5+4KIyFTV1W1YL9xZA==}
peerDependencies:
'@babel/core': ^7.0.0-0
peerDependenciesMeta:
'@babel/core':
optional: true
'@vue/babel-plugin-resolve-type@2.0.1':
resolution: {integrity: sha512-ybwgIuRGRRBhOU37GImDoWQoz+TlSqap65qVI6iwg/J7FfLTLmMf97TS7xQH9I7Qtr/gp161kYVdhr1ZMraSYQ==}
peerDependencies:
'@babel/core': ^7.0.0-0
'@vue/compiler-core@3.5.25': '@vue/compiler-core@3.5.25':
resolution: {integrity: sha512-vay5/oQJdsNHmliWoZfHPoVZZRmnSWhug0BYT34njkYTPqClh3DNWLkZNJBVSjsNMrg0CCrBfoKkjZQPM/QVUw==} resolution: {integrity: sha512-vay5/oQJdsNHmliWoZfHPoVZZRmnSWhug0BYT34njkYTPqClh3DNWLkZNJBVSjsNMrg0CCrBfoKkjZQPM/QVUw==}
@@ -1537,6 +1587,19 @@ packages:
'@vue/test-utils@2.4.6': '@vue/test-utils@2.4.6':
resolution: {integrity: sha512-FMxEjOpYNYiFe0GkaHsnJPXFHxQ6m4t8vI/ElPGpMWxZKpmRvQ33OIrvRXemy6yha03RxhOlQuy+gZMC3CQSow==} resolution: {integrity: sha512-FMxEjOpYNYiFe0GkaHsnJPXFHxQ6m4t8vI/ElPGpMWxZKpmRvQ33OIrvRXemy6yha03RxhOlQuy+gZMC3CQSow==}
'@vueuse/core@14.1.0':
resolution: {integrity: sha512-rgBinKs07hAYyPF834mDTigH7BtPqvZ3Pryuzt1SD/lg5wEcWqvwzXXYGEDb2/cP0Sj5zSvHl3WkmMELr5kfWw==}
peerDependencies:
vue: ^3.5.0
'@vueuse/metadata@14.1.0':
resolution: {integrity: sha512-7hK4g015rWn2PhKcZ99NyT+ZD9sbwm7SGvp7k+k+rKGWnLjS/oQozoIZzWfCewSUeBmnJkIb+CNr7Zc/EyRnnA==}
'@vueuse/shared@14.1.0':
resolution: {integrity: sha512-EcKxtYvn6gx1F8z9J5/rsg3+lTQnvOruQd8fUecW99DCK04BkWD7z5KQ/wTAx+DazyoEE9dJt/zV8OIEQbM6kw==}
peerDependencies:
vue: ^3.5.0
'@xmldom/xmldom@0.8.11': '@xmldom/xmldom@0.8.11':
resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==} resolution: {integrity: sha512-cQzWCtO6C8TQiYl1ruKNn2U6Ao4o4WBBcbL61yJl84x+j5sOWWFU9X7DpND8XZG3daDppSsigMdfAIl2upQBRw==}
engines: {node: '>=10.0.0'} engines: {node: '>=10.0.0'}
@@ -4316,6 +4379,16 @@ snapshots:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-syntax-jsx@7.27.1(@babel/core@7.28.5)':
dependencies:
'@babel/core': 7.28.5
'@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-syntax-typescript@7.27.1(@babel/core@7.28.5)':
dependencies:
'@babel/core': 7.28.5
'@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.28.5)': '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.28.5)':
dependencies: dependencies:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
@@ -4632,6 +4705,17 @@ snapshots:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
'@babel/helper-plugin-utils': 7.27.1 '@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-transform-typescript@7.28.5(@babel/core@7.28.5)':
dependencies:
'@babel/core': 7.28.5
'@babel/helper-annotate-as-pure': 7.27.3
'@babel/helper-create-class-features-plugin': 7.28.5(@babel/core@7.28.5)
'@babel/helper-plugin-utils': 7.27.1
'@babel/helper-skip-transparent-expression-wrappers': 7.27.1
'@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5)
transitivePeerDependencies:
- supports-color
'@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.28.5)': '@babel/plugin-transform-unicode-escapes@7.27.1(@babel/core@7.28.5)':
dependencies: dependencies:
'@babel/core': 7.28.5 '@babel/core': 7.28.5
@@ -5412,6 +5496,8 @@ snapshots:
'@types/unist@3.0.3': {} '@types/unist@3.0.3': {}
'@types/web-bluetooth@0.0.21': {}
'@types/yauzl@2.10.3': '@types/yauzl@2.10.3':
dependencies: dependencies:
'@types/node': 24.10.2 '@types/node': 24.10.2
@@ -5527,6 +5613,18 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@vitejs/plugin-vue-jsx@5.1.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))':
dependencies:
'@babel/core': 7.28.5
'@babel/plugin-syntax-typescript': 7.27.1(@babel/core@7.28.5)
'@babel/plugin-transform-typescript': 7.28.5(@babel/core@7.28.5)
'@rolldown/pluginutils': 1.0.0-beta.50
'@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.28.5)
vite: 7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2)
vue: 3.5.25(typescript@5.9.3)
transitivePeerDependencies:
- supports-color
'@vitejs/plugin-vue@6.0.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))': '@vitejs/plugin-vue@6.0.2(vite@7.2.7(@types/node@24.10.2)(terser@5.44.1)(yaml@2.8.2))(vue@3.5.25(typescript@5.9.3))':
dependencies: dependencies:
'@rolldown/pluginutils': 1.0.0-beta.50 '@rolldown/pluginutils': 1.0.0-beta.50
@@ -5595,6 +5693,35 @@ snapshots:
path-browserify: 1.0.1 path-browserify: 1.0.1
vscode-uri: 3.1.0 vscode-uri: 3.1.0
'@vue/babel-helper-vue-transform-on@2.0.1': {}
'@vue/babel-plugin-jsx@2.0.1(@babel/core@7.28.5)':
dependencies:
'@babel/helper-module-imports': 7.27.1
'@babel/helper-plugin-utils': 7.27.1
'@babel/plugin-syntax-jsx': 7.27.1(@babel/core@7.28.5)
'@babel/template': 7.27.2
'@babel/traverse': 7.28.5
'@babel/types': 7.28.5
'@vue/babel-helper-vue-transform-on': 2.0.1
'@vue/babel-plugin-resolve-type': 2.0.1(@babel/core@7.28.5)
'@vue/shared': 3.5.25
optionalDependencies:
'@babel/core': 7.28.5
transitivePeerDependencies:
- supports-color
'@vue/babel-plugin-resolve-type@2.0.1(@babel/core@7.28.5)':
dependencies:
'@babel/code-frame': 7.27.1
'@babel/core': 7.28.5
'@babel/helper-module-imports': 7.27.1
'@babel/helper-plugin-utils': 7.27.1
'@babel/parser': 7.28.5
'@vue/compiler-sfc': 3.5.25
transitivePeerDependencies:
- supports-color
'@vue/compiler-core@3.5.25': '@vue/compiler-core@3.5.25':
dependencies: dependencies:
'@babel/parser': 7.28.5 '@babel/parser': 7.28.5
@@ -5681,6 +5808,19 @@ snapshots:
js-beautify: 1.15.4 js-beautify: 1.15.4
vue-component-type-helpers: 2.2.12 vue-component-type-helpers: 2.2.12
'@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3))':
dependencies:
'@types/web-bluetooth': 0.0.21
'@vueuse/metadata': 14.1.0
'@vueuse/shared': 14.1.0(vue@3.5.25(typescript@5.9.3))
vue: 3.5.25(typescript@5.9.3)
'@vueuse/metadata@14.1.0': {}
'@vueuse/shared@14.1.0(vue@3.5.25(typescript@5.9.3))':
dependencies:
vue: 3.5.25(typescript@5.9.3)
'@xmldom/xmldom@0.8.11': {} '@xmldom/xmldom@0.8.11': {}
abbrev@2.0.0: {} abbrev@2.0.0: {}
@@ -8117,7 +8257,7 @@ snapshots:
universalify@2.0.1: {} universalify@2.0.1: {}
unplugin-auto-import@20.3.0: unplugin-auto-import@20.3.0(@vueuse/core@14.1.0(vue@3.5.25(typescript@5.9.3))):
dependencies: dependencies:
local-pkg: 1.1.2 local-pkg: 1.1.2
magic-string: 0.30.21 magic-string: 0.30.21
@@ -8125,6 +8265,8 @@ snapshots:
unimport: 5.5.0 unimport: 5.5.0
unplugin: 2.3.11 unplugin: 2.3.11
unplugin-utils: 0.3.1 unplugin-utils: 0.3.1
optionalDependencies:
'@vueuse/core': 14.1.0(vue@3.5.25(typescript@5.9.3))
unplugin-utils@0.3.1: unplugin-utils@0.3.1:
dependencies: dependencies:

View File

@@ -4,7 +4,9 @@ import { createAuthClient } from "better-auth/vue";
import SignupContent from "./components/signup.vue"; import SignupContent from "./components/signup.vue";
export const authClient = createAuthClient({ export const authClient = createAuthClient({
baseURL: import.meta.env.VITE_BASE_API_URL, // The base URL of your auth server fetchOptions: {
credentials: "include",
},
plugins: [emailOTPClient()], plugins: [emailOTPClient()],
}); });

View File

@@ -1,6 +1,7 @@
import path from "node:path"; import path from "node:path";
import legacy from "@vitejs/plugin-legacy"; import legacy from "@vitejs/plugin-legacy";
import vue from "@vitejs/plugin-vue"; import vue from "@vitejs/plugin-vue";
import jsx from "@vitejs/plugin-vue-jsx";
import autoImport from "unplugin-auto-import/vite"; import autoImport from "unplugin-auto-import/vite";
import { IonicResolver } from "unplugin-vue-components/resolvers"; import { IonicResolver } from "unplugin-vue-components/resolvers";
import components from "unplugin-vue-components/vite"; import components from "unplugin-vue-components/vite";
@@ -10,9 +11,11 @@ import { defineConfig } from "vite";
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
vue(), vue(),
jsx(),
legacy(), legacy(),
autoImport({ autoImport({
imports: ["vue", "vue-router"], dirs: ["src/composables", "src/utils"],
imports: ["vue", "vue-router", "@vueuse/core"],
resolvers: [IonicResolver()], resolvers: [IonicResolver()],
}), }),
components({ components({
@@ -27,5 +30,11 @@ export default defineConfig({
}, },
server: { server: {
host: true, host: true,
proxy: {
"/api": {
target: "http://192.168.1.36:9527/api",
changeOrigin: true,
},
},
}, },
}); });