Update environment configuration and enhance asset loading:
- Change development API proxy target to `https://192.168.3.233` and set base URL for recurring investment. - Introduce `.env.production` for production environment with similar settings. - Modify `loadExchangeAssets` to support pagination and scrolling for asset loading, improving user experience. - Update related documentation and internationalization files for new features.
This commit is contained in:
+26
-16
@@ -5,14 +5,24 @@ import Components from 'unplugin-vue-components/vite'
|
||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
|
||||
const DEFAULT_PROXY_TARGET = 'http://192.168.3.230:18000'
|
||||
const DEFAULT_PROXY_TARGET = 'https://192.168.3.233'
|
||||
|
||||
/** Vite `base`:与 `VITE_BASE_URL` 对齐,供 `import.meta.env.BASE_URL` 与 Vue Router 使用 */
|
||||
function resolveViteBase(raw: string | undefined): string {
|
||||
const trimmed = (raw ?? '/').trim()
|
||||
if (!trimmed || trimmed === '/') return '/'
|
||||
const withLeading = trimmed.startsWith('/') ? trimmed : `/${trimmed}`
|
||||
return withLeading.endsWith('/') ? withLeading : `${withLeading}/`
|
||||
}
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const proxyTarget = (env.VITE_API_PROXY_TARGET || DEFAULT_PROXY_TARGET).trim().replace(/\/+$/, '')
|
||||
const base = resolveViteBase(env.VITE_BASE_URL)
|
||||
|
||||
return {
|
||||
base,
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
@@ -35,21 +45,21 @@ export default defineConfig(({ mode }) => {
|
||||
open: true,
|
||||
allowedHosts: true,
|
||||
proxy: {
|
||||
'/base': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
'/trade': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
'/product': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
},
|
||||
// '/base': {
|
||||
// target: proxyTarget,
|
||||
// changeOrigin: true,
|
||||
// secure: false,
|
||||
// },
|
||||
// '/trade': {
|
||||
// target: proxyTarget,
|
||||
// changeOrigin: true,
|
||||
// secure: false,
|
||||
// },
|
||||
// '/product': {
|
||||
// target: proxyTarget,
|
||||
// changeOrigin: true,
|
||||
// secure: false,
|
||||
// },
|
||||
'/api': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in New Issue
Block a user