z-9527 / admin Goto Github PK
View Code? Open in Web Editor NEWreact+koa实现登陆、聊天、留言板功能后台
react+koa实现登陆、聊天、留言板功能后台
如果直接将前端部分打包放到 /public/build
下后启动后端,出现报错:
GET /index.html -
--> GET /admin/static/css/xxxxx.chunk.css 404 -
GET /index.html -
--> GET /admin/static/js/xxxxx.chunk.js 404 -
打开本地 8888 端口跳进了 /admin/login
,不能正常访问,而访问 /login
是正常的。
后来我改了前端的 react/src/utils/history.js
的 options.basename
,改成 '/'
,就能自动跳进 /login
,资源加载正常了。
import { createBrowserHistory } from 'history'
const env = process.env.NODE_ENV // 环境参数
let options = {}
if (env === 'production') {
options.basename = '/admin' // 这里改成 '/'
}
export default createBrowserHistory(options)
作者做展示时在服务器做了 Nginx 就没事,如果本地测试请大家注意。
你好,我想问下你的后台项目怎样跑起来的??谢谢
is:issue is:open 你好你这个跳转页面怎么跳转,用history直接是单独的页面啊
预览的账号密码是什么?
我也想学习一下,方便回复一下吗
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.