-
Notifications
You must be signed in to change notification settings - Fork 231
/
Copy pathindex.html
37 lines (31 loc) · 1.17 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>vue-qq</title>
<meta name="viewport" content="width=device-width,height=device-height,
initial-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<link rel="shortcut icon" href="/static/logo.png" type="image/x-icon" />
</head>
<body>
<div id="app"></div>
<script src="http://localhost:3000/socket.io/socket.io.js"></script>
<script type="text/javascript">
const socket = io.connect('http://localhost:3000');
//解决用户手动刷新浏览器后,原来的socketid失效的问题
const loginStatus = JSON.parse(localStorage.getItem("loginStatus") || '{}');
loginStatus.isLogin && socket.emit('update', loginStatus.userId);
// //屏幕适应
// (function (win, doc) {
// if (!win.addEventListener) return;
// var html = doc.documentElement;
// function setFont() {
// html.style.fontSize = html.clientWidth / 640 * 100 + "px";
// }
// doc.addEventListener('DOMContentLoaded', setFont, false);
// win.addEventListener('resize', setFont, false);
// })(window, document);
</script>
</body>
</html>