/
xxx.txt
76 lines (76 loc) · 3.48 KB
/
xxx.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
app.get('/g/test', function (req, res) {
const UA = req.get('User-Agent');
if (UA.indexOf('MicroMessenger') > -1) {
if (/android/i.test(UA)) {
res.header('Content-Type', 'application/pdf; charset=utf-8')
res.header('Content-disposition', "attachment;filename='downloaded.apk'")
res.end('')
} else {
res.send(`<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>提示</title>
<script type="text/javascript">
! function(a) {
function b() {
a.rem = f.getBoundingClientRect().width / 3.75, f.style.fontSize = a.rem + "px"
}
var c, d = a.navigator.appVersion.match(/iphone/gi) ? a.devicePixelRatio : 1,
e = 1 / d,
f = document.documentElement,
g = document.createElement("meta");
if (a.dpr = d, a.addEventListener("resize", function() {
clearTimeout(c), c = setTimeout(b, 300)
}, !1), a.addEventListener("pageshow", function(a) {
a.persisted && (clearTimeout(c), c = setTimeout(b, 300))
}, !1), f.setAttribute("data-dpr", d), g.setAttribute("name", "viewport"), g.setAttribute("content", "initial-scale=" + e + ", maximum-scale=" + e + ", minimum-scale=" + e + ", user-scalable=no"), f.firstElementChild) f.firstElementChild.appendChild(g);
else {
var h = document.createElement("div");
h.appendChild(g), document.write(h.innerHTML)
}
b();
}(window);
</script>
<style>
* {margin: 0;padding: 0;}
body,html {height: 100%;}
.guide {padding-top: .14rem;position: relative;}
.guide .guide-brand {display: block;width: 100%;}
.guide .pointer {width: .47rem;position: absolute;top: 1.48rem;right: .82rem;z-index: 1;animation: move 1s infinite linear alternate;-webkit-animation: move 1s infinite linear alternate;}
@keyframes move {
from {
transform: translate(0, 0);
}
to {
transform: translate(8px, 8px);
}
}
@-webkit-keyframes move {
from {
-webkit-transform: translate(0, 0);
}
to {
-webkit-transform: translate(8px, 8px);
}
}
</style>
</head>
<body>
<div class="guide">
<div>请点击右上角打开</div>
</div>
</body>
</html>`)
}
} else {
const redirectUrl = 'https://www.baidu.com'
res.send(`
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>加载中...</title><meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"><meta name="format-detection" content="telephone=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="wap-font-scale" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="refresh" content="0.5;url=${redirectUrl}">
</head><body style="background-color: rgb(245, 245, 245); text-align: center;"></body></html>
`);
}
})