使用中间件connect-history-api-fallback解决 一、安装connect-history-api-fallback npm install --save connect-history-api-fallback 二、引入 var history = require('connect-history-api-fallback'); 三、使用 // 使用中间件解决history app.use('/',history()) 四、注意 引入尽量在前面引入,我是express生成的项目,在app.js第一行引入的