diff --git a/back/services/system.ts b/back/services/system.ts index e46bccbc..0d5ccc09 100644 --- a/back/services/system.ts +++ b/back/services/system.ts @@ -25,7 +25,6 @@ import { import { TASK_COMMAND } from '../config/const'; import taskLimit from '../shared/pLimit'; import tar from 'tar'; -import fs from 'fs'; import path from 'path'; @Service() @@ -258,13 +257,7 @@ export default class SystemService { public async exportData(res: Response) { try { await tar.create({ gzip: true, file: config.dataTgzFile, cwd: config.rootPath }, ['data']) - const dataFile = fs.createReadStream(config.dataTgzFile); - res.writeHead(200, { - 'Content-Type': 'application/force-download', - 'Content-Disposition': 'attachment; filename=data.tgz', - 'Content-length': fs.statSync(config.dataTgzFile).size - }); - dataFile.pipe(res); + res.download(config.dataTgzFile); } catch (error: any) { return res.send({ code: 400, message: error.message }); } diff --git a/docker/nginx.conf b/docker/nginx.conf index a76bf885..4d954137 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -14,7 +14,7 @@ http { server_tokens off; - client_max_body_size 20m; + client_max_body_size 4096m; client_body_buffer_size 20m; keepalive_timeout 65; diff --git a/shell/update.sh b/shell/update.sh index 439df451..bb0ced5e 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -244,7 +244,6 @@ reload_qinglong() { fi if [[ "$reload_target" == 'data' ]]; then - rm -rf ${dir_data} cp -rf ${dir_tmp}/data ${dir_root}/ fi diff --git a/src/pages/setting/checkUpdate.tsx b/src/pages/setting/checkUpdate.tsx index 44a6a957..cd441049 100644 --- a/src/pages/setting/checkUpdate.tsx +++ b/src/pages/setting/checkUpdate.tsx @@ -138,7 +138,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => { 秒后自动刷新 @@ -147,7 +147,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => { }); setTimeout(() => { window.location.reload(); - }, 14000); + }, 30000); }) .catch((error: any) => { console.log(error); diff --git a/src/pages/setting/other.tsx b/src/pages/setting/other.tsx index a756695b..509afd41 100644 --- a/src/pages/setting/other.tsx +++ b/src/pages/setting/other.tsx @@ -136,7 +136,7 @@ const Other = ({ 秒后自动刷新 @@ -145,7 +145,7 @@ const Other = ({ }); setTimeout(() => { window.location.reload(); - }, 14000); + }, 30000); }) .catch((error: any) => { console.log(error); diff --git a/src/pages/setting/security.tsx b/src/pages/setting/security.tsx index 69a4879b..37f8548a 100644 --- a/src/pages/setting/security.tsx +++ b/src/pages/setting/security.tsx @@ -239,7 +239,7 @@ const SecuritySettings = ({ user, userChange }: any) => { 头像 } src={avatar} /> - +