JavaScript 代码优化:使用 const wxSafeUrl 处理 URL
const wxSafeUrl = (url: string = location.href) => { const replacedUrl = url .replace('https://h5p-gw.duotest.cn', 'https://h5.gogpay.cn/h5-test') .replace('https://h5p-gw.gogpay.cn', 'https://h5.gogpay.cn/h5') .replace(/(p=\w+&?)/g, '') .replace(/(openId=\w+&?)/g, '');
return replacedUrl; };
原文地址: https://www.cveoy.top/t/topic/pe5L 著作权归作者所有。请勿转载和采集!