背景
h5应用在做分享功能是,用ios不能正常打开
解决方案
通过nginx配合转发
location /# {
alias $root;
index index.html;
try_files $uri $uri/ /#/index.html;
}
<script>
if(/ios|iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase() && window.location.href.includes("/%23/")) {
window.location.href = window.location.href.replace("%23", "#")
}
</script>