#!/bin/bash # 楠岃瘉 superadmin 璧勬枡涓庤鑹?API 鍙 set -euo pipefail TOKEN=$(curl -sS -m 10 -X POST 'http://127.0.0.1:3001/api/auth/token' \ -H 'Content-Type: application/json' \ --data-raw "$(printf '{"email":"%s","password":"%s"}' "${SUPERADMIN_EMAIL:-superadmin@meoo.local}" "$SUPERADMIN_PASSWORD")" | node -pe "JSON.parse(require('fs').readFileSync(0,'utf8')).access_token") echo "profile:" curl -sS -m 10 "http://127.0.0.1:3001/api/data/query" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ --data-raw '{"table":"profiles","action":"select","select":"*, branches:branch_code(branch_name)","filters":[{"column":"id","op":"eq","value":"a0000000-0000-0000-0000-000000000001"}],"single":true}' | head -c 400 echo echo "roles:" curl -sS -m 10 "http://127.0.0.1:3001/api/data/query" \ -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ --data-raw '{"table":"user_roles","action":"select","select":"role","filters":[{"column":"user_id","op":"eq","value":"a0000000-0000-0000-0000-000000000001"}]}' | head -c 200 echo