1、路由改为hash模式
const router = new VueRouter({
routes,
mode: 'hash'
})
2、加上 publicPath:'./'
在vue.config.js添加
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave: false,
publicPath:'./'
})