42 lines
2.0 KiB
PowerShell
42 lines
2.0 KiB
PowerShell
$ErrorActionPreference = 'Continue'
|
|
Write-Host '=== listening 8180 ==='
|
|
Get-NetTCPConnection -LocalPort 8180 -State Listen -EA SilentlyContinue | Select-Object -First 1 OwningProcess
|
|
$java = Get-CimInstance Win32_Process -Filter "Name='java.exe'" | Where-Object { $_.CommandLine -like '*inquiry-new*' } | Select-Object -First 1
|
|
if ($java) {
|
|
Write-Host ("pid=" + $java.ProcessId)
|
|
$cl = $java.CommandLine
|
|
if ($cl.Length -gt 200) { $cl = $cl.Substring(0,200) }
|
|
Write-Host ("cmd=" + $cl)
|
|
}
|
|
Write-Host '=== fat jar inquiry/poi ==='
|
|
$jarCmd = 'C:\yutongda\tools\jdk8\bin\jar.exe'
|
|
$Fat = 'E:\wwwroot\inquiry-new\jeecg-system-start-3.5.3.jar'
|
|
Write-Host ("fat_bytes=" + (Get-Item $Fat).Length)
|
|
& $jarCmd tf $Fat | Select-String 'jeecg-module-inquiry|poi-ooxml|commons-io'
|
|
Write-Host '=== probe urls ==='
|
|
$bodyPath = Join-Path $env:TEMP 'login-body.json'
|
|
Set-Content $bodyPath '{"username":"admin","password":"123456","captcha":"","checkKey":""}' -Encoding ASCII
|
|
$login = Invoke-RestMethod -Uri 'http://127.0.0.1:8180/jeecgboot/sys/login' -Method POST -InFile $bodyPath -ContentType 'application/json;charset=UTF-8'
|
|
$h = @{ 'X-Access-Token' = $login.result.token }
|
|
foreach ($u in @(
|
|
'http://127.0.0.1:8180/jeecgboot/inquiry/quoteTemplate/list?pageNo=1&pageSize=1',
|
|
'http://127.0.0.1:8180/inquiry/quoteTemplate/list?pageNo=1&pageSize=1',
|
|
'http://127.0.0.1:8180/jeecgboot/sys/permission/getPermCode'
|
|
)) {
|
|
try {
|
|
$r = Invoke-WebRequest -Uri $u -Headers $h -UseBasicParsing -TimeoutSec 15
|
|
Write-Host ("OK " + $u.Split('?')[0].Split('/')[-1] + " status=" + $r.StatusCode + " len=" + $r.RawContentLength)
|
|
} catch {
|
|
$code = $null
|
|
try { $code = [int]$_.Exception.Response.StatusCode } catch {}
|
|
Write-Host ("FAIL status=" + $code + " url=" + $u)
|
|
}
|
|
}
|
|
Write-Host '=== stdout mapping quoteTemplate ==='
|
|
Select-String -Path 'E:\wwwroot\inquiry-new\logs\stdout.log' -Pattern 'quoteTemplate|InquiryQuoteTemplate|Mapped.*inquiry' | Select-Object -Last 15 | ForEach-Object {
|
|
$s = $_.Line
|
|
if ($s.Length -gt 220) { $s = $s.Substring(0,220) }
|
|
Write-Host $s
|
|
}
|
|
Write-Host 'DIAG_DONE'
|