项目场景:
uniapp项目跨域
问题描述:
uniapp跨域问题,在开发环境中配置
manifest.json代码:
"h5" : {
"devServer" : {
"https" : true,
"port" : "8080",
"disableHostCheck" : true,
"proxy" : {
"/" : {
"target" : "http://xxxxx:5555",
"changeOrigin" : true,
"secure" : true
}
}
},
"router" : {
"base" : "./"
}
}
index.vue页面代码
uni.request({
url: '/apply/list/',
data: {
"curPage": 1,
"pageSize": 10
},
method: 'POST',
header: {
'content-type': 'application/json'
},
success: function(res) {
console.log('11', res)
}
})