fix(fetch): fix

This commit is contained in:
zhangheng
2026-03-16 17:08:57 +08:00
parent 37ecb4641b
commit a55a0bfbc5
7 changed files with 103 additions and 101 deletions

View File

@@ -61,21 +61,24 @@ export async function POST(req: any) {
method,
headers: {
"content-type": "application/json",
["Token"]: userData?.refresh_token,
["Refresh-Token"]: userData?.refresh_token,
},
body: JSON.stringify({
token: userData?.refresh_token,
}),
// body: JSON.stringify({
// token: userData?.refresh_token,
// }),
}
} else {
const authorization = `bearer ${userData?.access_token}`
const access_token = `${userData?.access_token}`
fetchOptions = {
method,
headers: {
"content-type": "application/json",
authorization: authorization,
["Token"]: access_token,
["Refresh-Token"]: userData?.refresh_token,
},
}
if (method === "POST" || method === "PUT") {
if (method === "POST" || method === "PUT" || method === "DELETE") {
fetchOptions.body = data
} else {
if (isParamsValid(data)) {