fix(saas): 新用户 llm_routing 默认改为 relay 使 SaaS token pool 成为主路径
Some checks failed
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
Some checks failed
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
- handlers.rs: SQL INSERT 和 LoginResponse 中 'local' → 'relay' - 新增 migration: ALTER llm_routing SET DEFAULT 'relay' - 符合管家式服务理念:用户无需配置 API Key,SaaS 自动中转
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
-- 20260411000001_accounts_llm_routing_default_relay.sql
|
||||
-- 新用户默认走 SaaS relay (Token Pool), 符合管家式服务理念
|
||||
ALTER TABLE accounts ALTER COLUMN llm_routing SET DEFAULT 'relay';
|
||||
@@ -120,7 +120,7 @@ pub async fn register(
|
||||
|
||||
sqlx::query(
|
||||
"INSERT INTO accounts (id, username, email, password_hash, display_name, role, status, created_at, updated_at, llm_routing)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, 'active', $7, $7, 'local')"
|
||||
VALUES ($1, $2, $3, $4, $5, $6, 'active', $7, $7, 'relay')"
|
||||
)
|
||||
.bind(&account_id)
|
||||
.bind(&req.username)
|
||||
@@ -176,7 +176,7 @@ pub async fn register(
|
||||
status: "active".into(),
|
||||
totp_enabled: false,
|
||||
created_at: now.to_rfc3339(),
|
||||
llm_routing: "local".into(),
|
||||
llm_routing: "relay".into(),
|
||||
},
|
||||
};
|
||||
let jar = set_auth_cookies(jar, &resp.token, &refresh_token);
|
||||
|
||||
Reference in New Issue
Block a user