-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
53 lines (49 loc) · 1.87 KB
/
index.html
File metadata and controls
53 lines (49 loc) · 1.87 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<!-- <script src="/src/build/client-detector.umd.cjs"></script> -->
<!-- 初始化 client detector -->
<!-- <script>
(function(){
const serviceHost = 'https://openxlab.org.cn/gw/data-bury'; // 必填,服务请求地址
const serviceName = 'test-service'; // 必填且唯一,找管理员查询
ClientDetector.init(serviceHost, { serviceName: serviceName});
window.onload = function() {
const sc = document.getElementsByTagName('script');
const loadScript = function(script) {
console.log(script);
return new Promise(function(resolve, reject){
// 监听加载成功事件
script.addEventListener('load', function() {
resolve('Script loaded successfully.');
});
// 监听加载失败事件
script.addEventListener('error', function() {
reject('Script failed to load.');
});
});
}
const pros = [].filter.call(sc, function(s) {
// 过滤掉内嵌script
return !!s.src.trim();
})
.map(function(s) {
return loadScript(s);
})
console.log(pros);
Promise.all(pros).then(function() {
console.log('ok');
})
}
})();
</script> -->
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>