Files
Leantime/.dev/remote-deploy/38_diag2.sh

40 lines
1.7 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -u
cd /var/www/onebot
echo "=== 1. zp_bom_column 全部行(正确列名) ==="
mysql -uonebot -p'OneBot_Db_7xKpQ9z' -h127.0.0.1 onebot -e "SELECT id, bomId, \`key\`, label, sortOrder FROM zp_bom_column ORDER BY bomId, sortOrder;" 2>&1 | grep -v "Warning"
echo ""
echo "=== 2. zp_bom_source 全部行 ==="
mysql -uonebot -p'OneBot_Db_7xKpQ9z' -h127.0.0.1 onebot -e "SELECT id, bomId, name, tableId FROM zp_bom_source;" 2>&1 | grep -v "Warning"
echo ""
echo "=== 3. 远程文件 md5 ==="
md5sum app/Domain/Bom/Services/Bom.php app/Domain/Bom/Services/Teable.php app/Domain/Bom/Templates/detail.blade.php
echo ""
echo "=== 4. 远程 Bom.php importSource 字段循环395-425 行) ==="
sed -n '395,425p' app/Domain/Bom/Services/Bom.php
echo ""
echo "=== 5. BOM 3 详情页渲染检查 ==="
JAR=/tmp/ob38.txt
rm -f $JAR
BODY=$(curl -s -c $JAR http://127.0.0.1:8081/auth/login)
CSRF=$(echo "$BODY" | grep -oE 'name="csrf-token" content="[^"]*"' | sed 's/.*content="//;s/"//')
curl -s -b $JAR -c $JAR -X POST http://127.0.0.1:8081/auth/login \
-d "username=ruiguo_wang@163.com" -d "password=wrg521113.." -d "_token=$CSRF" \
-H "X-CSRF-TOKEN: $CSRF" -o /dev/null
curl -s -b $JAR "http://127.0.0.1:8081/bom/show/3" -o /tmp/ob38_detail.html -w "detail HTTP=%{http_code}\n"
echo "--- 页面 th 数量及 data-key ---"
grep -oE '<th data-key="[^"]*"' /tmp/ob38_detail.html | sed 's/<th data-key="//;s/"//' | tr '\n' ' '
echo ""
echo "--- 页面里的动态列标签th 里的中文) ---"
grep -oE '<th[^>]*>[^<]*' /tmp/ob38_detail.html | head -40
echo ""
echo "=== 6. BOM 3 明细接口 JSON 前 300 字符 ==="
curl -s -b $JAR "http://127.0.0.1:8081/bom/api/3" | head -c 300
echo ""