From fbc10623a282b002227e2bc10fb78dd163b56461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9C=B1?= <10714957+xiao-zhu245@user.noreply.gitee.com> Date: Sun, 20 Jul 2025 11:21:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install-python-deps.bat | 5 +++++ scripts/package.js | 31 ++++++++----------------------- scripts/start.bat | 5 +++++ 3 files changed, 18 insertions(+), 23 deletions(-) create mode 100644 scripts/install-python-deps.bat create mode 100644 scripts/start.bat diff --git a/scripts/install-python-deps.bat b/scripts/install-python-deps.bat new file mode 100644 index 0000000..ec0dfbe --- /dev/null +++ b/scripts/install-python-deps.bat @@ -0,0 +1,5 @@ +@echo off +echo 正在安装Python依赖... +pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn +echo Python依赖安装完成! +pause \ No newline at end of file diff --git a/scripts/package.js b/scripts/package.js index 54bc2fc..387280b 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -188,16 +188,10 @@ async function createPackage() { console.log('馃摑 鍒涘缓鍚姩鑴氭湰...') // 鏍规嵁鐩爣骞冲彴鍒涘缓鍚姩鑴氭湰 if (buildTarget === 'windows') { - const startScript = `@echo off -echo 姝e湪鍚姩GSM3绠$悊闈㈡澘... -cd server -node.exe index.js -pause` - - await fs.writeFile( - path.join(packageDir, 'start.bat'), - startScript, - 'latin1' // 浣跨敤ANSI缂栫爜 + // Windows骞冲彴澶嶅埗scripts\start.bat鏂囦欢 + await fs.copy( + path.join(__dirname, 'start.bat'), + path.join(packageDir, 'start.bat') ) } else if (buildTarget === 'linux') { const startShScript = `#!/bin/bash @@ -249,24 +243,15 @@ node server/index.js` } console.log('馃悕 鍒涘缓Python渚濊禆瀹夎鑴氭湰...') - // 鍒涘缓Python渚濊禆瀹夎鑴氭湰 - const installPythonDepsScript = `@echo off -echo 姝e湪瀹夎Python渚濊禆... -cd server\\Python -pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn -echo Python渚濊禆瀹夎瀹屾垚锛 -pause` - - await fs.writeFile( - path.join(packageDir, 'install-python-deps.bat'), - installPythonDepsScript, - 'latin1' // 浣跨敤ANSI缂栫爜 + // 澶嶅埗Python渚濊禆瀹夎鑴氭湰 + await fs.copy( + path.join(__dirname, 'install-python-deps.bat'), + path.join(packageDir, 'install-python-deps.bat') ) // 鍒涘缓Linux Python渚濊禆瀹夎鑴氭湰 const installPythonDepsShScript = `#!/bin/bash echo "姝e湪瀹夎Python渚濊禆..." -cd server/src/Python pip install -r server/Python/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn echo "Python渚濊禆瀹夎瀹屾垚锛"` diff --git a/scripts/start.bat b/scripts/start.bat new file mode 100644 index 0000000..ca778d2 --- /dev/null +++ b/scripts/start.bat @@ -0,0 +1,5 @@ +@echo off +echo 正在启动GSM3管理面板... +cd server +node.exe index.js +pause \ No newline at end of file