目录
路由History模式打包页面空白
项目放根目录 -- 配置
项目放二级目录 -- 配置
路由History模式打包页面空白
项目放根目录 -- 配置
router => index.js
修改 base
const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  base: '/',
  routes,
})nginx.conf 配置
    server {
        listen       80;
        server_name  localhost;
		
		location / {
			alias F:/erp/dist/;
            try_files $uri $uri/ /index.html;
        }
    }改完重启 nginx

项目放二级目录 -- 配置
router => index.js
修改 base
const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  base: '/erp_project',
  routes,
})nginx.conf 配置
/erp_project 与上面 base 一致
    server {
        listen       80;
        server_name  localhost;
		
		location /erp_project {
			alias F:/erp/dist;
			index index.html index.htm;
			if (!-e $request_filename) {
				rewrite ^/(.*) /erp_project/index.html last;
				break;
			}
		}
    }改完重启 nginx

参考:https://www.jb51.net/article/142831.htm




![[附源码]Nodejs计算机毕业设计教师业绩考核和职称评审系统Express(程序+LW)](https://img-blog.csdnimg.cn/d21daaa733bd450ba53ebb55fe0306bc.png)
![[附源码]Nodejs计算机毕业设计教务管理系统Express(程序+LW)](https://img-blog.csdnimg.cn/bdd7dc4dfd1d42c0be2c7586b6a6c623.png)












