feat: API Key 前缀改为 sk-ot
- apikey 包 prefix 常量 sk- → sk-ot(生成/校验/展示前缀统一驱动) - 鉴权错误提示同步更新为 sk-ot 格式 - 测试断言改用常量,避免硬编码长度 - 前端 curl 示例与 README/PLANNING 文档同步
This commit is contained in:
@@ -79,7 +79,7 @@ const baseURL = `${window.location.origin}/v1`
|
||||
<div class="space-y-3 p-4 leading-relaxed">
|
||||
<div>
|
||||
<p class="text-muted"><span class="text-accent">$</span> curl {{ baseURL }}/chat/completions</p>
|
||||
<p class="text-muted"> -H <span class="text-accent">"Authorization: Bearer sk-..."</span> \</p>
|
||||
<p class="text-muted"> -H <span class="text-accent">"Authorization: Bearer sk-ot..."</span> \</p>
|
||||
<p class="text-muted"> -d <span class="text-ink">'{"model": "claude-sonnet-5", "messages": [{"role": "user", "content": "你好"}]}'</span></p>
|
||||
</div>
|
||||
<div class="border-t border-edge pt-3 text-muted">
|
||||
@@ -136,7 +136,7 @@ const baseURL = `${window.location.origin}/v1`
|
||||
</p>
|
||||
</div>
|
||||
<div class="card p-5">
|
||||
<p class="font-mono text-xs text-muted">sk-…</p>
|
||||
<p class="font-mono text-xs text-muted">sk-ot…</p>
|
||||
<h3 class="mt-2 text-lg font-semibold">API Key 管理</h3>
|
||||
<p class="mt-2 text-sm leading-relaxed text-muted">
|
||||
密钥仅存哈希,支持配额、过期与模型白名单,创建时一次性展示。
|
||||
|
||||
@@ -49,7 +49,7 @@ function daysAgo(n: number): string {
|
||||
// 快速开始:Base URL 用浏览器当前 host(兼容端点),curl 示例
|
||||
const baseURL = `${window.location.origin}/v1`
|
||||
const curlCmd = `curl ${baseURL}/chat/completions \\
|
||||
-H "Authorization: Bearer sk-xxxx" \\
|
||||
-H "Authorization: Bearer sk-ot-xxxx" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{"model":"gpt-test","stream":true,"messages":[{"role":"user","content":"hi"}]}'`
|
||||
const copied = ref('')
|
||||
|
||||
Reference in New Issue
Block a user