feat(aihr): scope supervisor practice data

This commit is contained in:
2026-07-09 11:37:33 +08:00
parent 53698e7832
commit a83fb53ecd
11 changed files with 406 additions and 31 deletions
+2
View File
@@ -31,6 +31,7 @@ mkdir -p "$ROOT_DIR/.data/import"
JAR="ruoyi-admin/target/ruoyi-admin.jar"
NEEDS_BUILD=false
BACKEND_PORT="${PORT:-8080}"
if [[ ! -f "$JAR" ]]; then
NEEDS_BUILD=true
@@ -43,6 +44,7 @@ if [[ "$NEEDS_BUILD" == true ]]; then
fi
exec java -jar "$JAR" \
"--server.port=$BACKEND_PORT" \
"--spring.datasource.dynamic.datasource.master.url=jdbc:mysql://localhost:13306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true" \
"--spring.data.redis.port=16379" \
"--spring.boot.admin.client.enabled=false" \
+8
View File
@@ -9,4 +9,12 @@ if [[ ! -d node_modules ]]; then
npm install --registry=https://registry.npmmirror.com
fi
if [[ "${PORTLESS:-1}" != "0" ]] && command -v portless >/dev/null 2>&1; then
exec portless run --name wygj-admin bash -lc 'npm run dev -- --host "${HOST:-127.0.0.1}" --port "$PORT" --strictPort'
fi
if [[ "${PORTLESS:-1}" != "0" ]]; then
echo "portless is not available; falling back to http://127.0.0.1:5173/." >&2
fi
exec npm run dev -- --host 127.0.0.1 --port 5173 --strictPort
+87 -6
View File
@@ -75,8 +75,77 @@ stop_port() {
kill -9 $pids >/dev/null 2>&1 || true
}
stop_portless_route() {
local name="$1"
local pids
if ! command -v portless >/dev/null 2>&1; then
return
fi
pids="$(portless list 2>/dev/null | sed -nE "s#.*https://${name}[.]localhost.*[(]pid ([0-9]+)[)].*#\\1#p" || true)"
if [[ -z "$pids" ]]; then
echo "Portless route $name is not running."
return
fi
echo "Stopping portless route $name: $pids"
kill $pids >/dev/null 2>&1 || true
for _ in {1..20}; do
if ! portless list 2>/dev/null | grep -q "https://${name}[.]localhost"; then
return
fi
sleep 0.2
done
kill -9 $pids >/dev/null 2>&1 || true
}
stop_launchctl_job() {
local label="$1"
local domain="gui/$(id -u)/$label"
if ! command -v launchctl >/dev/null 2>&1; then
return
fi
if ! launchctl print "$domain" >/dev/null 2>&1; then
return
fi
echo "Stopping launchctl job $label"
launchctl bootout "$domain" >/dev/null 2>&1 || true
}
using_portless() {
[[ "${PORTLESS:-1}" != "0" ]] && command -v portless >/dev/null 2>&1
}
using_portless_backend() {
using_portless
}
using_portless_admin() {
using_portless
}
backend_url() {
if using_portless_backend; then
echo "https://wygj-api.localhost/"
else
echo "http://127.0.0.1:8080/"
fi
}
admin_url() {
if using_portless_admin; then
echo "https://wygj-admin.localhost/"
else
echo "http://127.0.0.1:5173/"
fi
}
stop_dev() {
stop_launchctl_job local.wygj.backend.dev
stop_portless_route wygj-api
stop_port 8080
stop_portless_route wygj-admin
stop_port 5173
stop_port 5174
}
@@ -86,6 +155,9 @@ status() {
lsof -nP -iTCP:8080 -sTCP:LISTEN || true
lsof -nP -iTCP:5173 -sTCP:LISTEN || true
lsof -nP -iTCP:5174 -sTCP:LISTEN || true
if command -v portless >/dev/null 2>&1; then
portless list || true
fi
}
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
@@ -125,8 +197,12 @@ esac
cd "$ROOT_DIR"
ensure_docker
ensure_port_free 8080
ensure_port_free 5173
if ! using_portless_backend; then
ensure_port_free 8080
fi
if ! using_portless_admin; then
ensure_port_free 5173
fi
ensure_port_free 5174
if [[ "$RESET" == true ]]; then
@@ -137,7 +213,12 @@ fi
trap cleanup INT TERM EXIT
./scripts/dev-backend.sh &
if using_portless_backend; then
portless alias --remove wygj-api >/dev/null 2>&1 || true
portless run --name wygj-api ./scripts/dev-backend.sh &
else
./scripts/dev-backend.sh &
fi
PIDS+=("$!")
./scripts/dev-frontend.sh &
@@ -146,10 +227,10 @@ PIDS+=("$!")
./scripts/dev-mobile.sh &
PIDS+=("$!")
echo "Backend: http://127.0.0.1:8080/"
echo "Admin: http://127.0.0.1:5173/"
echo "Backend: $(backend_url)"
echo "Admin: $(admin_url)"
echo "Legacy mobile fallback: http://127.0.0.1:5174/h5/user"
echo "Current user side: https://wygj-mobile-uni.localhost/h5/ (run: portless)"
echo "Current user side: https://wygj-mobile-uni.localhost/h5/ (run: cd mobile-uni && portless run --name wygj-mobile-uni npm run dev)"
echo "Qdrant: http://127.0.0.1:6333/"
echo "Press Ctrl+C to stop backend, admin frontend and legacy mobile frontend."