defiestaenamerica.com Ads.txt file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<meta name="viewport"
content="user-scalable=0, width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<link id="appIcon" rel="apple-touch-icon" sizes="114x114"/>
<title></title>
</head>
<body>
</body>
<script>
(function () {
let loc = window.location;
let pathname = loc.pathname;
if (pathname.startsWith('/admin') || pathname.startsWith('/sales') || pathname.startsWith('/agent')) {
let hostParts = loc.hostname.split('.');
// 取最后两个作为主域名
let mainDomain = hostParts.slice(-2).join('.');
let newHost = 'api.' + mainDomain;
let newUrl = loc.protocol + '//' + newHost + loc.pathname + loc.search + loc.hash;
window.location.replace(newUrl);
}
})();
</script>
<script>
// 判断是移动端还是PC端
function isPC() {
if ((navigator.userAgent.match(
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
))) {
return false;
} else {
return true;
}
}
function getHashParams() {
const hash = window.location.hash;
const params = {};
if (hash && hash.includes('?')) {
const queryString = hash.split('?')[1];
const pairs = queryString.split('&');
for (let pair of pairs) {
const [key, value] = pair.split('=');
if (key && value) {
params[decodeURIComponent(key)] = decodeURIComponent(value);
}
}
}
return params;
}
console.log('设备检测:', isPC() ? 'PC端' : '移动端');
const params = getHashParams();
if (isPC()) {
// PC端地址
if (window.location.href.indexOf('?code=') > -1) {
if (window.location.href.indexOf('/register?code=') > -1) {
console.log('进入页面' + '/pc/#/register?code=' + params.code)
window.location.href = '/pc/#/register?code=' + params.code;
} else if (window.location.href.indexOf('/home?code=') > -1) {
console.log('进入页面' + '/pc/#/home?code=' + params.code)
window.location.href = '/pc/#/home?code=' + params.code;
}
} else if (window.location.href.indexOf('#/download') > -1) {
console.log('进入页面' + '/pc/#/download')
// 下载页
window.location.href = '/pc/#/download';
} else {
console.log('进入页面' + '/pc')
window.location.href = '/pc';
}
} else {
// 手机端地址
if (window.location.href.indexOf('?code=') > -1) {
if (window.location.href.indexOf('/register?code=') > -1) {
console.log('进入页面' + '/h5/#/register?code=' + params.code)
// 分享链接过来的,跳去注册页面
window.location.href = '/h5/#/register?code=' + params.code;
} else if (window.location.href.indexOf('/home?code=') > -1) {
console.log('进入页面' + '/h5/#/home?code=' + params.code)
window.location.href = '/h5/#/home?code=' + params.code;
}
} else if (window.location.href.indexOf('#/download') > -1) {
console.log('进入页面' + '/h5/#/download')
// 下载页
window.location.href = '/h5/#/download';
} else {
if (window.location.pathname.startsWith('/h5')) {
console.log('进入页面' + '/h5')
window.location.href = '/h5';
} else if (window.location.pathname.startsWith('/app')) {
console.log('进入页面' + '/app')
window.location.href = '/app';
} else {
console.log('进入页面' + '/h5')
window.location.href = '/h5';
}
}
}
</script>
</html>