遇到跨域问题:Access to XMLHttpRequest at 'http://toothless.vipgz2.idcfengye.com/user/vip/data' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
解决办法:在网关里添加配置:
spring: cloud: gateway: discovery: # 跨域 globalcors: corsConfigurations: '[/**]': allowedHeaders: "*" allowedOrigins: "*" allowedMethods: - GET POST DELETE PUT OPTION