docs: 鏇存柊闇€姹傛枃妗h嚦v0.5骞跺綊妗e紑鍙戣繘搴︼紱淇澶ф枃浠朵笂浼犱笌浜岀淮鐮佹捣鎶?

- 闇€姹傛枃妗e崌绾у埌 v0.5锛氳ˉ鍏呬簩缁寸爜娴锋姤淇濆瓨鏂囦欢鍚嶉粯璁ゆ牸寮忋€佸ぇ鏂囦欢涓婁紶涓夊眰闄愬埗锛圛IS+ASP.NET+鍓嶇锛夐儴缃茬害鏉熴€佹柊澧炵11绔犲紑鍙戣繘搴︾姸鎬佸綊妗o紙宸蹭笂绾垮姛鑳?宸蹭慨澶嶇己闄?宸茬煡闄愬埗/鍚庣画浼樺寲锛?- 鍚庣 FileController.Upload 澧炲姞 [RequestFormLimits(MultipartBodyLengthLimit=220_200_960)]锛屼慨澶?128MB multipart 涓婁紶琚嫆
- 鍓嶇 UploadView 浜岀淮鐮佹捣鎶ワ細淇 drawImage 缂╂斁閿欎綅銆侀《閮╨ogo/鏍囬鍨傜洿灞呬腑銆佸垎鍖烘爣棰橀棿璺濄€佸ぇ灏忎笌鏈夋晥鏈熷垎琛屾樉绀猴紱淇濆瓨鏂囦欢鍚嶆敼涓?鏂囦紶鏄撳彇浠剁爜-鍙栦欢鐮?鍘熸枃浠跺悕)-娴佹按鍙?png
- 鏂板閮ㄧ讲鑴氭湰锛歛pply_backend.ps1 / force_dll.ps1锛坅pp_offline 瑙i攣DLL锛? ftp_fe.ps1 / ftp_diag.ps1 / ftp_apply.ps1 / _diag/check_dll.ps1

(閮ㄧ讲鎵嬪唽 IIS閮ㄧ讲涓嶧TP鍙戝竷.md 浠呭惈缂栫爜/BOM 宸紓锛屾湭绾冲叆鏈鎻愪氦)
This commit is contained in:
2026-08-24 01:59:27 +08:00
parent 2e3f68472e
commit 01c9cc2330
9 changed files with 389 additions and 28 deletions
+55
View File
@@ -0,0 +1,55 @@
# Apply: new appsettings.json (localhost) + restore web.config (stdout off, triggers restart) + nested assets
$ErrorActionPreference = "Continue"
$FtpHost="116.198.221.125"; $FtpPort=21; $FtpUser="wenchuanyi"; $FtpPass="r7P^f*v7rFts"
$Local = "D:\CodeBuddy\Pros\WenChuanyi\backend\WenChuanyi.Api\bin\Release\net8.0\publish"
$Dist = "D:\CodeBuddy\Pros\WenChuanyi\frontend\dist"
function NewR($p,$m,$to=90000){ $u="ftp://${FtpHost}:${FtpPort}/"+$p.TrimStart('/'); $r=[System.Net.FtpWebRequest]::Create($u); $r.Method=$m; $r.Credentials=New-Object System.Net.NetworkCredential($FtpUser,$FtpPass); $r.UsePassive=$true; $r.UseBinary=$true; $r.KeepAlive=$false; $r.Timeout=$to; $r }
function Mk($p){
try{ $r=NewR $p ([System.Net.WebRequestMethods+Ftp]::MakeDirectory); $resp=$r.GetResponse(); try{$resp.Close()}catch{} }catch{}
Start-Sleep -Milliseconds 300
}
function GetSizeF($p){
try{ $r=NewR $p ([System.Net.WebRequestMethods+Ftp]::GetFileSize) 30000; $resp=$r.GetResponse(); $s=$resp.ContentLength; $resp.Close(); return $s }
catch{ return -1 }
}
function UpF($lp,$rp){
$want=(Get-Item $lp).Length
for($i=1;$i -le 4;$i++){
try{
$r=NewR $rp ([System.Net.WebRequestMethods+Ftp]::UploadFile) 300000
$b=[IO.File]::ReadAllBytes($lp); $r.ContentLength=$b.Length
$s=$r.GetRequestStream(); try{ $s.Write($b,0,$b.Length) } finally { $s.Close() }
$resp=$r.GetResponse(); try{ $resp.Close() }catch{}
Start-Sleep -Milliseconds 300
$after=GetSizeF $rp
if($after -eq $want){ Write-Host "UP OK $rp"; return $true }
Write-Host "SIZE MISMATCH $rp got=$after want=$want"
}catch{ Write-Host "RETRY($i) $rp : $($_.Exception.Message)" }
Start-Sleep -Seconds 3
}
Write-Host "FAIL $rp"; return $false
}
# 1. appsettings.json (localhost db)
UpF "$Local\appsettings.json" "/wwwroot/appsettings.json"
# 2. web.config: stdout off (production) - also triggers app pool restart
$wc = @"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\WenChuanyi.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
"@
$tmp = Join-Path $env:TEMP "wcy_web_prod.config"
[IO.File]::WriteAllText($tmp, $wc, [Text.Encoding]::UTF8)
UpF $tmp "/wwwroot/web.config"
# 3. nested wwwroot assets (frontend static files served by ASP.NET Core WebRoot)
Mk "/wwwroot/wwwroot/assets"
UpF "$Dist\assets\index-Bwz67ZeI.js" "/wwwroot/wwwroot/assets/index-Bwz67ZeI.js"
UpF "$Dist\assets\index-c9wa7v4K.css" "/wwwroot/wwwroot/assets/index-c9wa7v4K.css"
Write-Host "APPLY DONE"