1
Surpriseplus
2022-09-16 a7e5110ef3f5fe3c9205f7d1a526b9fbbb55d826
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict'
const baseURL = require('./src/config/http.js')//基路径
 
const path = require("path");
const resolve = (dir) => {
    return path.join(__dirname, dir);
};
 
//配置允许跨域
module.exports = {
 
 
        chainWebpack: (config) => {
            config.resolve.alias.set("@", resolve("src")).set("@assets", resolve('src/assets')).set("@api", resolve("src/API"));
        },
 
    devServer: {
        open:false,
        host: '0.0.0.0', // 允许外部ip访问
        // port: 8090, // 端口u
        https: false, // 启用https
        overlay: {
            warnings: true,
            errors: true
        }, // 错误、警告在页面弹出
        proxy: {
            "/LC": {
                // target:"http://120.201.201.29:10000",
                 //target:"http://10.3.3.90:8082",
                target:"http://172.16.0.71:8089/cyService3",
                changeOrigin: true,
                pathRewrite: {
                    '/LC': ''
                }
            },
            //天气Api
            // '/weatherapi': {
            //     target: 'https://restapi.amap.com/v3/weather/weatherInfo?key=99f63f97b157cf2802b173565b21a196&city=211300',
            //     // 允许跨域
            //     changeOrigin: true,
            // },
        },
    }
}