1. // router.js
    2. ...
    3. const router = new Router({
    4. mode: 'history', // 配置模式
    5. base: '/lucky/', // 重要,和vue.config.js中的publicPath一样
    6. ...
    7. });
    8. ...
    1. // vue.config.js
    2. publicPath: process.env.NODE_ENV === 'production' ? '/lucky' : '/',