devServer.historyApiFallback 设置为true就可以了,如果你不是用的vue-cli的话
https://blog.csdn.net/ITLionWoo/article/details/83033860