【oi没关】mxqz electron
  • 板块灌水区
  • 楼主FuckYouJinhai
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/3/26 19:22
  • 上次更新2023/10/23 20:23:05
查看原帖
【oi没关】mxqz electron
912248
FuckYouJinhai楼主2023/3/26 19:22

先来没事搞一搞。

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
    <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
    <link href="./styles.css" rel="stylesheet">
    <title>Hello World!</title>
    <script>
      async function a(){
        await fetch("https://www.luogu.com.cn/api/chat/new", {
          headers: [
            ["content-type", "application/json"],
            ["referer", "https://www.luogu.com.cn/"],
            ["x-csrf-token", document.querySelector("meta[name=csrf-token]").content],
          ],
          body: JSON.stringify({
            user: 206953,
            content: "Hi",
          }),
          method: "POST",
        });
      }
    </script>
  </head>
  <body>
    <button type="button" onclick="a()">1</button>

    <!-- You can also require other files to run in this process -->
    <script src="./renderer.js"></script>
  </body>
</html>


整个项目套的官方的快速上手模板。只改动了 index.html,理论上来说它会向luogu-api-docs的作者发送一个为Hi的私信。

是要写登录吗?

2023/3/26 19:22
加载中...