使用koa2-connect-history-api-fallback
//适配vue history的中间件
const historyApiFallback = require('koa2-connect-history-api-fallback');
// handle fallback for HTML5 history API
app.use(historyApiFallback({ whiteList: ['/api'] }));
//适配vue history的中间件
const historyApiFallback = require('koa2-connect-history-api-fallback');
// handle fallback for HTML5 history API
app.use(historyApiFallback({ whiteList: ['/api'] }));