Ver código fonte

Merge branch 'master' of https://git.nanodreamtech.com/wkw/wallet_app

wkw 1 mês atrás
pai
commit
a6b3ba14d9

+ 8 - 0
.env

@@ -0,0 +1,8 @@
+
+
+
+# development path
+VITE_DEV_PATH='https://wallet.angeltokens.io' 
+
+# production path
+VITE_PRO_PATH='https://wallet.angeltokens.io'

+ 0 - 1
android/app/capacitor.build.gradle

@@ -12,7 +12,6 @@ dependencies {
     implementation project(':aparajita-capacitor-biometric-auth')
     implementation project(':capacitor-app')
     implementation project(':capacitor-browser')
-    implementation project(':capacitor-clipboard')
     implementation project(':capacitor-device')
     implementation project(':capacitor-local-notifications')
     implementation project(':capacitor-push-notifications')

+ 76 - 0
auto-imports.d.ts

@@ -0,0 +1,76 @@
+/* eslint-disable */
+/* prettier-ignore */
+// @ts-nocheck
+// noinspection JSUnusedGlobalSymbols
+// Generated by unplugin-auto-import
+// biome-ignore lint: disable
+export {}
+declare global {
+  const EffectScope: typeof import('vue')['EffectScope']
+  const computed: typeof import('vue')['computed']
+  const createApp: typeof import('vue')['createApp']
+  const customRef: typeof import('vue')['customRef']
+  const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
+  const defineComponent: typeof import('vue')['defineComponent']
+  const effectScope: typeof import('vue')['effectScope']
+  const getCurrentInstance: typeof import('vue')['getCurrentInstance']
+  const getCurrentScope: typeof import('vue')['getCurrentScope']
+  const h: typeof import('vue')['h']
+  const inject: typeof import('vue')['inject']
+  const isProxy: typeof import('vue')['isProxy']
+  const isReactive: typeof import('vue')['isReactive']
+  const isReadonly: typeof import('vue')['isReadonly']
+  const isRef: typeof import('vue')['isRef']
+  const markRaw: typeof import('vue')['markRaw']
+  const nextTick: typeof import('vue')['nextTick']
+  const onActivated: typeof import('vue')['onActivated']
+  const onBeforeMount: typeof import('vue')['onBeforeMount']
+  const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
+  const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
+  const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
+  const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
+  const onDeactivated: typeof import('vue')['onDeactivated']
+  const onErrorCaptured: typeof import('vue')['onErrorCaptured']
+  const onMounted: typeof import('vue')['onMounted']
+  const onRenderTracked: typeof import('vue')['onRenderTracked']
+  const onRenderTriggered: typeof import('vue')['onRenderTriggered']
+  const onScopeDispose: typeof import('vue')['onScopeDispose']
+  const onServerPrefetch: typeof import('vue')['onServerPrefetch']
+  const onUnmounted: typeof import('vue')['onUnmounted']
+  const onUpdated: typeof import('vue')['onUpdated']
+  const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
+  const provide: typeof import('vue')['provide']
+  const reactive: typeof import('vue')['reactive']
+  const readonly: typeof import('vue')['readonly']
+  const ref: typeof import('vue')['ref']
+  const resolveComponent: typeof import('vue')['resolveComponent']
+  const shallowReactive: typeof import('vue')['shallowReactive']
+  const shallowReadonly: typeof import('vue')['shallowReadonly']
+  const shallowRef: typeof import('vue')['shallowRef']
+  const toRaw: typeof import('vue')['toRaw']
+  const toRef: typeof import('vue')['toRef']
+  const toRefs: typeof import('vue')['toRefs']
+  const toValue: typeof import('vue')['toValue']
+  const triggerRef: typeof import('vue')['triggerRef']
+  const unref: typeof import('vue')['unref']
+  const useAttrs: typeof import('vue')['useAttrs']
+  const useCssModule: typeof import('vue')['useCssModule']
+  const useCssVars: typeof import('vue')['useCssVars']
+  const useId: typeof import('vue')['useId']
+  const useLink: typeof import('vue-router')['useLink']
+  const useModel: typeof import('vue')['useModel']
+  const useRoute: typeof import('vue-router')['useRoute']
+  const useRouter: typeof import('vue-router')['useRouter']
+  const useSlots: typeof import('vue')['useSlots']
+  const useTemplateRef: typeof import('vue')['useTemplateRef']
+  const watch: typeof import('vue')['watch']
+  const watchEffect: typeof import('vue')['watchEffect']
+  const watchPostEffect: typeof import('vue')['watchPostEffect']
+  const watchSyncEffect: typeof import('vue')['watchSyncEffect']
+}
+// for type re-export
+declare global {
+  // @ts-ignore
+  export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
+  import('vue')
+}

+ 0 - 61
capacitor.config.json

@@ -1,61 +0,0 @@
-{
-  
-  "appId": "com.example.app", 
-  "appName": "wallet_app", 
-  "webDir": "dist",  
-
-  
-  "server": {
-    "url": "http://192.168.0.59:5173",  
-    "cleartext": true, 
-    "allowNavigation": ["*"] 
-  },
-
-  "plugins": {
-    
-    "SplashScreen": {
-      "launchShowDuration": 3000, 
-      "launchAutoHide": true,
-      "backgroundColor": "#ffffffff", 
-      "androidScaleType": "CENTER_CROP",
-      "showSpinner": false,
-      "androidSpinnerStyle": "large", 
-      "iosSpinnerStyle": "small", 
-      "spinnerColor": "#999999", 
-      "splashFullScreen": true, 
-      "splashImmersive": true, 
-      "androidSplashResourceName": "splash", 
-      "useDialog": false 
-    },
-
-    "CapacitorAssets": {
-      "iconBackgroundColor": "#ffffff"
-    },
-    "plugins": {
-      "PushNotifications": {
-        "presentationOptions": ["badge", "sound", "alert"]
-      }
-    }
-  },
-
-  "assets": {
-    "splash": {
-      "src": "assets/splash.png", 
-      "android": true,
-      "ios": true 
-    }
-  },
-
-  
-  "ios": {
-    "scheme": "App",
-    "allowsInlineMediaPlayback": true, 
-    "scrollEnabled": true, 
-    "preferredContentMode": "Aspect Fit" 
-  },
-
-  "android": {
-    "allowMixedContent": true, 
-    "useLegacyBridge": true 
-  }
-}

+ 71 - 0
capacitor.config.ts

@@ -0,0 +1,71 @@
+import { CapacitorConfig } from '@capacitor/cli';
+
+const config: CapacitorConfig = {
+  appId: 'com.example.app',
+  appName: 'wallet_app',
+  webDir: 'dist',
+
+  // 开发服务器配置(热更新用)
+  server: {
+    url: 'http://192.168.0.59:5173',
+    cleartext: true,          // 允许HTTP明文通信(仅开发环境)
+    allowNavigation: ['*']    // 允许任意URL导航
+  }, 
+  // 插件配置
+  plugins: {
+    SplashScreen: {
+      launchShowDuration: 3000,
+      launchAutoHide: true,
+      backgroundColor: '#ffffffff',  // ARGB格式白色背景
+      androidScaleType: 'CENTER_CROP',
+      showSpinner: false,
+      androidSpinnerStyle: 'large',
+      iosSpinnerStyle: 'small',
+      spinnerColor: '#999999',
+      splashFullScreen: true,
+      splashImmersive: true,
+      androidSplashResourceName: 'splash',
+      useDialog: false
+    },
+
+    CapacitorAssets: {
+      iconBackgroundColor: '#ffffff'  // 应用图标背景色
+    },
+
+    // 注意:原JSON中嵌套了重复的"plugins"键,已修正
+    PushNotifications: {
+      presentationOptions: ['badge', 'sound', 'alert']
+    }
+  },
+
+  // 资源文件配置
+  // assets: {
+  //   splash: {
+  //     src: 'assets/splash.png',  // 启动图路径
+  //     android: true,
+  //     ios: true
+  //   }
+  // },
+
+  // iOS专属配置
+  ios: {
+    scheme: 'App',
+    scrollEnabled: true,
+  },
+
+  // Android专属配置
+  android: {
+    allowMixedContent: true,     // 允许混合HTTP/HTTPS内容
+    useLegacyBridge: true,       // 使用旧版桥接(兼容性)
+
+    // 签名证书配置(建议通过环境变量注入敏感信息)
+    buildOptions: {
+      keystorePath: 'f62.keystore',
+      keystoreAlias: 'f62', //  // 生成时指定的别名
+      keystorePassword:  'LkSvN1Ys',  // 从环境变量读取
+      keystoreAliasPassword:   'LkSvN1Ys'
+    }
+  }
+};
+
+export default config;

+ 1 - 1
jsconfig.json

@@ -6,6 +6,6 @@
     },
     "allowSyntheticDefaultImports": true
   },
