From 57bf884360ca4b3387ba4964aacf31fb41781d66 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Mon, 2 Mar 2026 02:06:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E8=B7=AF=E5=BE=84=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/command/deploy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/command/deploy.ts b/src/command/deploy.ts index dbe134c..831a62f 100644 --- a/src/command/deploy.ts +++ b/src/command/deploy.ts @@ -46,7 +46,7 @@ const command = new Command('deploy') .option('-u, --update', 'load current app. set current version in product。 redis 缓存更新') .option('-s, --showBackend', 'show backend url, 部署的后端应用,显示执行的cli命令') .option('-d, --dot', '是否上传隐藏文件') - .option('--dir, --directory ', '上传的默认路径') + .option('--dir, --directory ', '上传的prefix路径,默认为空,例如设置为static,则会上传到/${username}/resources/${key}/${version}/static/路径下') .action(async (filePath, options) => { try { let { version, key, yes, update, org, showBackend } = options; @@ -169,7 +169,7 @@ type UploadFileOptions = { }; export const uploadFilesV2 = async (files: string[], directory: string, opts: UploadFileOptions): Promise => { - const { key, version, username } = opts || {}; + const { key, version, username, directory: prefix } = opts || {}; for (let i = 0; i < files.length; i++) { const file = files[i]; @@ -184,7 +184,7 @@ export const uploadFilesV2 = async (files: string[], directory: string, opts: Up filepath: file, }); const _baseURL = getBaseURL(); - const url = new URL(`/${username}/resources/${key}/${version}/${file}`, _baseURL); + const url = new URL(`/${username}/resources/${key}/${version}/${prefix ? prefix + '/' : ''}${file}`, _baseURL); // console.log('upload file', file, filePath); const token = await storage.getItem('token'); const check = () => {