mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-05-28 19:45:03 +00:00
3 lines
43 KiB
JavaScript
3 lines
43 KiB
JavaScript
import{c as p,x as a,y as o,z as t,P as d,O as n,aT as w,R as f,Q as x,u as c,L as $,ac as h,C as k,r as P,I as A,M as L}from"./vue-vendor-DV7DYXbz.js";import{_ as N}from"./index-BwuuCBjq.js";function I(){const r=()=>{let u="";if(window.location.origin)u=window.location.origin;else{const b=window.location.protocol,y=window.location.hostname,g=window.location.port;u=b+"//"+y,g&&(b==="http:"&&g!=="80"||b==="https:"&&g!=="443")&&(u+=":"+g)}if(!u){const b=window.location.href,y=b.indexOf("/",8);if(y!==-1)u=b.substring(0,y);else return""}return u},i=p(()=>r()+"/api"),l=p(()=>r()+"/gemini"),s=p(()=>r()+"/openai"),v=p(()=>r()+"/droid/claude"),e=p(()=>r()+"/droid/openai");return{currentBaseUrl:i,geminiBaseUrl:l,openaiBaseUrl:s,droidClaudeBaseUrl:v,droidOpenaiBaseUrl:e}}const T={class:"rounded-lg border border-green-200 bg-green-50 p-3 dark:border-green-500/40 dark:bg-green-950/30 sm:p-4"},O={class:"mb-2 text-xs text-green-700 dark:text-green-300 sm:mb-3 sm:text-sm"},E={__name:"VerifyInstall",props:{terminal:{type:String,default:"终端"}},setup(r){return(i,l)=>(o(),a("div",T,[l[0]||(l[0]=t("h6",{class:"mb-2 text-sm font-medium text-green-800 dark:text-green-300 sm:text-base"}," 验证安装是否成功 ",-1)),t("p",O," 安装完成后,打开 "+d(r.terminal)+",输入以下命令: ",1),l[1]||(l[1]=t("div",{class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},[t("div",{class:"whitespace-nowrap text-gray-300"},"node --version"),t("div",{class:"whitespace-nowrap text-gray-300"},"npm --version")],-1)),l[2]||(l[2]=t("p",{class:"mt-2 text-xs text-green-700 dark:text-green-300 sm:text-sm"}," 如果显示版本号,说明安装成功了! ",-1))]))}},_={class:"mb-4 sm:mb-10 sm:mb-6"},U={class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},R={class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},j={class:"mb-4 text-sm text-gray-600 dark:text-gray-400 sm:mb-4 sm:mb-6 sm:text-base"},G={key:0,class:"node-install-section"},M={key:1,class:"node-install-section"},B={key:2,class:"node-install-section"},C={__name:"NodeInstallTutorial",props:{platform:{type:String,required:!0,validator:r=>["windows","macos","linux"].includes(r)},stepNumber:{type:[Number,String],default:1},toolName:{type:String,default:"CLI 工具"}},setup(r){return(i,l)=>(o(),a("div",_,[t("h4",U,[t("span",R,d(r.stepNumber),1),l[0]||(l[0]=n(" 安装 Node.js 环境 ",-1))]),t("p",j,d(r.toolName)+" 需要 Node.js 环境才能运行。 ",1),r.platform==="windows"?(o(),a("div",G,[l[1]||(l[1]=w('<div class="mb-4 rounded-xl border border-blue-100 bg-gradient-to-r from-blue-50 to-indigo-50 p-4 dark:border-blue-500/40 dark:from-blue-950/30 dark:to-indigo-950/30 sm:mb-6 sm:p-6"><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-200 sm:mb-3 sm:text-lg"><i class="fab fa-windows mr-2 text-blue-600"></i> Windows 安装方法 </h5><div class="mb-3 sm:mb-4"><p class="mb-2 text-sm text-gray-700 dark:text-gray-300 sm:mb-3 sm:text-base"> 方法一:官网下载(推荐) </p><ol class="ml-2 list-inside list-decimal space-y-1 text-xs text-gray-600 dark:text-gray-400 sm:ml-4 sm:space-y-2 sm:text-sm"><li> 打开浏览器访问 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-800 dark:text-yellow-400 sm:px-2 sm:text-sm">https://nodejs.org/</code></li><li>点击 "LTS" 版本进行下载(推荐长期支持版本)</li><li> 下载完成后双击 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-800 dark:text-yellow-400 sm:px-2 sm:text-sm">.msi</code> 文件 </li><li>按照安装向导完成安装,保持默认设置即可</li></ol></div><div class="mb-3 sm:mb-4"><p class="mb-2 text-sm text-gray-700 dark:text-gray-300 sm:mb-3 sm:text-base"> 方法二:使用包管理器 </p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm"> 如果你安装了 Chocolatey 或 Scoop,可以使用命令行安装: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 dark:border dark:border-gray-700 dark:bg-gray-900 sm:p-4 sm:text-sm"><div class="mb-2"># 使用 Chocolatey</div><div class="whitespace-nowrap text-gray-300">choco install nodejs</div><div class="mb-2 mt-3"># 或使用 Scoop</div><div class="whitespace-nowrap text-gray-300">scoop install nodejs</div></div></div><div class="rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-500/40 dark:bg-blue-950/30 sm:p-4"><h6 class="mb-2 text-sm font-medium text-blue-800 dark:text-blue-300 sm:text-base"> Windows 注意事项 </h6><ul class="space-y-1 text-xs text-blue-700 dark:text-blue-300 sm:text-sm"><li>• 建议使用 PowerShell 而不是 CMD</li><li>• 如果遇到权限问题,尝试以管理员身份运行</li><li>• 某些杀毒软件可能会误报,需要添加白名单</li></ul></div></div>',1)),f(E,{terminal:"PowerShell 或 CMD"})])):r.platform==="macos"?(o(),a("div",M,[l[2]||(l[2]=w('<div class="mb-4 rounded-xl border border-gray-200 bg-gradient-to-r from-gray-50 to-gray-50 p-4 dark:border-gray-700 dark:from-gray-800 dark:to-gray-800 sm:mb-6 sm:p-6"><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-200 sm:mb-3 sm:text-lg"><i class="fab fa-apple mr-2 text-gray-700 dark:text-gray-400"></i> macOS 安装方法 </h5><div class="mb-4"><p class="mb-3 text-gray-700 dark:text-gray-300">方法一:使用 Homebrew(推荐)</p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm"> 如果你已经安装了 Homebrew,使用它安装 Node.js 会更方便: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 dark:border dark:border-gray-700 dark:bg-gray-900 sm:p-4 sm:text-sm"><div class="mb-2"># 更新 Homebrew</div><div class="whitespace-nowrap text-gray-300">brew update</div><div class="mb-2 mt-3"># 安装 Node.js</div><div class="whitespace-nowrap text-gray-300">brew install node</div></div></div><div class="mb-4"><p class="mb-3 text-gray-700 dark:text-gray-300">方法二:官网下载</p><ol class="ml-2 list-inside list-decimal space-y-1 text-xs text-gray-600 dark:text-gray-400 sm:ml-4 sm:space-y-2 sm:text-sm"><li> 访问 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm">https://nodejs.org/</code></li><li>下载适合 macOS 的 LTS 版本</li><li> 打开下载的 <code class="rounded bg-gray-100 px-1 py-1 text-xs dark:bg-gray-700 sm:px-2 sm:text-sm">.pkg</code> 文件 </li><li>按照安装程序指引完成安装</li></ol></div><div class="rounded-lg border border-gray-200 bg-gray-50 p-3 dark:border-gray-600 dark:bg-gray-800 sm:p-4"><h6 class="mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"> macOS 注意事项 </h6><ul class="space-y-1 text-xs text-gray-700 dark:text-gray-300 sm:text-sm"><li> • 如果遇到权限问题,可能需要使用 <code class="rounded bg-gray-200 px-1 text-xs dark:bg-gray-700 sm:text-sm">sudo</code></li><li>• 首次运行可能需要在系统偏好设置中允许</li><li>• 建议使用 Terminal 或 iTerm2</li></ul></div></div>',1)),f(E,{terminal:"Terminal"})])):(o(),a("div",B,[l[3]||(l[3]=w('<div class="mb-4 rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-amber-50 p-4 dark:border-orange-500/40 dark:from-orange-950/30 dark:to-amber-950/30 sm:mb-6 sm:p-6"><h5 class="mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-200 sm:mb-3 sm:text-lg"><i class="fab fa-linux mr-2 text-orange-600"></i> Linux / WSL2 安装方法 </h5><div class="mb-4"><p class="mb-3 text-gray-700 dark:text-gray-300">方法一:使用 nvm(推荐)</p><p class="mb-2 text-xs text-gray-600 dark:text-gray-400 sm:text-sm"> nvm 可以方便地管理多个 Node.js 版本: </p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 dark:border dark:border-gray-700 dark:bg-gray-900 sm:p-4 sm:text-sm"><div class="mb-2"># 安装 nvm</div><div class="whitespace-nowrap text-gray-300"> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash </div><div class="mb-2 mt-3"># 重新加载 shell 配置</div><div class="whitespace-nowrap text-gray-300">source ~/.bashrc</div><div class="mb-2 mt-3"># 安装最新 LTS 版本</div><div class="whitespace-nowrap text-gray-300">nvm install --lts</div></div></div><div class="mb-4"><p class="mb-3 text-gray-700 dark:text-gray-300">方法二:使用包管理器</p><div class="overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 dark:border dark:border-gray-700 dark:bg-gray-900 sm:p-4 sm:text-sm"><div class="mb-2"># Ubuntu/Debian</div><div class="whitespace-nowrap text-gray-300"> curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - </div><div class="whitespace-nowrap text-gray-300">sudo apt-get install -y nodejs</div><div class="mb-2 mt-3"># Fedora</div><div class="whitespace-nowrap text-gray-300">sudo dnf install nodejs</div><div class="mb-2 mt-3"># Arch Linux</div><div class="whitespace-nowrap text-gray-300">sudo pacman -S nodejs npm</div></div></div><div class="rounded-lg border border-orange-200 bg-orange-50 p-3 dark:border-orange-500/40 dark:bg-orange-950/30 sm:p-4"><h6 class="mb-2 text-sm font-medium text-orange-800 dark:text-orange-300 sm:text-base"> Linux / WSL2 注意事项 </h6><ul class="space-y-1 text-xs text-orange-700 dark:text-orange-300 sm:text-sm"><li>• WSL2 用户建议在 Linux 子系统中安装,而不是 Windows</li><li>• 使用 nvm 可以避免权限问题</li><li>• 确保 shell 配置文件正确加载了 nvm</li></ul></div></div>',1)),f(E,{terminal:"终端"})]))]))}},D={class:"tutorial-content"},H={class:"mb-4 sm:mb-10 sm:mb-6"},V={class:"mb-4 rounded-xl border border-green-100 bg-gradient-to-r from-green-50 to-emerald-50 p-4 dark:border-green-500/40 dark:from-green-950/30 dark:to-emerald-950/30 sm:mb-6 sm:p-6"},W={class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"},K={class:"mb-4 overflow-x-auto rounded-lg bg-gray-900 p-3 font-mono text-xs text-green-400 sm:p-4 sm:text-sm"},q={class:"whitespace-nowrap text-gray-300"},F={class:"mt-4 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-500/40 dark:bg-blue-950/30 sm:p-4"},Y={class:"space-y-1 text-xs text-blue-700 dark:text-blue-300 sm:text-sm"},z={class:"mb-6 sm:mb-10"},J={class:"mb-4 rounded-xl border border-purple-100 bg-gradient-to-r from-purple-50 to-pink-50 p-4 dark:border-purple-500/40 dark:from-purple-950/30 dark:to-pink-950/30 sm:mb-6 sm:p-6"},Q={class:"space-y-4"},X={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},Z={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},tt={class:"whitespace-nowrap text-gray-300"},et={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},st={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},rt={class:"whitespace-nowrap text-gray-300"},ot={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},at={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},dt={class:"whitespace-nowrap text-gray-300"},lt={class:"rounded-lg border border-purple-200 bg-white p-3 dark:border-purple-700 dark:bg-gray-800 sm:p-4"},nt={class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},mt={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},it={class:"whitespace-nowrap text-gray-300"},xt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},gt={class:"whitespace-nowrap text-gray-300"},bt={class:"mt-6 rounded-lg border border-indigo-200 bg-indigo-50 p-3 dark:border-indigo-500/40 dark:bg-indigo-950/30 sm:p-4"},pt={class:"mb-3 space-y-2"},ut={class:"text-sm text-indigo-700 dark:text-indigo-300"},yt={class:"rounded bg-indigo-100 px-1 dark:bg-indigo-900"},vt={class:"mt-6 rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-500/40 dark:bg-blue-950/30 sm:p-4"},ct={class:"space-y-4"},wt={class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"},ft={class:"space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},kt={class:"mt-3 space-y-2"},ht={class:"rounded bg-gray-100 p-2 font-mono text-sm dark:bg-gray-700"},It={class:"mb-6 sm:mb-8"},Ct={class:"rounded-xl border border-orange-100 bg-gradient-to-r from-orange-50 to-yellow-50 p-4 dark:border-orange-500/40 dark:from-orange-950/30 dark:to-yellow-950/30 sm:p-6"},St={class:"space-y-4"},Et={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},$t={class:"whitespace-nowrap text-gray-300"},Pt={class:"mb-8"},At={class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},Lt={class:"space-y-4"},Nt={class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800"},Tt={class:"px-3 pb-3 text-gray-600 dark:text-gray-400 sm:px-4 sm:pb-4"},Ot={class:"list-inside list-disc space-y-1 text-sm"},_t={key:0,class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800"},Ut={class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800"},Rt={class:"px-3 pb-3 text-gray-600 dark:text-gray-400 sm:px-4 sm:pb-4"},jt={class:"list-inside list-disc space-y-1 text-sm"},Gt={class:"rounded bg-gray-200 px-1 text-xs dark:bg-gray-700 sm:text-sm"},Mt={key:1,class:"rounded-lg border border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800"},Bt={__name:"ClaudeCodeTutorial",props:{platform:{type:String,required:!0,validator:r=>["windows","macos","linux"].includes(r)}},setup(r){const i=r,{currentBaseUrl:l}=I(),s=p(()=>({windows:"Windows",macos:"macOS",linux:"Linux / WSL2"})[i.platform]);return(v,e)=>(o(),a("div",D,[f(C,{platform:r.platform,"step-number":1,"tool-name":"Claude Code"},null,8,["platform"]),t("div",H,[e[10]||(e[10]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-green-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"2"),n(" 安装 Claude Code ")],-1)),t("div",V,[e[8]||(e[8]=t("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-200 sm:mb-3 sm:text-lg"},[t("i",{class:"fas fa-download mr-2 text-green-600"}),n(" 安装 Claude Code ")],-1)),t("p",W,d(r.platform==="windows"?"打开 PowerShell 或 CMD":"打开终端")+",运行以下命令: ",1),t("div",K,[e[0]||(e[0]=t("div",{class:"mb-2"},"# 全局安装 Claude Code",-1)),t("div",q,d(r.platform==="windows"?"npm install -g @anthropic-ai/claude-code":"sudo npm install -g @anthropic-ai/claude-code"),1)]),e[9]||(e[9]=t("p",{class:"text-sm text-gray-600 dark:text-gray-400"}," 这个命令会从 npm 官方仓库下载并安装最新版本的 Claude Code。 ",-1)),t("div",F,[e[7]||(e[7]=t("h6",{class:"mb-2 text-sm font-medium text-blue-800 dark:text-blue-300 sm:text-base"}," 提示 ",-1)),t("ul",Y,[r.platform==="windows"?(o(),a(x,{key:0},[e[1]||(e[1]=t("li",null,"• 建议使用 PowerShell 而不是 CMD,功能更强大",-1)),e[2]||(e[2]=t("li",null,"• 如果遇到权限问题,以管理员身份运行 PowerShell",-1))],64)):r.platform==="macos"?(o(),a(x,{key:1},[e[3]||(e[3]=t("li",null,"• 如果遇到权限问题,可以使用 sudo",-1)),e[4]||(e[4]=t("li",null,"• 或者使用 nvm 安装的 Node.js 避免权限问题",-1))],64)):(o(),a(x,{key:2},[e[5]||(e[5]=t("li",null,"• 使用 nvm 安装的 Node.js 可以避免 sudo",-1)),e[6]||(e[6]=t("li",null,"• WSL2 用户确保在 Linux 子系统中运行",-1))],64))])])]),e[11]||(e[11]=w('<div class="rounded-lg border border-green-200 bg-green-50 p-3 dark:border-green-500/40 dark:bg-green-950/30 sm:p-4"><h6 class="mb-2 font-medium text-green-800 dark:text-green-300">验证 Claude Code 安装</h6><p class="mb-3 text-sm text-green-700 dark:text-green-300"> 安装完成后,输入以下命令检查是否安装成功: </p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"><div class="whitespace-nowrap text-gray-300">claude --version</div></div><p class="mt-2 text-sm text-green-700 dark:text-green-300"> 如果显示版本号,恭喜你!Claude Code 已经成功安装了。 </p></div>',1))]),t("div",z,[e[44]||(e[44]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-purple-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"3"),n(" 设置环境变量 ")],-1)),t("div",J,[e[28]||(e[28]=t("h5",{class:"mb-2 flex items-center text-base font-semibold text-gray-800 dark:text-gray-200 sm:mb-3 sm:text-lg"},[t("i",{class:"fas fa-cog mr-2 text-purple-600"}),n(" 配置 Claude Code 环境变量 ")],-1)),e[29]||(e[29]=t("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 为了让 Claude Code 连接到你的中转服务,需要设置两个环境变量: ",-1)),t("div",Q,[r.platform==="windows"?(o(),a(x,{key:0},[t("div",X,[e[13]||(e[13]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 方法一:PowerShell 临时设置(当前会话) ",-1)),e[14]||(e[14]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"}," 在 PowerShell 中运行以下命令: ",-1)),t("div",Z,[t("div",tt,' $env:ANTHROPIC_BASE_URL = "'+d(c(l))+'" ',1),e[12]||(e[12]=t("div",{class:"whitespace-nowrap text-gray-300"},' $env:ANTHROPIC_AUTH_TOKEN = "你的API密钥" ',-1))]),e[15]||(e[15]=t("p",{class:"mt-2 text-xs text-yellow-700 dark:text-yellow-400"},' 💡 记得将 "你的API密钥" 替换为在上方 "API Keys" 标签页中创建的实际密钥。 ',-1))]),t("div",et,[e[18]||(e[18]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 方法二:PowerShell 永久设置(用户级) ",-1)),e[19]||(e[19]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"}," 在 PowerShell 中运行以下命令设置用户级环境变量: ",-1)),t("div",st,[e[16]||(e[16]=t("div",{class:"mb-2"},"# 设置用户级环境变量(永久生效)",-1)),t("div",rt,' [System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "'+d(c(l))+'", [System.EnvironmentVariableTarget]::User) ',1),e[17]||(e[17]=t("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "你的API密钥", [System.EnvironmentVariableTarget]::User) ',-1))]),e[20]||(e[20]=t("p",{class:"mt-2 text-xs text-blue-700 dark:text-blue-300"}," 💡 设置后需要重新打开 PowerShell 窗口才能生效。 ",-1))])],64)):(o(),a(x,{key:1},[t("div",ot,[e[22]||(e[22]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 方法一:临时设置(当前会话) ",-1)),e[23]||(e[23]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},"在终端中运行以下命令:",-1)),t("div",at,[t("div",dt,' export ANTHROPIC_BASE_URL="'+d(c(l))+'" ',1),e[21]||(e[21]=t("div",{class:"whitespace-nowrap text-gray-300"},' export ANTHROPIC_AUTH_TOKEN="你的API密钥" ',-1))]),e[24]||(e[24]=t("p",{class:"mt-2 text-xs text-yellow-700 dark:text-yellow-400"},' 💡 记得将 "你的API密钥" 替换为在上方 "API Keys" 标签页中创建的实际密钥。 ',-1))]),t("div",lt,[e[26]||(e[26]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 方法二:永久设置(Shell 配置文件) ",-1)),t("p",nt," 将以下内容添加到你的 shell 配置文件中("+d(r.platform==="macos"?"~/.zshrc":"~/.bashrc")+"): ",1),t("div",mt,[t("div",it,' export ANTHROPIC_BASE_URL="'+d(c(l))+'" ',1),e[25]||(e[25]=t("div",{class:"whitespace-nowrap text-gray-300"},' export ANTHROPIC_AUTH_TOKEN="你的API密钥" ',-1))]),e[27]||(e[27]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},"然后执行:",-1)),t("div",xt,[t("div",gt," source "+d(r.platform==="macos"?"~/.zshrc":"~/.bashrc"),1)])])],64))])]),t("div",bt,[e[32]||(e[32]=t("h6",{class:"mb-2 font-medium text-indigo-800 dark:text-indigo-300"}," VSCode Claude 插件配置 ",-1)),e[33]||(e[33]=t("p",{class:"mb-3 text-sm text-indigo-700 dark:text-indigo-300"}," 如果使用 VSCode 的 Claude 插件,需要在配置文件中进行设置: ",-1)),t("div",pt,[t("p",ut,[e[30]||(e[30]=t("strong",null,"配置文件位置:",-1)),t("code",yt,d(r.platform==="windows"?"C:\\Users\\你的用户名\\.claude\\config.json":"~/.claude/config.json"),1)]),e[31]||(e[31]=t("p",{class:"text-xs text-indigo-600 dark:text-indigo-400"}," 💡 如果该文件不存在,请手动创建。 ",-1))]),e[34]||(e[34]=t("div",{class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},[t("div",{class:"whitespace-nowrap text-gray-300"},"{"),t("div",{class:"whitespace-nowrap text-gray-300"},'"primaryApiKey": "crs"'),t("div",{class:"whitespace-nowrap text-gray-300"},"}")],-1))]),t("div",vt,[e[42]||(e[42]=t("h6",{class:"mb-2 font-medium text-blue-800 dark:text-blue-300"},"验证环境变量设置",-1)),e[43]||(e[43]=t("p",{class:"mb-3 text-sm text-blue-700 dark:text-blue-300"}," 设置完环境变量后,可以通过以下命令验证是否设置成功: ",-1)),t("div",ct,[t("div",null,[t("h6",wt,d(r.platform==="windows"?"在 PowerShell 中验证:":"在终端中验证:"),1),t("div",ft,[r.platform==="windows"?(o(),a(x,{key:0},[e[35]||(e[35]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $env:ANTHROPIC_BASE_URL",-1)),e[36]||(e[36]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $env:ANTHROPIC_AUTH_TOKEN",-1))],64)):(o(),a(x,{key:1},[e[37]||(e[37]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $ANTHROPIC_BASE_URL",-1)),e[38]||(e[38]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $ANTHROPIC_AUTH_TOKEN",-1))],64))])])]),t("div",kt,[e[40]||(e[40]=t("p",{class:"text-sm text-blue-700 dark:text-blue-300"},[t("strong",null,"预期输出示例:")],-1)),t("div",ht,[t("div",null,d(c(l)),1),e[39]||(e[39]=t("div",null,"cr_xxxxxxxxxxxxxxxxxx",-1))]),e[41]||(e[41]=t("p",{class:"text-xs text-blue-700 dark:text-blue-300"}," 💡 如果输出为空或显示变量名本身,说明环境变量设置失败,请重新设置。 ",-1))])])]),t("div",It,[e[51]||(e[51]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-orange-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"4"),n(" 开始使用 Claude Code ")],-1)),t("div",Ct,[e[50]||(e[50]=t("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 现在你可以开始使用 Claude Code 了! ",-1)),t("div",St,[e[49]||(e[49]=t("div",null,[t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 启动 Claude Code "),t("div",{class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},[t("div",{class:"whitespace-nowrap text-gray-300"},"claude")])],-1)),t("div",null,[e[48]||(e[48]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 在特定项目中使用 ",-1)),t("div",Et,[e[45]||(e[45]=t("div",{class:"mb-2"},"# 进入你的项目目录",-1)),t("div",$t," cd "+d(r.platform==="windows"?"C:\\path\\to\\your\\project":"/path/to/your/project"),1),e[46]||(e[46]=t("div",{class:"mb-2 mt-2"},"# 启动 Claude Code",-1)),e[47]||(e[47]=t("div",{class:"whitespace-nowrap text-gray-300"},"claude",-1))])])])])]),t("div",Pt,[t("h4",At,[e[52]||(e[52]=t("i",{class:"fas fa-wrench mr-2 text-red-600 sm:mr-3"},null,-1)),n(" "+d(s.value)+" 常见问题解决 ",1)]),t("div",Lt,[t("details",Nt,[e[58]||(e[58]=t("summary",{class:"cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 sm:p-4 sm:text-base"},' 安装时提示 "permission denied" 错误 ',-1)),t("div",Tt,[e[57]||(e[57]=t("p",{class:"mb-2"},"这通常是权限问题,尝试以下解决方法:",-1)),t("ul",Ot,[r.platform==="windows"?(o(),a(x,{key:0},[e[53]||(e[53]=t("li",null,"以管理员身份运行 PowerShell",-1)),e[54]||(e[54]=t("li",null,[n(" 或者配置 npm 使用用户目录:"),t("code",{class:"rounded bg-gray-200 px-1 text-xs dark:bg-gray-700 sm:text-sm"},"npm config set prefix %APPDATA%\\npm")],-1))],64)):(o(),a(x,{key:1},[e[55]||(e[55]=t("li",null,"使用 sudo 运行安装命令",-1)),e[56]||(e[56]=t("li",null,"或者使用 nvm 安装 Node.js 避免权限问题",-1))],64))])])]),r.platform==="windows"?(o(),a("details",_t,e[59]||(e[59]=[w('<summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 sm:p-4 sm:text-base"> PowerShell 执行策略错误 </summary><div class="px-3 pb-3 text-gray-600 dark:text-gray-400 sm:px-4 sm:pb-4"><p class="mb-2">如果遇到执行策略限制,运行:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"><div class="whitespace-nowrap text-gray-300"> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser </div></div></div>',2)]))):$("",!0),t("details",Ut,[e[67]||(e[67]=t("summary",{class:"cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 sm:p-4 sm:text-base"}," 环境变量设置后不生效 ",-1)),t("div",Rt,[e[66]||(e[66]=t("p",{class:"mb-2"},"设置永久环境变量后需要:",-1)),t("ul",jt,[r.platform==="windows"?(o(),a(x,{key:0},[e[60]||(e[60]=t("li",null,"重新启动 PowerShell 或 CMD",-1)),e[61]||(e[61]=t("li",null,"或者注销并重新登录 Windows",-1)),e[62]||(e[62]=t("li",null,[n(" 验证设置:"),t("code",{class:"rounded bg-gray-200 px-1 text-xs dark:bg-gray-700 sm:text-sm"},"echo $env:ANTHROPIC_BASE_URL")],-1))],64)):(o(),a(x,{key:1},[e[64]||(e[64]=t("li",null,"重新打开终端窗口",-1)),t("li",null,[e[63]||(e[63]=n(" 或者执行 ",-1)),t("code",Gt,"source "+d(r.platform==="macos"?"~/.zshrc":"~/.bashrc"),1)]),e[65]||(e[65]=t("li",null,[n(" 验证设置:"),t("code",{class:"rounded bg-gray-200 px-1 text-xs dark:bg-gray-700 sm:text-sm"},"echo $ANTHROPIC_BASE_URL")],-1))],64))])])]),r.platform==="linux"?(o(),a("details",Mt,e[68]||(e[68]=[w('<summary class="cursor-pointer p-3 text-sm font-medium text-gray-800 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 sm:p-4 sm:text-base"> WSL2 中无法访问 Windows 文件 </summary><div class="px-3 pb-3 text-gray-600 dark:text-gray-400 sm:px-4 sm:pb-4"><p class="mb-2">WSL2 可以通过 /mnt/ 路径访问 Windows 文件:</p><div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"><div class="whitespace-nowrap text-gray-300">cd /mnt/c/Users/你的用户名/项目目录</div></div></div>',2)]))):$("",!0)])])]))}},Dt={class:"tutorial-section"},Ht={class:"mb-4 sm:mb-10 sm:mb-6"},Vt={class:"space-y-4"},Wt={class:"rounded-lg border border-green-200 bg-white p-3 dark:border-green-700 dark:bg-gray-800 sm:p-4"},Kt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},qt={class:"whitespace-nowrap text-gray-300"},Ft={class:"rounded-lg border border-green-200 bg-white p-3 dark:border-green-700 dark:bg-gray-800 sm:p-4"},Yt={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},zt={class:"whitespace-nowrap text-gray-300"},Jt={class:"rounded-lg border border-green-200 bg-white p-3 dark:border-green-700 dark:bg-gray-800 sm:p-4"},Qt={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Xt={class:"whitespace-nowrap text-gray-300"},Zt={class:"rounded-lg border border-green-200 bg-white p-3 dark:border-green-700 dark:bg-gray-800 sm:p-4"},te={class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},ee={class:"mb-3 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},se={class:"whitespace-nowrap text-gray-300"},re={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},oe={class:"whitespace-nowrap text-gray-300"},ae={class:"rounded-lg border border-green-200 bg-green-50 p-3 dark:border-green-500/40 dark:bg-green-950/30 sm:p-4"},de={class:"mb-3 text-sm text-green-700 dark:text-green-300"},le={class:"space-y-1 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},ne={__name:"GeminiCliTutorial",props:{platform:{type:String,required:!0,validator:r=>["windows","macos","linux"].includes(r)}},setup(r){const{geminiBaseUrl:i}=I();return(l,s)=>(o(),a("div",Dt,[f(C,{platform:r.platform,"step-number":1,"tool-name":"Gemini CLI"},null,8,["platform"]),t("div",Ht,[s[27]||(s[27]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-green-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"2"),n(" 配置 Gemini CLI 环境变量 ")],-1)),s[28]||(s[28]=t("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 设置以下环境变量以连接到中转服务: ",-1)),t("div",Vt,[r.platform==="windows"?(o(),a(x,{key:0},[t("div",Wt,[s[2]||(s[2]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," PowerShell 设置方法 ",-1)),s[3]||(s[3]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"}," 在 PowerShell 中运行以下命令: ",-1)),t("div",Kt,[t("div",qt,' $env:GOOGLE_GEMINI_BASE_URL = "'+d(c(i))+'" ',1),s[0]||(s[0]=t("div",{class:"whitespace-nowrap text-gray-300"},'$env:GEMINI_API_KEY = "你的API密钥"',-1)),s[1]||(s[1]=t("div",{class:"whitespace-nowrap text-gray-300"},' $env:GEMINI_MODEL = "gemini-2.5-pro" ',-1))]),s[4]||(s[4]=t("p",{class:"mt-2 text-xs text-yellow-700 dark:text-yellow-400"}," 💡 使用与 Claude Code 相同的 API 密钥即可。 ",-1))]),t("div",Ft,[s[8]||(s[8]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," PowerShell 永久设置(用户级) ",-1)),s[9]||(s[9]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"}," 在 PowerShell 中运行以下命令: ",-1)),t("div",Yt,[s[5]||(s[5]=t("div",{class:"mb-2"},"# 设置用户级环境变量(永久生效)",-1)),t("div",zt,' [System.Environment]::SetEnvironmentVariable("GOOGLE_GEMINI_BASE_URL", "'+d(c(i))+'", [System.EnvironmentVariableTarget]::User) ',1),s[6]||(s[6]=t("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "你的API密钥", [System.EnvironmentVariableTarget]::User) ',-1)),s[7]||(s[7]=t("div",{class:"whitespace-nowrap text-gray-300"},' [System.Environment]::SetEnvironmentVariable("GEMINI_MODEL", "gemini-2.5-pro", [System.EnvironmentVariableTarget]::User) ',-1))]),s[10]||(s[10]=t("p",{class:"mt-2 text-xs text-blue-700 dark:text-blue-300"}," 💡 设置后需要重新打开 PowerShell 窗口才能生效。 ",-1))])],64)):(o(),a(x,{key:1},[t("div",Jt,[s[13]||(s[13]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 临时设置(当前会话) ",-1)),s[14]||(s[14]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},"在终端中运行以下命令:",-1)),t("div",Qt,[t("div",Xt,' export GOOGLE_GEMINI_BASE_URL="'+d(c(i))+'" ',1),s[11]||(s[11]=t("div",{class:"whitespace-nowrap text-gray-300"},'export GEMINI_API_KEY="你的API密钥"',-1)),s[12]||(s[12]=t("div",{class:"whitespace-nowrap text-gray-300"},' export GEMINI_MODEL="gemini-2.5-pro" ',-1))]),s[15]||(s[15]=t("p",{class:"mt-2 text-xs text-yellow-700 dark:text-yellow-400"}," 💡 使用与 Claude Code 相同的 API 密钥即可。 ",-1))]),t("div",Zt,[s[18]||(s[18]=t("h6",{class:"mb-2 text-sm font-medium text-gray-800 dark:text-gray-300 sm:text-base"}," 永久设置(Shell 配置文件) ",-1)),t("p",te," 将以下内容添加到你的 shell 配置文件中("+d(r.platform==="macos"?"~/.zshrc":"~/.bashrc")+"): ",1),t("div",ee,[t("div",se,' export GOOGLE_GEMINI_BASE_URL="'+d(c(i))+'" ',1),s[16]||(s[16]=t("div",{class:"whitespace-nowrap text-gray-300"},'export GEMINI_API_KEY="你的API密钥"',-1)),s[17]||(s[17]=t("div",{class:"whitespace-nowrap text-gray-300"},' export GEMINI_MODEL="gemini-2.5-pro" ',-1))]),s[19]||(s[19]=t("p",{class:"mb-3 text-sm text-gray-600 dark:text-gray-400"},"然后执行:",-1)),t("div",re,[t("div",oe," source "+d(r.platform==="macos"?"~/.zshrc":"~/.bashrc"),1)])])],64)),t("div",ae,[s[26]||(s[26]=t("h6",{class:"mb-2 font-medium text-green-800 dark:text-green-300"}," 验证 Gemini CLI 环境变量 ",-1)),t("p",de,d(r.platform==="windows"?"在 PowerShell 中验证:":"在终端中验证:"),1),t("div",le,[r.platform==="windows"?(o(),a(x,{key:0},[s[20]||(s[20]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $env:GOOGLE_GEMINI_BASE_URL",-1)),s[21]||(s[21]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $env:GEMINI_API_KEY",-1)),s[22]||(s[22]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $env:GEMINI_MODEL",-1))],64)):(o(),a(x,{key:1},[s[23]||(s[23]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $GOOGLE_GEMINI_BASE_URL",-1)),s[24]||(s[24]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $GEMINI_API_KEY",-1)),s[25]||(s[25]=t("div",{class:"whitespace-nowrap text-gray-300"},"echo $GEMINI_MODEL",-1))],64))])])])])]))}},me={class:"tutorial-section"},ie={class:"mb-4 sm:mb-10 sm:mb-6"},xe={class:"space-y-4"},ge={class:"rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-500/40 dark:bg-yellow-950/30 sm:p-4"},be={class:"mb-3 text-sm text-yellow-700 dark:text-yellow-300"},pe={class:"rounded bg-yellow-100 px-1 dark:bg-yellow-900"},ue={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},ye={class:"mt-2 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},ve={class:"whitespace-nowrap text-gray-300"},ce={class:"rounded-lg border border-orange-200 bg-orange-50 p-3 dark:border-orange-500/40 dark:bg-orange-950/30 sm:p-4"},we={class:"mb-3 text-sm text-orange-700 dark:text-orange-300"},fe={class:"rounded bg-orange-100 px-1 dark:bg-orange-900"},ke={class:"mt-2 overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},he={class:"whitespace-nowrap text-gray-300"},Ie={__name:"CodexTutorial",props:{platform:{type:String,required:!0,validator:r=>["windows","macos","linux"].includes(r)}},setup(r){const i=r,{openaiBaseUrl:l}=I(),s=p(()=>i.platform==="windows"?"%USERPROFILE%\\.codex\\config.toml":"~/.codex/config.toml"),v=p(()=>i.platform==="windows"?"%USERPROFILE%\\.codex\\auth.json":"~/.codex/auth.json"),e=p(()=>['model_provider = "crs"','model = "gpt-5-codex"','model_reasoning_effort = "high"',"disable_response_storage = true",'preferred_auth_method = "apikey"',"","[model_providers.crs]",'name = "crs"',`base_url = "${l.value}"`,'wire_api = "responses"',"requires_openai_auth = true"]),u=p(()=>e.value.join(`
|
||
`)),b=p(()=>i.platform==="windows"?`New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\\.codex" | Out-Null; "${u.value.replace(/"/g,'`"').replace(/\n/g,"`n")}" | Set-Content -Path "$env:USERPROFILE\\.codex\\config.toml" -Force`:`mkdir -p ~/.codex && printf '${u.value.replace(/\n/g,"\\n")}\\n' > ~/.codex/config.toml`),y=p(()=>i.platform==="windows"?`New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\\.codex" | Out-Null; '{"OPENAI_API_KEY": null}' | Set-Content -Path "$env:USERPROFILE\\.codex\\auth.json" -Force`:`mkdir -p ~/.codex && echo '{"OPENAI_API_KEY": null}' > ~/.codex/auth.json`);return(g,m)=>(o(),a("div",me,[f(C,{platform:r.platform,"step-number":1,"tool-name":"Codex"},null,8,["platform"]),t("div",ie,[m[9]||(m[9]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-indigo-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"2"),n(" 配置 Codex ")],-1)),m[10]||(m[10]=t("p",{class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"}," 配置 Codex 以连接到中转服务: ",-1)),t("div",xe,[t("div",ge,[m[2]||(m[2]=t("h6",{class:"mb-2 font-medium text-yellow-800 dark:text-yellow-300"}," 1. 配置文件 config.toml ",-1)),t("p",be,[m[0]||(m[0]=n(" 在 ",-1)),t("code",pe,d(s.value),1),m[1]||(m[1]=n(" 文件开头添加以下配置: ",-1))]),t("div",ue,[(o(!0),a(x,null,h(e.value,S=>(o(),a("div",{key:S,class:k(["whitespace-nowrap text-gray-300",{"mt-2":S===""}])},d(S||" "),3))),128))]),m[3]||(m[3]=t("p",{class:"mt-3 text-sm text-yellow-600 dark:text-yellow-400"},"一键写入命令:",-1)),t("div",ye,[t("div",ve,d(b.value),1)])]),t("div",ce,[m[6]||(m[6]=t("h6",{class:"mb-2 font-medium text-orange-800 dark:text-orange-300"}," 2. 认证文件 auth.json ",-1)),t("p",we,[m[4]||(m[4]=n(" 在 ",-1)),t("code",fe,d(v.value),1),m[5]||(m[5]=n(" 文件中配置: ",-1))]),m[7]||(m[7]=w('<div class="overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"><div class="whitespace-nowrap text-gray-300">{</div><div class="whitespace-nowrap text-gray-300"> "OPENAI_API_KEY": "后台创建的API密钥" </div><div class="whitespace-nowrap text-gray-300">}</div></div><div class="mt-3 rounded border border-red-200 bg-red-50 p-2 dark:border-red-500/40 dark:bg-red-950/30"></div><p class="mt-3 text-sm text-orange-600 dark:text-orange-400">一键写入命令:</p>',3)),t("div",ke,[t("div",he,d(y.value),1)])]),m[8]||(m[8]=t("div",{class:"rounded-lg border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-500/40 dark:bg-yellow-950/30 sm:p-4"},[t("p",{class:"text-sm text-yellow-700 dark:text-yellow-300"},[n(" 💡 请将示例中的 "),t("code",{class:"rounded bg-yellow-100 px-1 dark:bg-yellow-900"},"cr_xxxxxxxxxx"),n(" 替换为您的实际 API 密钥 ")])],-1))])])]))}},Ce={class:"tutorial-section"},Se={class:"mb-4 sm:mb-10 sm:mb-6"},Ee={class:"mb-3 text-sm text-gray-700 dark:text-gray-300 sm:mb-4 sm:text-base"},$e={class:"rounded-lg border border-blue-200 bg-blue-50 p-3 dark:border-blue-500/40 dark:bg-blue-950/30 sm:p-4"},Pe={class:"overflow-x-auto rounded bg-gray-900 p-2 font-mono text-xs text-green-400 sm:p-3 sm:text-sm"},Ae={__name:"DroidCliTutorial",props:{platform:{type:String,required:!0,validator:r=>["windows","macos","linux"].includes(r)}},setup(r){const{droidClaudeBaseUrl:i,droidOpenaiBaseUrl:l}=I(),s=p(()=>["{",' "custom_models": ['," {",' "model_display_name": "Sonnet 4.5 [crs]",',' "model": "claude-sonnet-4-5-20250929",',` "base_url": "${i.value}",`,' "api_key": "你的API密钥",',' "provider": "anthropic",',' "max_tokens": 8192'," },"," {",' "model_display_name": "GPT5-Codex [crs]",',' "model": "gpt-5-codex",',` "base_url": "${l.value}",`,' "api_key": "你的API密钥",',' "provider": "openai",',' "max_tokens": 16384'," }"," ]","}"]);return(v,e)=>(o(),a("div",Ce,[f(C,{platform:r.platform,"step-number":1,"tool-name":"Droid CLI"},null,8,["platform"]),t("div",Se,[e[12]||(e[12]=t("h4",{class:"mb-3 flex items-center text-lg font-semibold text-gray-800 dark:text-gray-300 sm:mb-4 sm:text-xl"},[t("span",{class:"mr-2 flex h-6 w-6 items-center justify-center rounded-full bg-blue-500 text-xs font-bold text-white sm:mr-3 sm:h-8 sm:w-8 sm:text-sm"},"2"),n(" 配置 Droid CLI ")],-1)),t("p",Ee,[e[6]||(e[6]=n(" Droid CLI 使用 ",-1)),e[7]||(e[7]=t("code",{class:"rounded bg-gray-100 px-1 dark:bg-gray-800"},"~/.factory/config.json",-1)),e[8]||(e[8]=n(" 保存自定义模型; ",-1)),r.platform==="windows"?(o(),a(x,{key:0},[e[0]||(e[0]=n(" 在 Windows 中可直接编辑 ",-1)),e[1]||(e[1]=t("code",{class:"rounded bg-gray-100 px-1 dark:bg-gray-800"},"C:\\Users\\你的用户名\\.factory\\config.json",-1)),e[2]||(e[2]=n("。 ",-1))],64)):(o(),a(x,{key:1},[e[3]||(e[3]=n(" 在终端中可使用 ",-1)),e[4]||(e[4]=t("code",{class:"rounded bg-gray-100 px-1 dark:bg-gray-800"},"vim ~/.factory/config.json",-1)),e[5]||(e[5]=n(" 编辑。 ",-1))],64))]),t("div",$e,[e[9]||(e[9]=t("h6",{class:"mb-2 text-sm font-medium text-blue-800 dark:text-blue-200 sm:text-base"}," 配置文件示例 ",-1)),e[10]||(e[10]=t("p",{class:"mb-3 text-sm text-blue-700 dark:text-blue-200"}," 将以下内容追加到配置文件中,并替换示例中的域名和 API 密钥: ",-1)),t("div",Pe,[(o(!0),a(x,null,h(s.value,(u,b)=>(o(),a("div",{key:u+b,class:"whitespace-pre text-gray-300"},d(u),1))),128))]),e[11]||(e[11]=t("p",{class:"mt-3 text-xs text-blue-700 dark:text-blue-200 sm:text-sm"}," 💡 在 Droid CLI 中选择自定义模型即可使用新的 Droid 账号池;确保服务地址可被本地访问。 ",-1))])])]))}},Le={class:"card p-3 sm:p-6"},Ne={class:"mb-4 sm:mb-8"},Te={class:"mb-3 flex items-center text-xl font-bold text-gray-900 dark:text-gray-100 sm:mb-4 sm:text-2xl"},Oe={class:"text-sm text-gray-600 dark:text-gray-400 sm:text-lg"},_e={class:"mb-4 sm:mb-6"},Ue={class:"flex flex-wrap gap-1 rounded-xl bg-gray-100 p-1 dark:bg-gray-800 sm:gap-2 sm:p-2"},Re=["onClick"],je={class:"mb-4 sm:mb-8"},Ge={class:"flex flex-wrap gap-1 rounded-xl bg-gray-100 p-1 dark:bg-gray-800 sm:gap-2 sm:p-2"},Me=["onClick"],Be={__name:"TutorialView",setup(r){const i=P("windows"),l=P("claude-code"),s=[{key:"windows",name:"Windows",icon:"fab fa-windows"},{key:"macos",name:"macOS",icon:"fab fa-apple"},{key:"linux",name:"Linux / WSL2",icon:"fab fa-linux"}],v=[{key:"claude-code",name:"Claude Code",icon:"fas fa-robot",component:Bt},{key:"codex",name:"Codex",icon:"fas fa-code",component:Ie},{key:"gemini-cli",name:"Gemini CLI",icon:"fab fa-google",component:ne},{key:"droid-cli",name:"Droid CLI",icon:"fas fa-terminal",component:Ae}],e=p(()=>{const b=v.find(y=>y.key===l.value);return b?b.name:"CLI 工具"}),u=p(()=>{const b=v.find(y=>y.key===l.value);return b?b.component:null});return(b,y)=>(o(),a("div",Le,[t("div",Ne,[t("h3",Te,[y[0]||(y[0]=t("i",{class:"fas fa-graduation-cap mr-2 text-blue-600 sm:mr-3"},null,-1)),n(" "+d(e.value)+" 使用教程 ",1)]),t("p",Oe," 跟着这个教程,你可以轻松在自己的电脑上安装并使用 "+d(e.value)+"。 ",1)]),t("div",_e,[t("div",Ue,[(o(),a(x,null,h(s,g=>t("button",{key:g.key,class:k(["flex flex-1 items-center justify-center gap-1 rounded-lg px-3 py-2 text-xs font-semibold transition-all duration-300 sm:gap-2 sm:px-6 sm:py-3 sm:text-sm",i.value===g.key?"bg-white text-blue-600 shadow-sm dark:bg-blue-600 dark:text-white dark:shadow-blue-500/40":"text-gray-600 hover:bg-white/50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white"]),onClick:m=>i.value=g.key},[t("i",{class:k(g.icon)},null,2),n(" "+d(g.name),1)],10,Re)),64))])]),t("div",je,[t("div",Ge,[(o(),a(x,null,h(v,g=>t("button",{key:g.key,class:k(["flex flex-1 items-center justify-center gap-1 rounded-lg px-3 py-2 text-xs font-semibold transition-all duration-300 sm:gap-2 sm:px-4 sm:py-3 sm:text-sm",l.value===g.key?"bg-white text-blue-600 shadow-sm dark:bg-blue-600 dark:text-white dark:shadow-blue-500/40":"text-gray-600 hover:bg-white/50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white"]),onClick:m=>l.value=g.key},[t("i",{class:k(g.icon)},null,2),n(" "+d(g.name),1)],10,Me)),64))])]),(o(),A(L(u.value),{platform:i.value},null,8,["platform"]))]))}},Ve=N(Be,[["__scopeId","data-v-c8fcc5f9"]]);export{Ve as T};
|