From 69b5c5acd5f00c9c6f5bce5e338ecc7b0e5f3bbf Mon Sep 17 00:00:00 2001 From: sige Date: Fri, 24 May 2024 14:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=B6=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E9=AB=98=E5=BA=A6=E4=B8=8D=E8=B6=B3?= =?UTF-8?q?=EF=BC=8CPlaceholder=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=EF=BC=8C=20=E9=A1=B6=E9=83=A8=E7=BC=BA=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish.ps1 | 55 ++++++++++++++++++++++---------------------- src/components/LoginForm.vue | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/publish.ps1 b/publish.ps1 index ca5ed53..28c1c3a 100644 --- a/publish.ps1 +++ b/publish.ps1 @@ -1,5 +1,5 @@ Param( - [Switch] $Prod = $false + [String]$Exec="Deploy" ) # 用于执行shell命令 @@ -9,30 +9,31 @@ function Exec-Shell-Cmd { ssh root:zwsd@192.168.8.11 "cd /frontend && $Cmd" } -# build project -yarn build -# rename dist to current time, like 20221215121300 -$now = Get-Date -Format "yyyyMMddHHmmss" -Rename-Item -Path ./dist -NewName $now -# compress dist to app.zip -Compress-Archive -Path ./$now -DestinationPath ./app.zip -Force -# upload app.zip to server -scp app.zip root@192.168.8.11:/frontend/ -# unzip app.zip -Exec-Shell-Cmd "unzip app.zip" -# remove old link -Exec-Shell-Cmd "rm -f /frontend/dist" -# create link -Exec-Shell-Cmd "ln -s /frontend/$now /frontend/dist" -# remove app.zip -Exec-Shell-Cmd "rm -f app.zip" -Remove-Item -Path ./app.zip -# remove folder -Remove-Item -Path ./$now -Recurse - -# 创建测试模式标记 -Exec-Shell-Cmd "touch /var/zapp_flag/chrome_in_test_mode" -if ($Prod) { - # 删除测试模式标记 - Exec-Shell-Cmd "rm /var/zapp_flag/chrome_in_test_mode" +if ( $Exec -eq "DevDisable" ) { + Exec-Shell-Cmd "rm /var/zapp_flag/chrome_in_test_mode"; + Exec-Shell-Cmd "reboot" +} elseif ( $Exec -eq "DevEnable" ) { + Exec-Shell-Cmd "touch /var/zapp_flag/chrome_in_test_mode"; + Exec-Shell-Cmd "reboot" +} elseif ( $Exec -eq "Deploy" ) { + # build project + yarn build + # rename dist to current time, like 20221215121300 + $now = Get-Date -Format "yyyyMMddHHmmss" + Rename-Item -Path ./dist -NewName $now + # compress dist to app.zip + Compress-Archive -Path ./$now -DestinationPath ./app.zip -Force + # upload app.zip to server + scp app.zip root@192.168.8.11:/frontend/ + # unzip app.zip + Exec-Shell-Cmd "unzip app.zip" + # remove old link + Exec-Shell-Cmd "rm -f /frontend/dist" + # create link + Exec-Shell-Cmd "ln -s /frontend/$now /frontend/dist" + # remove app.zip + Exec-Shell-Cmd "rm -f app.zip" + Remove-Item -Path ./app.zip + # remove folder + Remove-Item -Path ./$now -Recurse } \ No newline at end of file diff --git a/src/components/LoginForm.vue b/src/components/LoginForm.vue index f3abdc1..9d8b991 100644 --- a/src/components/LoginForm.vue +++ b/src/components/LoginForm.vue @@ -159,7 +159,7 @@ const handleLogin = () => { border: none; outline: none; width: 253px; - height: 17px; + height: 20px; position: absolute; left: 120px; top: 209px;