Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Apr 2, 2024
1 parent 5bd7fb0 commit c28e818
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions utils/checkStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ export async function checkStatus(
) {
isChecking.value = true;
const baseURL = `http://localhost:${port}`;
const twFetch = ofetch.create({ baseURL });

const data = await twFetch('/status')
.catch((e) => {
const twFetch = ofetch.create({
baseURL,
async onRequestError({ request, response, options }) {
notify({
message: 'TiddlyWiki 未成功连接' + e.message,
message: 'TiddlyWiki 未成功连接',
type: 'error',
});
})
.finally(() => {
isChecking.value = false;
});
},
});

const data = await twFetch('/status').finally(() => {
isChecking.value = false;
});

status.value = data;

Expand Down

0 comments on commit c28e818

Please sign in to comment.