我的web服务器有二级目录promotion,于是配置了router和config
//项目源码目录/src/router/index.js
import Vue from "vue";
import Router from "vue-router";
import notFound from "@/components/notFound";
import index from "@/views/index";
Vue.use(Router);
export default new Router({
mode: "history",
base:"/promotion/",
routes: [
{ path: "*", component: notFound },
{
path: "/index",
name: "index",
component: index
}
]
});
//项目源码目录/config/index.js
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/promotion/',
}
服务器用的IIS管理,网站根目录配置了web.config
最终访问地址,域名/promotion/index,页面报了500错误,这是什么原因?怎么解决?