#!/bin/bash set -u cd /var/www/onebot JAR=/tmp/ob43.txt rm -f $JAR echo "=== 登录 ===" 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 -w "login HTTP=%{http_code}\n" echo "" echo "=== 详情页渲染 ===" curl -s -b $JAR -o /tmp/ob43.html -w "bom/show/3 HTTP=%{http_code}\n" http://127.0.0.1:8081/bom/show/3 echo "" echo "=== 关键元素检查 ===" echo -n "Handsontable js 引入: "; grep -c 'handsontable.full.min.js' /tmp/ob43.html echo -n "Handsontable css 引入: "; grep -c 'handsontable.full.min.css' /tmp/ob43.html echo -n "bomHot 容器: "; grep -c 'id="bomHot"' /tmp/ob43.html echo -n "imageRenderer: "; grep -c 'imageRenderer' /tmp/ob43.html echo -n "fileRenderer: "; grep -c 'fileRenderer' /tmp/ob43.html echo -n "new Handsontable: "; grep -c 'new Handsontable' /tmp/ob43.html echo -n "附件 URL (attachments/read): "; grep -c 'attachments/read' /tmp/ob43.html echo -n "图片缩略图 img 标签: "; grep -c '