例如:
http://30.7.212.45:3000/#/?id=100
获取 id 的值的 js 代码如下:
var id;
var href = window.location.href
console.log(`href = ${href}`)
var reg = new RegExp("(^|&)" + "id" + "=([^&]*)(&|$)");
var query = href.substring(href.indexOf('?') + 1)
var r = query.match(reg)
if (r != null) id = unescape(r[2]);
console.log(`id = ${id}`)