var getSearchMessages = function () {
//获取?后的内容
var searchList = location.search;
if (!searchList) return false;
var params = {};
//去掉?
searchList = searchList.replace('?','');
//如果有多个键值对
var lists = searchList.split('&');
lists.forEach(function (item, index) {
var listsArr = item.split('=');
params[listsArr[0]] = listsArr[1];
});
console.log(params);
};