记录一下没啥技术含量
addressResolution(url=window.location.href){
if(!url|| typeof url!=='string'){
return '地址解析格式错误'
}
let a = url.split('?')[1]||'';
if(a!==''&& (a.split('&').length!==0||a.split('&&').length!==0)){
let b = a.split('&')||a.split('&&');
let c = {};
b.forEach(item=>{
let key = item.split('=')[0];
let value = item.split('=')[1];
c[key] = value
});
return c
}else{
return 'error'
}
}
直接调用
chatgpt 对话小程序 ai对话 爱画图 扫码体验