This commit is contained in:
2023-10-17 22:35:28 +08:00
parent 1bafe71d1e
commit 69983054dc
22 changed files with 319 additions and 39 deletions

View File

@@ -0,0 +1,23 @@
/**
* getUrlKey 截取地址栏参数
* @param value
* @returns {String}
*/
const getUrlParam = (name) => {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
let url = window.location.href.split('#')[0];
let search = url.split('?')[1];
console.log(search);
if (search) {
var r = search.substr(0).match(reg);
if (r !== null) {
return unescape(r[2]);
}
return null;
} else return null;
}
export default {
getUrlParam,
};