-  "include": ["src/**/*.js", "src/**/*.ts", "src/**/*.vue", "src/**/*.tsx"],
+  "include": ["src/**/*.js", "src/**/*.ts", "src/**/*.vue", "src/**/*.tsx", "capacitor.config.ts"],
   "exclude": ["node_modules", "dist"]
 }

+ 3 - 3
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "type": "module",
   "scripts": {
-    "dev": "vite",
+    "dev": "vite --host",
     "s": "npx cap sync",
     "a": "npx cap run android --live-reload --host=192.168.0.59 --port=5173",
     "app": "npx cap run android --live-reload --host=192.168.0.70 --port=5173",
@@ -12,7 +12,7 @@
     "android": "npx cap add android && npx cap sync",
     "android:clean": "(cd android && ./gradlew clean)",
     "build": "vite build && npx cap copy",
-    "build:apk": "vite build && npx cap copy && (cd android && ./gradlew build)",
+    "build:apk": "vite build && npx cap copy && (cd android && ./gradlew assembleRelease)",
     "build:apk:windows": "vite build && npx cap copy && cd android && .\\gradlew.bat build",
     "icon": "npx capacitor-assets generate --android",
     "preview": "vite preview"
@@ -23,7 +23,6 @@
     "@capacitor/app": "^7.0.1",
     "@capacitor/browser": "^7.0.1",
     "@capacitor/cli": "^7.2.0",
-    "@capacitor/clipboard": "^7.0.1",
     "@capacitor/core": "^7.2.0",
     "@capacitor/device": "^7.0.1",
     "@capacitor/ios": "^7.2.0",
@@ -43,6 +42,7 @@
     "pinia": "^3.0.1",
     "qrcode.vue": "^3.6.0",
     "sharp": "^0.34.2",
+    "typescript": "^5.8.3",
     "vant": "^4.9.20",
     "vue": "^3.5.13",
     "vue-i18n": "^11.1.9",

+ 4 - 1
src/api/axios.js

@@ -1,4 +1,5 @@
 import axios from "axios";
+import { Capacitor } from '@capacitor/core';
 import { showNotify } from 'vant';
 import { useSystemStore } from "@/stores/modules/systemStore";
 import { fn_logout } from "@/utils";
@@ -7,8 +8,10 @@ import { fn_logout } from "@/utils";
 const requestMap = new Map();
 const requestCountMap = new Map(); // 用于记录请求的次数
 
+const isNativeApp = Capacitor.isNativePlatform();
+
 const axiosInstance = axios.create({
-  baseURL: import.meta.env.BASE_URL + "api", // 设置 API 基础 URL
+  baseURL: (isNativeApp ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH) + "/api", // 设置 API 基础 URL
   timeout: 300000, // 设置请求超时时间
 });
 

+ 4 - 0
src/assets/css/global.less

@@ -26,6 +26,10 @@
   }
 }
 
