瀏覽器截取查詢參數,後臺路由和前端路由的倆種方式

// 後端路由方案 getQueryString(name) { const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); const r = window.location.search.substr(1).match(reg); return r == null ? "" : unescape(r[2]); } // 前端 h
相關文章
相關標籤/搜索