分层项目无法使用动态JS代理
解决方法:
- Include the proxy script in the web page:
<script src="https://localhost:<api-host-port>/Abp/ServiceProxyScript"></script>
- In the web project, set
abp.appPath
to the http api host's base url in Javascript. E.g.abp.appPath = "https://localhost:<api-host-port>/"
- Add the web host to the api host's CorsOrigins:
(in api host'sappsettings.json
){ "<app-name>": { "CorsOrigins": "<existing-cors-origins>,https://localhost:<web-host-port>" } }
- Profit!
- 参考链接:abp vnext没有生成动态代理js代码_星空你好的博客-CSDN博客_abp 动态代理,
- Dynamic JavaScript Proxies not Work in Tiered Template · Issue #1469 · abpframework/abp · GitHub