全球主机交流论坛

标题: 新的大厂图床 [打印本页]

作者: Typeboom    时间: 2024-12-8 16:19
标题: 新的大厂图床



  1.     let ticket = await utils.fetchWithTimeout('https://chat.v5kf.com/public/webauth/v9', {
  2.                         method: "POST",
  3.                         headers: {
  4.                             'content-type': "application/json"
  5.                         },
  6.                         body: JSON.stringify({
  7.                             site: 10000,
  8.                             account: "271003008e9f",
  9.                             visitor: randomUUID(),
  10.                             vip: 0,
  11.                             gender: 0,
  12.                             nickname: ""
  13.                         })
  14.                     }).then(r => r.json());

  15.                     if (!ticket.authorization) {
  16.                         throw new Error
  17.                     }

  18.                     let form = new FormData();
  19.                     form.append('file', fsc.createReadStream(img.path), img.name);

  20.                     let upload = await utils.fetchWithTimeout(`https://vos.v5kf.com/public/upload/`, {
  21.                         method: 'POST',
  22.                         headers: {
  23.                             "authorization": ticket.authorization,
  24.                             ...form.getHeaders()
  25.                         },
  26.                         body: form
  27.                     }, 10 * 1000).then(r => r.json());

  28.                     if (!upload.url) {
  29.                         throw new Error
  30.                     }

  31.                     console.log(upload.url)
复制代码

作者: jack晓峰    时间: 2024-12-8 16:38
这个应该用不了多久吧
作者: kpxyyyy    时间: 2024-12-8 16:52
jack晓峰 发表于 2024-12-8 16:38
这个应该用不了多久吧

换算法了就用不了了
作者: 疯狂痴呆    时间: 2024-12-8 17:11
htmlapi.html:2  Uncaught SyntaxError: await is only valid in async functions and the top level bodies of modules
作者: Faxlok    时间: 2024-12-8 17:18
顺丰同城的
作者: Typeboom    时间: 2024-12-8 17:35
疯狂痴呆 发表于 2024-12-8 17:11
htmlapi.html:2  Uncaught SyntaxError: await is only valid in async functions and the top level bodie ...

得ESModule,CJS不行
要么你就放进一个async函数里面
作者: Zhcn    时间: 2024-12-8 17:41
这个好像不是大厂




欢迎光临 全球主机交流论坛 (https://loc.imgfree.eu.org/) Powered by Discuz! X3.4