js获取路由

location.pathname.slice(location.pathname.substr(1).indexOf('/')+1)

原文地址:https://www.cnblogs.com/llmatch/p/9448846.html