提交 9237adfe 编写于 作者: KK's avatar KK

解决跨域请求

上级 bdd6ac66
......@@ -338,7 +338,7 @@ import { Http } from "@/ibiz-core/utils";
* 获取城市坐标
*/
public async getCityName(location:string) {
let cityInfo = await Http.getInstance().get("api/v3/geocode/regeo",{key:"f24180cec13fe7e72472dcb9fcd26c0e",location:location})
let cityInfo = await Http.getInstance().get("map/v3/geocode/regeo",{key:"f24180cec13fe7e72472dcb9fcd26c0e",location:location})
if (cityInfo && cityInfo.status === 200 && cityInfo.data) {
if(cityInfo.data.infocode == 10000 && cityInfo.data.regeocode && cityInfo.data.regeocode.addressComponent){
return cityInfo.data.regeocode.addressComponent.city.length != 0?cityInfo.data.regeocode.addressComponent.city:cityInfo.data.regeocode.addressComponent.province;
......
......@@ -19,7 +19,20 @@ module.exports = {
port: 8111,
compress: true,
disableHostCheck: true,
// proxy: "http://127.0.0.1:8080/${app.getPKGCodeName()}",
proxy: {
"/map":{
//配置跨域
target: "http://restapi.amap.com",
changOrigin:true,
pathRewrite:{
'^/map':'/'
}
},
'': {
target: "http://127.0.0.1:8080/${app.getPKGCodeName()}",
}
},
historyApiFallback: {
rewrites: [
<#if app.getAllRefPSAppViews()??>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册