|
- let ticket = await utils.fetchWithTimeout('https://chat.v5kf.com/public/webauth/v9', {
- method: "POST",
- headers: {
- 'content-type': "application/json"
- },
- body: JSON.stringify({
- site: 10000,
- account: "271003008e9f",
- visitor: randomUUID(),
- vip: 0,
- gender: 0,
- nickname: ""
- })
- }).then(r => r.json());
- if (!ticket.authorization) {
- throw new Error
- }
- let form = new FormData();
- form.append('file', fsc.createReadStream(img.path), img.name);
- let upload = await utils.fetchWithTimeout(`https://vos.v5kf.com/public/upload/`, {
- method: 'POST',
- headers: {
- "authorization": ticket.authorization,
- ...form.getHeaders()
- },
- body: form
- }, 10 * 1000).then(r => r.json());
- if (!upload.url) {
- throw new Error
- }
- console.log(upload.url)
复制代码 |
|