From 0f01c4bbce19fa8489a4e835c83cb9415549f681 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期一, 17 二月 2025 17:54:22 +0800 Subject: [PATCH] 表单校验 --- deploy/deploy.config.js | 31 ++++++++++++++++++++++++++----- 1 files changed, 26 insertions(+), 5 deletions(-) diff --git a/deploy/deploy.config.js b/deploy/deploy.config.js index 43ac2f1..bbe806d 100644 --- a/deploy/deploy.config.js +++ b/deploy/deploy.config.js @@ -1,3 +1,15 @@ + +const testWebDir = 'E:/Wi/admin/test'; +// 蹇界暐鍚屾鐨勭洰褰� +const ignoreProj = ['prod']; +// 鍚屾鏃堕渶瑕佷繚鐣欑殑鏂囦欢璺緞锛堢浉瀵硅矾寰勶級 +const ignoreSyncPath = ['static/config/globalConfig.js']; +// 閮ㄧ讲鍚庡悓姝ユ枃浠跺埌鍚屽眰鍏朵粬椤圭洰鐩綍锛屼笖蹇界暐椤圭洰閰嶇疆鏂囦欢 +const remoteRunAfter = `cd /d ${testWebDir} && powershell -Command "$currentDir = Split-Path -Leaf (Get-Location); $ignoreDirs = @('${ignoreProj.join( + "','" +)}', $currentDir); $ignoreSyncPaths = @('${ignoreSyncPath.join( + "','" +)}'); $parentDir = Split-Path (Get-Location) -Parent; Get-ChildItem $parentDir -Directory | Where-Object { -not $ignoreDirs.Contains($_.Name) } | ForEach-Object { $targetDir = $_.FullName; $backupFiles = @{}; foreach ($ignorePath in $ignoreSyncPaths) { $fullIgnorePath = Join-Path $targetDir $ignorePath; if (Test-Path $fullIgnorePath) { $tempPath = Join-Path $env:TEMP ('backup_' + [guid]::NewGuid().ToString()); Copy-Item -Path $fullIgnorePath -Destination $tempPath -Force; $backupFiles[$ignorePath] = $tempPath; } }; Get-ChildItem $targetDir -Recurse | Where-Object { $_.FullName -ne $targetDir } | Remove-Item -Force -Recurse; Get-ChildItem -Path '.' -Recurse -File | Where-Object { $relativePath = $_.FullName.Substring((Get-Location).Path.Length + 1); $shouldCopy = $true; foreach ($ignorePath in $ignoreSyncPaths) { if ($relativePath -like $ignorePath) { $shouldCopy = $false; break; } }; $shouldCopy } | ForEach-Object { $relativePath = $_.FullName.Substring((Get-Location).Path.Length + 1); $targetPath = Join-Path $targetDir $relativePath; $targetParent = Split-Path $targetPath -Parent; if (-not (Test-Path $targetParent)) { New-Item -Path $targetParent -ItemType Directory -Force | Out-Null }; Copy-Item -Path $_.FullName -Destination $targetPath -Force }; foreach ($ignorePath in $ignoreSyncPaths) { if ($backupFiles.ContainsKey($ignorePath)) { $fullIgnorePath = Join-Path $targetDir $ignorePath; $parentFolder = Split-Path $fullIgnorePath -Parent; if (-not (Test-Path $parentFolder)) { New-Item -Path $parentFolder -ItemType Directory -Force | Out-Null }; Move-Item -Path $backupFiles[$ignorePath] -Destination $fullIgnorePath -Force } } }"`; module.exports = { privateKeyPath: 'C:/ssh/id_rsa', // 鏈湴绉侀挜鍦板潃锛屼綅缃竴鑸湪C:/Users/xxx/.ssh/id_rsa锛岄潪蹇呭~锛屾湁绉侀挜鍒欓厤缃� passphrase: '', // 鏈湴绉侀挜瀵嗙爜锛岄潪蹇呭~锛屾湁绉侀挜鍒欓厤缃� @@ -7,16 +19,25 @@ // 娴嬭瘯鐜 name: '娴嬭瘯鐜', preRun: '', // 娴嬭瘯鐜鎵撳寘鑴氭湰 - host: '101.133.133.173', // 娴嬭瘯鏈嶅姟鍣ㄥ湴鍧� + host: '47.100.245.85', // 娴嬭瘯鏈嶅姟鍣ㄥ湴鍧� port: 22, // ssh port锛屼竴鑸粯璁�22 username: 'Administrator', // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 password: '', // 鐧诲綍鏈嶅姟鍣ㄥ瘑鐮� distPath: 'dist', // 鏈湴鎵撳寘dist鐩綍 - webDir: 'E:/wi/admin/wi.admin.test', // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + webDir: testWebDir, // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + bakOld: true, // 鏄惁澶囦唤鏃х殑锛屼繚鐣欎笂涓�浠芥棫鐨� + // 杩滅▼鎵ц鍛戒护 + remoteRun: { + // 閮ㄧ讲鍓嶆墽琛屽懡浠� + before: '', + // 閮ㄧ讲鍚庢墽琛屽懡浠� + after: remoteRunAfter, + }, // 閮ㄧ讲棰勮 preview: { - url: 'http://101.133.133.173:9096/', // 閮ㄧ讲鍚庢鏌ラ儴缃叉晥鏋滐紝鏌ョ湅鐨勭綉椤靛湴鍧� + url: 'https://wi.beng35.com/admin/test', // 閮ㄧ讲鍚庢鏌ラ儴缃叉晥鏋滐紝鏌ョ湅鐨勭綉椤靛湴鍧� + openInBrowser: false, // 閮ㄧ讲瀹屾垚鍚庢槸鍚﹁嚜鍔ㄦ墦寮�閮ㄧ讲鐨勭綉椤靛湴鍧� }, }, @@ -29,9 +50,9 @@ username:'Administrator', // 鐧诲綍鏈嶅姟鍣ㄧ敤鎴峰悕 password: '', // 鐧诲綍鏈嶅姟鍣ㄥ瘑鐮� distPath: 'dist', // 鏈湴鎵撳寘dist鐩綍 - webDir: 'E:/Wi/admin', // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� + webDir: 'E:/Wi/admin/prod', // // 娴嬭瘯鐜鏈嶅姟鍣ㄥ湴鍧� preview: { - url: 'http://47.100.245.85:8192/', + url: 'https://wi.beng35.com/admin/prod', openInBrowser: false, }, }, -- Gitblit v1.9.3