uniapp 浏览器调试配置代理

 "h5" : {
        "sdkConfigs" : {
            "maps" : {
                "qqmap" : {
                    "key" : "SB5BZ-***********************-KVBUC"
                }
            }
        },
        "router" : {
            "mode" : "hash",
            "base" : "./"
        },
        "devServer" : {
            //一定要写到h5 文件下面
            "proxy" : {
                "/api" : {
                    "target" : "https://*************.cn/api/",
                    "changeOrigin" : true,
                    "pathRewrite" : {"^/api" : ""}
                },
                "/Ajax" : {
                    "target" : "https://*************.cn/Ajax/",
                    "changeOrigin" : true,
                    "pathRewrite" : {"^/Ajax" : ""}
                }
                
            }
        }
    }

小程序不需要配置,app/h5/或是在浏览器端辅助调试需要配置代理

uniApp 浏览器调试返回 Please enable JavaScript to continue,一般为代理配置没有成功

posted on 2022-12-15 10:06  一名小学生呀  阅读(1197)  评论(0编辑  收藏  举报

导航