-
- 发布到去其他
-
-
- 选择更多人看到
-
-
+
+
+
+
+
+
+
+
+
+ 发图文
+ 发布
+
+
+
+
+
+
+ 发布到去其他
+
+
+ 选择更多人看到
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
\ No newline at end of file
diff --git a/Yi.Vue3.x.Vant/vite.config.ts b/Yi.Vue3.x.Vant/vite.config.ts
index c4590c60..2be3bef5 100644
--- a/Yi.Vue3.x.Vant/vite.config.ts
+++ b/Yi.Vue3.x.Vant/vite.config.ts
@@ -1,4 +1,4 @@
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
import path from 'path'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
@@ -6,38 +6,47 @@ import { VantResolver } from 'unplugin-vue-components/resolvers';
// https://vitejs.dev/config/
-export default defineConfig({
- plugins: [vue(), Components({
- resolvers: [VantResolver()],
- }),],
- resolve: {
- // https://cn.vitejs.dev/config/#resolve-alias
- alias: {
- // 设置路径
- '~': path.resolve(__dirname, './'),
- // 设置别名
- '@': path.resolve(__dirname, './src')
- }
- },
- server: {
- port: 17000,
- host: true,
- open: true,
- // proxy: {
- // // https://cn.vitejs.dev/config/#server-proxy
- // '/dev-api': {
- // target: VITE_APP_BASE_URL,
- // changeOrigin: true,
- // rewrite: (p) => p.replace(/^\/dev-api/, ''),
- // },
+export default defineConfig(({ mode, command }) => {
+ const env = loadEnv(mode, process.cwd())
+ const { VITE_APP_ENV, VITE_APP_BASE_URL} = env
+ return {
+ plugins: [vue(), Components({
+ resolvers: [VantResolver()],
+ }),],
+ resolve: {
+ // https://cn.vitejs.dev/config/#resolve-alias
+ alias: {
+ // 设置路径
+ '~': path.resolve(__dirname, './'),
+ // 设置别名
+ '@': path.resolve(__dirname, './src')
+ }
+ },
+ server: {
+ port: 17000,
+ host: true,
+ open: true,
+
+
+ proxy: {
+ // https://cn.vitejs.dev/config/#server-proxy
+ '/dev-api': {
+ target: VITE_APP_BASE_URL,
+ changeOrigin: true,
+ rewrite: (p) => p.replace(/^\/dev-api/, ''),
+ },
+
+ '/dev-ws': {
+ target: VITE_APP_BASE_URL,
+ changeOrigin: true,
+ rewrite: (p) => p.replace(/^\/dev-ws/, ''),
+ ws: true
+ }
+
+ }
+ },
+ }
- // '/dev-ws': {
- // target: VITE_APP_BASE_URL,
- // changeOrigin: true,
- // rewrite: (p) => p.replace(/^\/dev-ws/, ''),
- // ws: true
- // }
+}
- // }
- },
-})
+)