52 lines
1.8 KiB
JavaScript
52 lines
1.8 KiB
JavaScript
import vue from "@vitejs/plugin-vue";
|
||
import Components from "unplugin-vue-components/vite";
|
||
import { VantResolver } from "unplugin-vue-components/resolvers";
|
||
import { defineConfig } from 'vite'
|
||
|
||
import path from 'path';
|
||
export default defineConfig({
|
||
plugins: [
|
||
vue(),
|
||
Components({
|
||
resolvers: [VantResolver()],
|
||
}),
|
||
],
|
||
resolve: {
|
||
alias: {
|
||
"@": path.resolve(__dirname, "src"),
|
||
"comps": path.resolve(__dirname, "src/components"),
|
||
},
|
||
},
|
||
server: {
|
||
proxy: {
|
||
// 接口地址代理
|
||
'/api/Wework': {
|
||
target: 'http://localhost:5015', // 接口的域名
|
||
secure: false, // 如果是https接口,需要配置这个参数
|
||
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
|
||
rewrite: path => path.replace(/^\/api/, '/api')
|
||
},
|
||
// 接口地址代理
|
||
'/api/Complaint': {
|
||
target: 'http://192.168.11.81:8095', // 接口的域名
|
||
secure: false, // 如果是https接口,需要配置这个参数
|
||
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
|
||
rewrite: path => path.replace(/^\/api/, '/api')
|
||
},
|
||
// 接口地址代理
|
||
'/api/live': {
|
||
target: 'http://120.77.165.155:8100', // 接口的域名
|
||
secure: false, // 如果是https接口,需要配置这个参数
|
||
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
|
||
rewrite: path => path.replace(/^\/api/, '/api')
|
||
},
|
||
// 接口地址代理
|
||
'/api': {
|
||
target: 'http://localhost:5244', // 接口的域名
|
||
secure: false, // 如果是https接口,需要配置这个参数
|
||
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
|
||
rewrite: path => path.replace(/^\/api/, '/api')
|
||
},
|
||
}
|
||
},
|
||
}) |