fix(dev): run demo check through portless

This commit is contained in:
2026-07-09 12:58:29 +08:00
parent 5f92847c00
commit 801bc26de8
+8 -7
View File
@@ -2,7 +2,7 @@
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
FRONTEND_URL="${FRONTEND_URL:-http://127.0.0.1:5173}"
FRONTEND_URL="${FRONTEND_URL:-https://wygj-admin.localhost}"
MOBILE_URL="${MOBILE_URL:-https://wygj-mobile-uni.localhost}"
cd "$ROOT_DIR"
@@ -42,7 +42,7 @@ check_pilot_samples() {
return
fi
local scenario_count calibration_stats calibration_count calibration_matched sop_total sop_usable
local scenario_count calibration_stats calibration_count calibration_matched sop_total sop_usable sop_pending
scenario_count="$(pilot_sql_scalar "SELECT COUNT(*) FROM aihr_practice_scenario WHERE tenant_id = '000000' AND position = '生活顾问' AND enabled = 1")"
calibration_stats="$(pilot_sql_scalar "
SELECT COUNT(*) AS total,
@@ -59,9 +59,10 @@ check_pilot_samples() {
) latest ON latest.id = c.id
WHERE c.tenant_id = '000000'")"
read -r calibration_count calibration_matched <<<"$calibration_stats"
sop_total="$(pilot_sql_scalar "SELECT COUNT(*) FROM aihr_sop_answer_review")"
sop_usable="$(pilot_sql_scalar "SELECT COALESCE(SUM(CASE WHEN usable = 1 THEN 1 ELSE 0 END), 0) FROM aihr_sop_answer_review")"
echo "OK: pilot gates scenarios=${scenario_count}/12 calibration=${calibration_count}/20 consistency=${calibration_matched}/${calibration_count} sop_usable=${sop_usable}/${sop_total}"
sop_total="$(pilot_sql_scalar "SELECT COUNT(*) FROM aihr_sop_answer_review WHERE tenant_id = '000000' AND status = '已评审'")"
sop_usable="$(pilot_sql_scalar "SELECT COALESCE(SUM(CASE WHEN usable = 1 THEN 1 ELSE 0 END), 0) FROM aihr_sop_answer_review WHERE tenant_id = '000000' AND status = '已评审'")"
sop_pending="$(pilot_sql_scalar "SELECT COUNT(*) FROM aihr_sop_answer_review WHERE tenant_id = '000000' AND status <> '已评审'")"
echo "OK: pilot gates scenarios=${scenario_count}/12 calibration=${calibration_count}/20 consistency=${calibration_matched}/${calibration_count} sop_usable=${sop_usable}/${sop_total} sop_pending=${sop_pending}"
[[ "${AIHR_PILOT_STRICT:-false}" != "true" ]] || {
(( scenario_count >= 12 )) || fail "pilot enabled scenarios ${scenario_count}/12"
@@ -77,11 +78,11 @@ need curl
check_url "frontend" "$FRONTEND_URL/"
check_url "mobile-uni" "$MOBILE_URL/h5/"
tenant_payload="$(curl -fsS "$FRONTEND_URL/dev-api/auth/tenant/list")"
tenant_payload="$(curl -k -fsS "$FRONTEND_URL/dev-api/auth/tenant/list")"
[[ "$tenant_payload" == *'"tenantId":"000000"'* ]] || fail "tenant list missing tenant 000000"
echo "OK: tenant list"
code_payload="$(curl -fsS "$FRONTEND_URL/dev-api/auth/code")"
code_payload="$(curl -k -fsS "$FRONTEND_URL/dev-api/auth/code")"
[[ "$code_payload" == *'"uuid"'* ]] || fail "captcha response missing uuid"
echo "OK: captcha"