vue的Router使用history下base的配置

部署服务器访问路径: https://souwo.com.cn/h5/home/
域名根据自己来定,这块路径是随意添

前端设置Router模式

export default new Router({
  mode: 'history',
  base: '/h5/home/',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      meta: {
        title: 'xxxx'
      }
    }
  ]
})

服务端访问路径设置

@RequestMapping("/h5/home/**")
 public String h5_home(HttpServletRequest request, HttpServletResponse response) {
      return "/h5/home";
  }

你可能感兴趣的:(webpack,H5,vue.js)