1.配置DotNet文件下的proxy文件
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
mustMatch="true" xmlns="proxy.xsd">
<serverUrls>
<serverUrl url="http://ip:port/arcgis/rest/services"
matchAll="true"/>
</serverUrls>
</ProxyConfig><!-- See https://github.com/Esri/resource-proxy for more information -->
2.在开发前端页面配置:
"esri/core/urlUtils"
urlUtils
urlUtils.addProxyRule({
urlPrefix: "http://ip:port",
proxyUrl: "http://localhost/DotNet/proxy.ashx"
})