From 892d89b98c7f4ae68d3594c27f78a84abea05ad3 Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Thu, 18 Jun 2026 18:41:34 +0800 Subject: [PATCH] =?UTF-8?q?chore(deploy):=20=E9=87=8D=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=9C=8D=E5=8A=A1=E5=99=A8=E9=85=8D=E7=BD=AE=E5=B9=B6?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.mjs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/deploy.mjs b/deploy.mjs index 255fc53e..977f29b0 100644 --- a/deploy.mjs +++ b/deploy.mjs @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ /** * 部署管理后台到服务器 | 用法:pnpm run deploy * @@ -13,19 +12,22 @@ */ import { execSync } from "node:child_process"; -const HOST = "www.youlai.tech"; // 服务器 IP,改为你的 -const USER = "root"; // SSH 用户名,改为你的 -const PORT = 1010; // SSH 端口,改为你的 -const TARGET = "/mnt/nginx/html/vue"; // 部署目录,改为你的 + + +// ==================== 改为你的服务器信息 ==================== +const HOST = "127.0.0.1"; // 服务器 IP,改为你的 +const USER = "root"; // SSH 用户名,改为你的 +const PORT = 22; // SSH 端口,改为你的 +const TARGET = "/data/www/vue3-element-admin"; // 部署目录,改为你的 // ========================================================= console.log("构建中..."); execSync("pnpm build-only", { stdio: "inherit" }); console.log(`部署 → ${USER}@${HOST}:${TARGET}`); -execSync(`scp -o StrictHostKeyChecking=no -P ${PORT} -r "dist/." "${USER}@${HOST}:${TARGET}/"`, { - stdio: "inherit", - shell: true, -}); +execSync( + `scp -o StrictHostKeyChecking=no -P ${PORT} -r "dist/." "${USER}@${HOST}:${TARGET}/"`, + { stdio: "inherit", shell: true } +); console.log("部署完成");