按F12打开谷歌浏览器控制台工具

右键刚刚请求的接口

选择Copy as fetch
复制到 Console 中

按回车

查看network

刚刚又重新发送了一次
以下是发送10次

(async () => {
for (let i = 0; i < 10; i++) {
try {
const response = await fetch("http://localhost:3100/jeecgboot/news/news/add", {
headers: {
accept: "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
authorization: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MzI1NDYxODAsInVzZXJuYW1lIjoiYWRtaW4ifQ.r9hWsrA9o6cOfU55_fzQD9DW_fY-9eeKg3WnQAnCGVQ",
"content-type": "application/json;charset=UTF-8",
"sec-ch-ua": "\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-access-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MzI1NDYxODAsInVzZXJuYW1lIjoiYWRtaW4ifQ.r9hWsrA9o6cOfU55_fzQD9DW_fY-9eeKg3WnQAnCGVQ",
"x-sign": "DEF68BF7280A56B5BD768DF84CBCA484",
"x-tenant-id": "1000",
"x-timestamp": "1732255611288",
"x-version": "v3"
},
referrer: "http://localhost:3100/news/newsList",
referrerPolicy: "strict-origin-when-cross-origin",
body: JSON.stringify({
id: "",
title: `这是标题 ${i + 1}`,
num: "10",
top: "11"
}),
method: "POST",
mode: "cors",
credentials: "include"
});
const data = await response.json();
console.log(`请求 ${i + 1} 成功:`, data);
} catch (error) {
console.error(`请求 ${i + 1} 出错:`, error);
}
}
})();