From 9a5ad4f42f936fa5b36cd039a670d36e6f70a568 Mon Sep 17 00:00:00 2001
From: ZhangXianQiang <1135831638@qq.com>
Date: 星期五, 15 三月 2024 11:48:04 +0800
Subject: [PATCH] feat:交通事故指数接口对接

---
 vite.config.ts |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/vite.config.ts b/vite.config.ts
index ebceb24..0acb882 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -3,12 +3,26 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 import { resolve } from "path";
+import AutoImport from 'unplugin-auto-import/vite'
+import Components from 'unplugin-vue-components/vite'
+import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
+//https://github.com/element-plus/unplugin-element-plus/blob/HEAD/README.zh-CN.md
+import ElementPlus from 'unplugin-element-plus/vite'
 export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
 
   // const env = loadEnv(mode, process.cwd(), '')
   console.log(command, mode);
   return {
     plugins: [vue(),
+    AutoImport({
+      resolvers: [ElementPlusResolver()],
+    }),
+    Components({
+      resolvers: [ElementPlusResolver()],
+    }),
+    ElementPlus({
+      // useSource: true
+    })
     ],
     publicDir: "public",
     base: "./",
@@ -17,7 +31,13 @@
       port: 8112,
       open: false,
       strictPort: false,
-      // proxy: {}
+      proxy: {
+        '/api': {
+          target: 'http://192.168.3.87:8080',
+          changeOrigin: true,
+          rewrite: (path) => path.replace(/^\/api/, '')
+        }
+      }
     },
     resolve: {
       alias: {

--
Gitblit v1.8.0