最简单的方法

location.pathname + location.search