美文网首页
Vue+SpringMVC使用History模式

Vue+SpringMVC使用History模式

作者: 粑粑雷 | 来源:发表于2020-02-16 15:32 被阅读0次

Vue

const router = new VueRouter({

  mode: 'history',

  base: '/task',

  routes

})

SpringMVC

<mvc:resources location="/task/" mapping="/task/**" cache-period="864000"/>

web.xml

<error-page>
    <error-code>404</error-code>
    <location>/task/</location>
</error-page>

Nginx

    location / {
        error_page 404 =200 /index.html;
    }
    
    location /index.html {
        root /task;
    }

相关文章

网友评论

      本文标题:Vue+SpringMVC使用History模式

      本文链接:https://www.haomeiwen.com/subject/ejopfhtx.html