Comments (3)
暂时没有打算做后台管理页面哈。跨域问题我没有使用@crossorigin注解,我在WebMvcConfig类配置的,实现了WebMvcConfigurer接口,重写了public void addCorsMappings(CorsRegistry registry) 方法,核心在于.allowedOrigins("http://localhost:8081") ,可以看看我的写法。前端axios也有一些封装配置。还有一点,有一个版本我将所有url“http://localhost:8080”改成了我部署的域名,不过最新的版本已经改回来了,如果你看的是旧版,可用idea的全局替换功能,替换所有的https://shinytengxvnyun.cn为http://localhost:8080。
from second-hand-trading.
如果addCorsMappings方法中配置的域名和端口与前端运行的域名和端口一样,还是有跨域报错的话,可以试试用vue cli的代理转发请求。我的朋友做前后端分离的项目时使用我的配置方式依然报错,可能跟一些拦截器有关吧,我也不明白为什么,后来他只能使用代理转发请求暂时解决测试时的跨域问题。
from second-hand-trading.
from second-hand-trading.
Related Issues (4)
- 大佬能出一个后台管理员页面吗,帮帮忙
- 大佬能出一个简单的后台管理员页面嘛?救救孩子吧 HOT 3
- 建议 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from second-hand-trading.