uniapp 配置反向代理

学习笔记 yekong 2039℃

wanjunshijiecom 2021-08-11 at 13.40.08

"h5" : {
        "devServer" : {
            "port" : 5100,
            "disableHostCheck" : true,
            "proxy" : {
                "/prod-api" : {
                    "target" : "http://xxx.xxx.com", //请求的目标域名
                    "changeOrigin" : true,
                    "secure" : false,
                    "pathRewrite" : {
                        //使用代理; 告诉他你这个连接要用代理
                        "^/prod-api" : "/prod-api"
                    }
                }
            },
            "https" : false
        },
        "domain" : "https://demo.wanjunshijie.com/kecheng",
        "router" : {
            "base" : "/kecheng/",
            "mode" : "hash"
        },
        "title" : "课程"
    }
喜欢 (4)