Skip to content

Commit

Permalink
fix (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
linjm8780860 authored Oct 24, 2024
1 parent 38686ed commit f23bf1f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions js/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ function customFetch(url, options = {}) {
if (fetchCache.has(url)) {
const lastFetchTime = fetchCache.get(url);
if (now - lastFetchTime < 1200) {
// console.log(`请求过于频繁,忽略请求:${url}`);
// dialog({
// content: "The request is too frequent.",
// type: 'warning',
// noText: 'Close',
// })
return Promise.resolve(null);
}
}
fetchCache.set(url, now);
return window.fetch(url, options)
const host = `${window.location.origin}${window.location.pathname == '/' ? '' : window.location.pathname}`
return window.fetch(`${host}${url}`, options)
.then(response => {
if (response.status === 404) {
dialog({
content: "You may be missing dependencies at the moment. For details, please refer to the ComfyUI logs.",
type: 'error'
type: 'error',
noText: 'Close'
})
}
return response.json();
Expand Down

0 comments on commit f23bf1f

Please sign in to comment.