Files
ssw-ontology/run.sh
T
admin e28c8add5f fix(ai): 修复 AI 摄取弹窗卡死 + 端口默认 8081→8082
- AIView.doExtract 改用 try/catch/finally, finally 必关弹窗 + 清 loading;
  Element Plus 新版 ElMessage(opts) 返回 MessageHandler 实例, 调 .close()
  才是正确用法 (旧 ElMessage.close(id) 静态方法在新版本里已移除).
- run.sh / README.md / docs/README.md 默认端口 8081 改为 8082,
  避免与 docker compose 里的 ontology 服务端口冲突.

测试: 浏览器实际点击开始提取, 弹窗完成后立刻关闭, 无 Console 报错.
2026-08-07 19:16:00 +08:00

28 lines
1.3 KiB
Bash
Executable File
Raw 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.
#!/usr/bin/env bash
# 直接以 Go 二进制运行本体平台(不依赖 docker)。
# 数据库指向 workspace 内的 Postgres(jnpf-postgres 容器,宿主机映射 15432)。
# AI 配置:默认从仓库根 .env 读取(由 Go 端 joho/godotenv 自动 load)。
set -euo pipefail
cd "$(dirname "$0")"
# 若二进制不存在则先编译
if [ ! -x bin/server ]; then
echo "[run] bin/server 不存在,先构建..."
./build.sh
fi
export DATABASE_URL="${DATABASE_URL:-postgres://dacli:dacli123@localhost:15432/shangshu?sslmode=disable}"
# 默认 8082(8080 在本机被 Trustee KBS 占用;如需其他端口可用环境变量覆盖)
export HTTP_PORT="${HTTP_PORT:-8082}"
# 脚本即位于仓库根目录,REPO_ROOT 取脚本所在目录(目录已扁平化,不再需要 cd ..)
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
export ARCHIVE_DIR="${ARCHIVE_DIR:-${REPO_ROOT}/archive}"
export SEED_ON_START="${SEED_ON_START:-true}"
export ALLOW_CORS="${ALLOW_CORS:-true}"
echo "[run] 启动尚数网本体管理平台 -> http://localhost:${HTTP_PORT}"
echo "[run] 数据库: localhost:15432/shangshu (user dacli)"
echo "[run] 知识文件根目录: ${ARCHIVE_DIR}"
echo "[run] AI 提供者: ${AI_BASE_URL:-<启发式兜底>} (model=${AI_MODEL:-<none>})"
exec ./bin/server