fix: iframe link click - add allow-popups, use target=_blank
Previous fix injected base target=_top but the sandbox attribute lacked allow-top-navigation, so the browser blocked link clicks and the user had to Ctrl+Click as a workaround. Fix: sandbox allow-same-origin allow-popups + base target=_blank. Links now open in new tab (better UX, no content loss). Also fix deploy/rebuild.ps1 to read jar from target/ instead of deleted deploy/baota/. Add agent_test/ scripts: create_7_test_projects, upload_test_html, manual_package.
This commit is contained in:
+11
-6
@@ -8,17 +8,22 @@ Write-Host '=== 打包 publish_deploy.zip ===' -ForegroundColor Cyan
|
||||
New-Item -ItemType Directory -Path "$tmpDir\frontend" -Force | Out-Null
|
||||
|
||||
# 2. 复制前端构建产物
|
||||
Copy-Item "$ProjectRoot\dist\index.html" "$tmpDir\frontend\" -Force
|
||||
Copy-Item "$ProjectRoot\dist\assets" "$tmpDir\frontend\" -Recurse -Force
|
||||
Copy-Item "$ProjectRoot\server.js" "$tmpDir\frontend\" -Force
|
||||
Copy-Item "D:\Idea Project\publish\dist\index.html" "$tmpDir\frontend\" -Force
|
||||
Copy-Item "D:\Idea Project\publish\dist\assets" "$tmpDir\frontend\" -Recurse -Force
|
||||
Copy-Item "D:\Idea Project\publish\server.js" "$tmpDir\frontend\" -Force
|
||||
Write-Host ' [OK] 前端文件就位' -ForegroundColor Green
|
||||
|
||||
# 3. 复制后端 jar
|
||||
Copy-Item "$ProjectRoot\deploy\baota\app.jar" "$tmpDir\" -Force
|
||||
# 3. 复制后端 jar(从 Maven build output)
|
||||
$jarPath = "D:\Idea Project\publish\target\daily-report-distribution-1.0.0.jar"
|
||||
if (-not (Test-Path $jarPath)) {
|
||||
Write-Host " [ERROR] Backend jar not found at $jarPath. Run 'mvnw.cmd package' first." -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
Copy-Item $jarPath "$tmpDir\app.jar" -Force
|
||||
Write-Host ' [OK] 后端 jar 就位' -ForegroundColor Green
|
||||
|
||||
# 4. 打包
|
||||
$outputZip = "$ProjectRoot\deploy\publish_deploy.zip"
|
||||
$outputZip = "D:\Idea Project\publish\deploy\publish_deploy.zip"
|
||||
Compress-Archive -Path "$tmpDir\*" -DestinationPath $outputZip -Force
|
||||
$size = [math]::Round((Get-Item $outputZip).Length / 1MB, 1)
|
||||
Write-Host " [OK] 打包完成: $size MB" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user