-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
111 lines (89 loc) · 3.07 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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!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">
<title>ryoko</title>
</head>
<body>
<script type="module">
import ryoko, { abortPendingRequest, abortAllRequest } from './dist/ryoko.esm.js';
const AbortTokenizer = ryoko.AbortTokenizer;
const creatorToken = AbortTokenizer.createToken();
const creatorToken2 = AbortTokenizer.createToken();
let anfrage = ryoko.create({
prefixUrl: 'https://api.i-meto.com/meting/',
timeout: 1000,
params: {
a:2,
},
onDefer(config) {
// console.info(config)
},
// downloadScheduler({ percent, total, received, buffer }) {
// // console.info(percent, received, total, buffer)
// },
fetch: fetch,
})
anfrage.interceptors.request.use((config) => {
abortPendingRequest(creatorToken);
return config;
})
anfrage.interceptors.response.use((res) => {
return res;
})
anfrage.get('/api?server=netease&type=playlist&id=2250705194&r=0.6640864071721952', {
abortToken: creatorToken2
}).then((res) => {
console.info(res)
})
let o = new URLSearchParams()
o.append('server', 'netease')
o.append('type', 'lrc')
o.append('id', 2308499)
o.append('auth', 'da2b901838c26e789182ebbd1c0618feb5a73551')
for (let i = 0; i < 30; i++) {
anfrage.get('/api', {
timeout: 1000,
params: {
server: 'netease',
type: 'lrc',
id: 2308499,
auth: 'da2b901838c26e789182ebbd1c0618feb5a73551'
},
responseType: 'text',
beforeRequest(config) {
},
afterResponse(res) {
},
abortToken: creatorToken,
}).then((res) => {
console.info(res, i)
// console.info(res)
// console.info(res)
}).catch((err) => {
// console.dir(err)
})
}
// anfrage({
// url: 'https://suprise.github.io/mobx-cn/fp.html',
// beforeRequest(config) {
// },
// afterResponse(res) {
// },
// abortToken: creatorToken,
// })
// anfrage({
// url: 'https://i8.mifile.cn/b2c-mimall-media/93650133310ec1c385487417a472a26c.png',
// beforeRequest(config) {
// },
// afterResponse(res) {
// },
// })
// ryoko.get('https://suprise.github.io/mobx-cn/fp.html').then(res => {
// return res.data.text()
// }).then(d => console.dir(new DOMParser().parseFromString(d, 'application/xhtml+xml')))
</script>
</body>
</html>