|
@@ -13,7 +13,9 @@ import Components from 'unplugin-vue-components/vite'
|
|
|
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
-export default defineConfig({
|
|
|
+export default defineConfig(({command,mode})=>{
|
|
|
+ const config = loadEnv (mode,'./');
|
|
|
+ return{
|
|
|
base:"./",
|
|
|
plugins: [
|
|
|
vue(),
|
|
@@ -42,10 +44,7 @@ export default defineConfig({
|
|
|
server: {
|
|
|
proxy: {
|
|
|
'/api': {
|
|
|
- // target: 'http://localhost:8081/', // 后端接口地址
|
|
|
- target: 'http://192.168.0.131:8187/TransServlet',
|
|
|
- //target: 'http://192.168.0.131:8087/TransServlet',
|
|
|
- // target: 'https://www.gzchain.org.cn/managersvc/', //后端接口地址
|
|
|
+ target: config.VITE_BASE_URL,//配置文件获取地址
|
|
|
secure: false, //接受使用https
|
|
|
changeOrigin: true, //允许跨域
|
|
|
ws: false, //使用websocket
|
|
@@ -70,4 +69,5 @@ export default defineConfig({
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
})
|