Skip to content

Commit

Permalink
perf(request): set retry to false
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jan 24, 2023
1 parent 3fca2d2 commit 35ffd14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/pages/Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ export const StatusPage: BasicPage = () => {
const fetchStatus = async () => {
await Promise.all(
services.map(async (service) => {
console.log(
service.name,
`${service.url ? `/${service.url}` : ""}/ping`
);
const res = await ofetch
.raw(`${service.url ? `/${service.url}` : ""}/ping`, { baseURL: API })
.raw(`${service.url ? `/${service.url}` : ""}/ping`, { baseURL: API, retry: false })
.catch(() => ({ status: 500 }));
setStatuses((prev) => ({
...prev,
Expand Down
1 change: 1 addition & 0 deletions src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const apiClient = ofetch.create({
Authorization: `Bearer ${getCookie("token")}`,
token: getCookie("token") || "",
},
retry: false,
onResponseError: (error) => {
Twindow({
title: `请求出错了哦 - ${error.response.status}`,
Expand Down

0 comments on commit 35ffd14

Please sign in to comment.