搭建两个Vue项目,第一个没有用 vue-element-admin 框架,本地run之后端口 http://localhost:8080 ,请求后台的登录接口可以成功。
第二项目用Vue-element-admin框架,请求同样的后台登录接口,运行之后报错:
Access to XMLHttpRequest at ‘http://192.168.1.223:8002/account/login/’ from origin ‘http://localhost:9527’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

这是端口的原因吗?
麻烦老师指点一下。
基于Element的中后台课程,一套中小型企业通用的后台管理系统
了解课程