怎么把下面js写成api,请求方式 https://域名/api.php?qq=123456
访问后判断系统,安卓 苹果 pc电脑 跳转域名不同,然后跳转QQ api.php?qq=123456
<script type="text/javascript">
if(/Android/i.test(navigator.userAgent)) {
window.location.href = "https://wpa.qq.com跳转域名不同/msgrd?v=3&uin=".$_GET['这是QQ']."&site=qq&menu=yes";
}
if(/iPhone|/i.test(navigator.userAgent)) {
window.location.href = "https://wpa.qq.com跳转域名不同/msgrd?v=3&uin=".$_GET['这是QQ']."&site=qq&menu=yes";
}
if(/window/i.test(navigator.userAgent)) {
window.location.href = "https://wpa.qq.com跳转域名不同/msgrd?v=3&uin=".$_GET['这是QQ']."&site=qq&menu=yes";
}
<script>