mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
refactor: scipt and request
This commit is contained in:
@@ -63,9 +63,10 @@ export class RequestUtil {
|
||||
try {
|
||||
let response;
|
||||
if (method.toUpperCase() === 'POST') {
|
||||
response = await fetch(url, { ...requestInit, body: data });
|
||||
//console.log({ method: 'POST', ...requestInit, body: data });
|
||||
response = await fetch(url, { method: 'POST', ...requestInit, body: data });
|
||||
} else {
|
||||
response = await fetch(url, { ...requestInit });
|
||||
response = await fetch(url, { method: method, ...requestInit });
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
|
||||
Reference in New Issue
Block a user