+.van-notify {
+  top: 64px !important;
+}
+
 
 
 .fn-head-bg(@height: 197px){

BIN
src/assets/img/logo.png


BIN
src/assets/img/wallet-bg.png


BIN
src/assets/img/wallet-bg1.png


Diferenças do arquivo suprimidas por serem muito extensas
+ 17 - 0
src/assets/svg/wallet-bg.svg


+ 2 - 2
src/hooks/use-copy.js

@@ -1,4 +1,4 @@
-import { onUnmounted } from 'vue';
+ 
 import ClipboardJS from 'clipboard';
 /**
  * 复制文本
@@ -6,7 +6,7 @@ import ClipboardJS from 'clipboard';
 export function useCopy(_class = '.im-copy-btn') {
   const clipboard = new ClipboardJS(_class);
   clipboard.on('success', (e) => {
-    $msg({type: 'success', message: '已复制到剪切板!'});
+   $msg($t("login.CopiedToClipboard"));
   });
   onUnmounted(() => {
     clipboard.destroy();

+ 1 - 0
src/i18n/zhHk/login.js

@@ -20,4 +20,5 @@ export default {
   CopyMnemonic: "複製助記詞",
 
   CopiedToClipboard: "已複製到剪貼板",
+  CopyFailed: "複製失敗",
 };

+ 4 - 1
src/plugins/storage.js

@@ -1,8 +1,11 @@
 
 import { showNotify } from 'vant';
 import { i18n } from "@/i18n";
+ 
 export function setup() {
-  window["$msg"] = showNotify 
+  window["$msg"] = (msg, type = 'warning')=>{
+    showNotify({ type:type, message: msg, background:"transparent", color:"#4765dd", top: 150})
+  } 
 
   window["$t"] = i18n.global.t;
 }

+ 1 - 1
src/router/system.js

@@ -4,7 +4,7 @@ export const systemRoutes = [
   {
     path: "/",
     name: "main",
-    redirect: "login",
+    redirect: "wallet",
     component: LAYOUT,
     children: [
       {

+ 1 - 2
src/views/dapp/index.vue

@@ -50,8 +50,7 @@
   </div>
 </template>
 
-<script setup>
-import { ref } from "vue";
+<script setup> 
 
 const images = [
   "https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg",

+ 49 - 48
src/views/login/backupMnemonic/index.vue

@@ -1,64 +1,66 @@
 <template>
-  <div class="container">  
+  <div class="container">
     <div class="tag-container">
-      <van-tag v-for="item in walletData.words" :key="item" plain type="primary"   text-color="#4765DD">{{ item }}</van-tag>
+      <van-tag
+        v-for="item in walletData.words"
+        :key="item"
+        plain
+        type="primary"
+        text-color="#4765DD"
+        >{{ item }}</van-tag
+      >
     </div>
 
-
-
-     <div class="button-group"  >
-
-      <a class="button-group-mnemonic  a-link" @click="copyText" > {{  $t('login.CopyMnemonic')  }}</a>
+    <div class="button-group">
+      <a class="button-group-mnemonic a-link im-copy-btn" :data-clipboard-text="walletData.words">
+        {{ $t("login.CopyMnemonic") }}</a
+      >
       <van-button round block type="primary" native-type="submit" @click="next">
         {{ $t("login.BackupComplete") }}
       </van-button>
     </div>
-
   </div>
 </template>
 
-<script setup>
-import { Clipboard } from '@capacitor/clipboard';
+<script setup>  
 import { createAccent } from "@/api/path/login.api";
 import { useSystemStore } from "@/stores/modules/systemStore";
 import { useWalletAuth } from "@/composables/useWalletAuth";
 
+// 一键复制文本
+import { useCopy } from '@/hooks/use-copy.js';
+useCopy();
+
+
+const router = useRouter();
 
 const systemStore = useSystemStore();
-const { 
-  authState, 
-  loginWithPrivateKey, 
-  loginWithStorage, 
-  logout, 
+const {
+  authState,
+  loginWithPrivateKey,
+  loginWithStorage,
+  logout,
   hasStoredWallet,
-  getBalance
-} = useWalletAuth()
+  getBalance,
+} = useWalletAuth();
 
-const walletData = ref({})
+const walletData = ref({});
 
 const next = async () => {
- 
   // 登录
-  const data = await loginWithPrivateKey(systemStore.getWallet.privateKey.trim())
-  console.log("data=", data)
-  // 
-  const res = await getBalance()
-  console.log("res=", res)
-}
-
-
-const copyText = async () => {
-  await Clipboard.write({
-    string: walletData.value.words
-  }); 
-  $msg({type: 'success', message: $t("login.CopiedToClipboard")});
+  const data = await loginWithPrivateKey(
+    systemStore.getWallet.privateKey.trim()
+  );  
+  router.push({
+    path:"/me"
+  })
 };
-
-
+ 
+ 
 
 onMounted(async () => {
   const { data } = await createAccent({});
-  walletData.value =  JSON.parse(atob(data.content) ) 
+  walletData.value = JSON.parse(atob(data.content));
   systemStore.setStateValue({
     key: "wallet",
     value: {
@@ -67,38 +69,37 @@ onMounted(async () => {
     },
     localStorage: true,
   });
-})
+});
 </script>
 
 <style scoped lang="less">
- 
-.tag-container{
-  margin-top: 3px; 
+.tag-container {
+  margin-top: 3px;
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   grid-gap: 16px;
   padding: 27px;
-  .van-tag{
+  .van-tag {
     width: 87px;
     height: 33px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 4px;
-  } 
-  .van-tag--plain{
-    background: #ECEFFC;
+  }
+  .van-tag--plain {
+    background: #eceffc;
   }
 }
 
-.button-group{
-  margin: 33px 17px 0 17px; 
+.button-group {
+  margin: 33px 17px 0 17px;
   display: flex;
   flex-direction: column;
   align-items: center;
-  .button-group-mnemonic{
-    font-size: 14px; 
+  .button-group-mnemonic {
+    font-size: 14px;
     margin-bottom: 21px;
   }
 }
-</style>
+</style>

+ 4 - 4
src/views/login/createWallet/index.vue

@@ -73,8 +73,8 @@ const form = ref({});
 
 
 const onSubmit = ()=>{
-  if(form.value.password !== form.value.confirmPassword){
-    $msg({ type: 'warning', message: $t("form.InconsistentPasswords") })
+  if(form.value.password !== form.value.confirmPassword){ 
+    $msg($t("form.InconsistentPasswords"));
     return 
   }
   let data = _.cloneDeep(form.value)
@@ -84,9 +84,9 @@ const onSubmit = ()=>{
     value: data,
     localStorage: true,
   });
-
+console.log(data)
   router.push({
-    name: "backupMnemonic",
+    path: "/backupMnemonic",
   });
 }
 

+ 36 - 11
src/views/wallet/index.vue

@@ -1,6 +1,7 @@
 <template>
     <div class="container">
-      <div class="bg-img"></div>
+      <!-- <div class="bg-img"></div> -->
+      <svg-icon name="wallet-bg" class="bg-img" />
       <div class="user-info-body">
         <div class="user-info-lf">
           <van-image
@@ -26,14 +27,14 @@
         </div>
       </div>
       <div class="amount">
-        <div>
+        <div class="amount-item-box">
           <div>Total assets</div>
           <div class="amount-item">
             <div class="item-text">
               <svg-icon class="my" style="width: 28px; height: 28px;" name="my" />
               <div>{{isShow?'2,536.00':'****'}}</div>
             </div>
-            <svg-icon style="width: 16px; height: 16px;" :name="isShow?'eyes':'seyes'" @click="isShow = !isShow"/>
+            <svg-icon  style="width: 16px; height: 16px;" :name="isShow?'eyes':'seyes'" @click="isShow = !isShow"/>
           </div>
         </div>
         <svg-icon style="width: 24px; height: 24px;" name="right" @click="goToPage('walletDetail')"/>
@@ -196,12 +197,11 @@
     display: flex;
     flex-direction: column;
     height: calc(100vh - 50px);
-    .bg-img{
-      background: url('@/assets/img/wallet-bg.png') no-repeat;
-      background-size: 100% 100%;
-      height: 284px;
+    .bg-img{ 
+      height: 286px;
       width: 100%;
       position: absolute;
+      left: 0;
       z-index: -1;
     }
     .user-info-body{
@@ -251,12 +251,14 @@
         }
       }
     }
-    .amount{
-      background: url('@/assets/img/wallet-bg1.png') no-repeat;
+    .amount{ 
       height: 102px;
-      background-size: 100% 100%;
+      background-color: rgba(242, 242, 242, 0.2);
+      backdrop-filter: blur(3px);  
+      -webkit-backdrop-filter: blur(3px);  
+      border-radius: 15px;
       margin: 0 17px 23px;
-      padding: 21px 21px 27px 27px;
+      box-shadow:0 7px 10px #15277031;
       box-sizing: border-box;
       display: flex;
       align-items: center;
@@ -265,6 +267,27 @@
       font-weight: 400;
       font-size: 15px;
       color: #FFFFFF;
+      &:before { 
+        height: calc(100% - 4px);
+        width: calc(100% - 4px);
+        content: "";
+        position: absolute;
+        inset: 0;
+        z-index: -1;
+        padding: 2px; /* 边框宽度 */
+        background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.1) 50%,  rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0.6) 100%);//linear-gradient(135deg, #ffffff64, #ffffff2e); /* 渐变方向可调 */
+        -webkit-mask: 
+          linear-gradient(#fff 0 0) content-box, 
+          linear-gradient(#fff 0 0);
+        -webkit-mask-composite: xor;
+        mask-composite: exclude;
+        border-radius: 15px; /* 必须和父元素一致 */
+        pointer-events: none; /* 避免遮挡点击 */
+
+      }
+      .amount-item-box{
+        margin: 21px 21px 27px 27px;
+      }
       .amount-item{
         margin-top: 7px;
         font-weight: 600;
@@ -282,6 +305,8 @@
         }
       }
     }
