uni-app配置跨域

 

"h5":{
        "devServer" : {
            "https" : false,
            "proxy": {  
                "/": {  
                    "target": "http://xmxxxxpi.zxxxxxlxxun.top/api", //并非真是接口
                    "changeOrigin": true,   
                    "secure": false,
                    "pathRewrite": {
                        "^/": "/"  
                    }  
                }  
            }  
        }
    }

使用

 

注意: 需要从新编译运行

 

原文地址:https://www.cnblogs.com/tlfe/p/15104856.html