增加等待时长

main
amuliang 2024-02-18 20:26:10 +08:00
parent ba87c5e4b6
commit 36d47d3d0c
2 changed files with 8 additions and 4 deletions

View File

@ -22,9 +22,13 @@ function storeResource(path, url) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
mkdirsSync(_path.dirname(path)); mkdirsSync(_path.dirname(path));
const writeableStream = fs.createWriteStream(path); const writeableStream = fs.createWriteStream(path);
request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => { try {
resolve(true); request.get({ url: url, timeout: 20000 }).pipe(writeableStream).on('close', () => {
}); resolve(true);
});
}catch(err) {
console.log(err);
}
}); });
} }

View File

@ -130,7 +130,7 @@
let server_url = document.location.hostname == '' ? 'http://localhost:5750' : `http://${document.location.hostname}:5750`; let server_url = document.location.hostname == '' ? 'http://localhost:5750' : `http://${document.location.hostname}:5750`;
const ajax = axios.create({ const ajax = axios.create({
baseURL: server_url, baseURL: server_url,
timeout: 20000, timeout: 30000,
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
//'Access-Control-Allow-Origin': true //'Access-Control-Allow-Origin': true