+
+  
     .card-box{
       background: #FFFFFF;
       box-shadow: 0px 4px 8px -2px rgba(25,75,137,0.25);

+ 64 - 67
vite.config.js

@@ -1,83 +1,80 @@
 import { fileURLToPath, URL } from "node:url";
-import fs from 'node:fs';
-
-import { defineConfig } from "vite";
+import { defineConfig, loadEnv } from "vite";
 import vue from "@vitejs/plugin-vue";
 import vueDevTools from "vite-plugin-vue-devtools";
 import vueJsx from "@vitejs/plugin-vue-jsx";
 import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
-import { codeInspectorPlugin } from 'code-inspector-plugin';
-import AutoImport from 'unplugin-auto-import/vite'
+import { codeInspectorPlugin } from "code-inspector-plugin";
+import AutoImport from "unplugin-auto-import/vite";
 
-import { resolve } from "path"; 
+import { resolve } from "path";
 
 // https://vite.dev/config/
-export default defineConfig({
-  base: "./",
-  plugins: [
-    vue(), 
-    vueJsx(),
-    AutoImport({
-      imports:[
-        'vue',
-        'vue-router'
-      ]
-    }),
-    // vueDevTools(),
-    createSvgIconsPlugin({
-      // 指定需要缓存的图标文件夹
-      iconDirs: [ resolve(process.cwd(), "src/assets/svg")],
-      // 指定symbolId格式
-      symbolId: "icon-[dir]-[name]",
-    }),
-    codeInspectorPlugin({
-      bundler: 'vite',
-    }),
-  ],
-  resolve: {
-    alias: {
-      "@": fileURLToPath(new URL("./src", import.meta.url)),
+export default defineConfig(({ mode }) => {
+  const env = loadEnv(mode, process.cwd());
+  return {
+    base: "./",
+    plugins: [
+      vue(),
+      vueJsx(),
+      AutoImport({
+        imports: ["vue", "vue-router"],
+      }),
+      // vueDevTools(),
+      createSvgIconsPlugin({
+        // 指定需要缓存的图标文件夹
+        iconDirs: [resolve(process.cwd(), "src/assets/svg")],
+        // 指定symbolId格式
+        symbolId: "icon-[dir]-[name]",
+      }),
+      codeInspectorPlugin({
+        bundler: "vite",
+      }),
+    ],
+    resolve: {
+      alias: {
+        "@": fileURLToPath(new URL("./src", import.meta.url)),
+      },
     },
-  },
-  css: {
-    // css预处理器
-    preprocessorOptions: {
-      less: {
-        charset: false, //  解决中文乱码
-        javascriptEnabled: true,
-        additionalData:
-          '@import "@/assets/css/global.less";@import "@/assets/css/theme.less";',
+    css: {
+      // css预处理器
+      preprocessorOptions: {
+        less: {
+          charset: false, //  解决中文乱码
+          javascriptEnabled: true,
+          additionalData:
+            '@import "@/assets/css/global.less";@import "@/assets/css/theme.less";',
+        },
       },
     },
-  },
-  build: {
-    minify: true, // 生产环境不生成sourcemap
-    target: "es2015",
-    // 警报门槛,限制大文件大小
-    chunkSizeWarningLimit: 5000,
-    rollupOptions: {
-      external: [], // 外部化处理那些你不想打包进库的依赖
-      // 静态资源分类打包
-      output: {
-        chunkFileNames: "static/js/[name]-[hash].js",
-        entryFileNames: "static/js/[name]-[hash].js",
-        assetFileNames: "static/[ext]/[name]-[hash].[ext]",
+    build: {
+      minify: true, // 生产环境不生成sourcemap
+      target: "es2015",
+      // 警报门槛,限制大文件大小
+      chunkSizeWarningLimit: 5000,
+      rollupOptions: {
+        external: [], // 外部化处理那些你不想打包进库的依赖
+        // 静态资源分类打包
+        output: {
+          chunkFileNames: "static/js/[name]-[hash].js",
+          entryFileNames: "static/js/[name]-[hash].js",
+          assetFileNames: "static/[ext]/[name]-[hash].[ext]",
+        },
       },
     },
-  }, 
-  server: { 
-    host: true,
-    port: 5173,
-    open: true,
-    cors: true, 
-    hmr: true,
-    proxy: {
+    server: {
+      host: true,
+      port: 5173,
+      open: true,
+      cors: true,
+      hmr: true,
+      proxy: {
         "^/api": {
-             target:"https://wallet.angeltokens.io",
-            changeOrigin: true, 
-            // secure: false, 
-        }
+          target: env.VITE_PRO_PATH,
+          changeOrigin: true,
+          // secure: false,
+        },
+      },
     },
-    
-  },
+  };
 });

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff