@@ -4,15 +4,15 @@ import { useState, useEffect, useCallback } from 'react';
44/**
55 * OAuth 设备授权流动画
66 *
7- * 可视化 inniesOAuth2 .ts 设备授权流程
8- * 源码: packages/core/src/innies/inniesOAuth2 .ts
7+ * 可视化 qwenOAuth2 .ts 设备授权流程
8+ * 源码: packages/core/src/qwen/qwenOAuth2 .ts
99 *
1010 * 核心流程:
1111 * 1. requestDeviceAuthorization() - 获取 deviceCode
1212 * 2. 打开浏览器验证页面
1313 * 3. pollDeviceToken() - 轮询等待用户授权
1414 * 4. 获取 access_token + refresh_token
15- * 5. cacheInniesCredentials () - 缓存凭证
15+ * 5. cacheQwenCredentials () - 缓存凭证
1616 */
1717
1818type AuthPhase =
@@ -76,7 +76,7 @@ export default function OAuthDeviceFlowAnimation() {
7676
7777 switch ( phase ) {
7878 case 'idle' :
79- addLog ( '🔐 getInniesOAuthClient () 开始' ) ;
79+ addLog ( '🔐 getQwenOAuthClient () 开始' ) ;
8080 setPhase ( 'requesting_device_code' ) ;
8181 break ;
8282
@@ -147,7 +147,7 @@ export default function OAuthDeviceFlowAnimation() {
147147
148148 case 'success' :
149149 addLog ( '✅ 认证成功!' ) ;
150- addLog ( '💾 cacheInniesCredentials ()' ) ;
150+ addLog ( '💾 cacheQwenCredentials ()' ) ;
151151 timer = setTimeout ( ( ) => {
152152 addLog ( '🔒 凭证已安全存储' ) ;
153153 setIsPlaying ( false ) ;
@@ -193,7 +193,7 @@ export default function OAuthDeviceFlowAnimation() {
193193 OAuth 设备授权流
194194 </ h1 >
195195 < p className = "text-[var(--muted)] text-sm mt-1" >
196- inniesOAuth2 - Device Code Grant Flow (RFC 8628)
196+ qwenOAuth2 - Device Code Grant Flow (RFC 8628)
197197 </ p >
198198 </ div >
199199 < div className = "flex items-center gap-4" >
@@ -367,7 +367,7 @@ export default function OAuthDeviceFlowAnimation() {
367367 < div className = "col-span-5" >
368368 < div className = "bg-[var(--bg-secondary)] rounded-lg p-4 border border-[var(--border)] h-full" >
369369 < h3 className = "text-sm font-semibold text-[var(--amber)] mb-4 font-mono" >
370- InniesCredentials
370+ QwenCredentials
371371 </ h3 >
372372
373373 < div className = "space-y-4" >
@@ -462,10 +462,10 @@ export default function OAuthDeviceFlowAnimation() {
462462 { /* 源码说明 */ }
463463 < div className = "bg-[var(--bg-secondary)] rounded-lg p-4 border border-[var(--border)]" >
464464 < h3 className = "text-sm font-semibold text-[var(--text-primary)] mb-3" >
465- 源码: inniesOAuth2 .ts
465+ 源码: qwenOAuth2 .ts
466466 </ h3 >
467467 < pre className = "text-xs font-mono text-[var(--text-secondary)] bg-black/30 p-3 rounded overflow-x-auto" >
468- { `async function authWithInniesDeviceFlow (client, config): Promise<AuthResult> {
468+ { `async function authWithQwenDeviceFlow (client, config): Promise<AuthResult> {
469469 // 1. 请求设备授权码
470470 const deviceAuth = await client.requestDeviceAuthorization();
471471 const verificationUrl = \`\${BASE_URL}/login?device_code=\${deviceAuth.deviceCode}\`;
@@ -490,7 +490,7 @@ export default function OAuthDeviceFlowAnimation() {
490490 expiry_date: Date.now() + tokenResponse.expiresIn * 1000,
491491 };
492492 client.setCredentials(credentials);
493- await cacheInniesCredentials (credentials);
493+ await cacheQwenCredentials (credentials);
494494 return { success: true };
495495 }
496496
0 commit comments