From a965a0d77308d2d2bf412b1b3dca989a0d41a102 Mon Sep 17 00:00:00 2001 From: user123 Date: Fri, 30 Jan 2026 18:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E7=94=9F=E6=88=90token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openclaw/install.sh | 25 ++++++++++++++---- openclaw/installer/internal/sys/sys.go | 36 ++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/openclaw/install.sh b/openclaw/install.sh index e42b709..5b5d856 100644 --- a/openclaw/install.sh +++ b/openclaw/install.sh @@ -139,6 +139,13 @@ configure_openclaw() { log_info "开始配置 OpenClaw..." mkdir -p "${CONFIG_DIR}" + + # 生成随机 Token + if command -v openssl >/dev/null 2>&1; then + GATEWAY_TOKEN=$(openssl rand -hex 16) + else + GATEWAY_TOKEN=$(date +%s%N | sha256sum | head -c 32) + fi echo -e "${CYAN}请选择 API 类型:${PLAIN}" echo "1. Anthropic 官方 API" @@ -154,9 +161,12 @@ configure_openclaw() { cat > "${CONFIG_FILE}" < "${CONFIG_FILE}" <