geniusfunny / backstage-management Goto Github PK
View Code? Open in Web Editor NEW一个用 React + React-Router + Ant Design 构建的管理平台
一个用 React + React-Router + Ant Design 构建的管理平台
由于项目前后端分离且后端真实接口已出,所以我开发时首先考虑通过跨域获取真实接口数据配合前端开发。(赶工期啊:)
根据create-react-app官方提示,在package.json中添加字段
"proxy": "http://admin.xiaoyaoeden.top"
emmm 🤭无效 😂
所以改为使用Nginx反向代理跨域😊
current origin:http://localhost:3000
target origin:http://admin.xiaoyaoeden.top
brew install nginx
首先进入nginx的配置文件
vim /usr/local/etc/nginx/nginx.conf
增加如下一个server
server {
listen 3001;
server_name localhost;
location / {
proxy_pass http://localhost:3000;
}
location /api/ {
add_header Access-Control-Allow-Origin *;
proxy_pass http://admin.xiaoyaoeden.top;
}
}
brew services restart nginx
打开localhost:3000,跨域问题解决了,现在可以开开心心的测试接口啦
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.