You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure部署Angular前端无法连接Spring Boot后端API问题

问题:Azure部署后Angular前端拼接错误API URL导致无法访问后端
  • 已在Azure部署Spring Boot后端与Angular前端网站,访问时前端URL被拼接至API URL前,导致无法正常访问后端API,但本地开发环境运行正常。
  • 浏览器获取到错误的API URL:https://ambitious-ground-04bd38a0f.5.azurestaticapps.net/ecommercespring-g7guhdcvf2gjgrd6.canadaeast-01.azurewebsites.net/api/product-category
  • 正确的API URL应为:https://ecommercespring-g7guhdcvf2gjgrd6.canadaeast-01.azurewebsites.net/api
  • 确认Angular的CORS配置无问题,以下是Angular CORS URL设置截图:
    Angular CORS配置截图1
    Angular CORS配置截图2

内容的提问来源于stack exchange,提问作者Wenbo Peng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 11:02:02