Skip to content

Commit c73e0d6

Browse files
committed
Merge branch 'ls-dev' into 'master'
feat(auth): skip login for custom-model users & hide cloud-only buttons See merge request ai_native/DeepVCode/DeepVcodeClient!482
2 parents f725ecc + 4da75af commit c73e0d6

2 files changed

Lines changed: 31 additions & 18 deletions

File tree

packages/cli/src/ui/hooks/useAuthCommand.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export const useAuthCommand = (
4141
const checkAuthOnStartup = async () => {
4242
const authType = settings.merged.selectedAuthType;
4343

44+
// 🟢 已配置自定义模型(preferredModel 以 custom: 开头):
45+
// 视为“自定义模型专用模式”,跳过登录对话框,直接进入可聊天状态。
46+
// 自定义模型走本地配置,不依赖 DeepV 登录态。
47+
const usingCustomModel = settings.merged.preferredModel?.startsWith('custom:');
48+
4449
// 如果没有设置认证类型,直接标记检查完成
4550
if (!authType) {
4651
setStartupAuthCheckCompleted(true);
@@ -65,6 +70,8 @@ export const useAuthCommand = (
6570
if (!userInfo) {
6671
if (customProxyUrl) {
6772
console.log('[AuthCommand] Custom proxy URL configured, skipping auto-login dialog on startup');
73+
} else if (usingCustomModel) {
74+
console.log('[AuthCommand] Custom model configured, skipping auto-login dialog on startup');
6875
} else {
6976
console.log('[AuthCommand] auth expired at startup, opening auth dialog');
7077
openAuthDialog();
@@ -80,6 +87,8 @@ export const useAuthCommand = (
8087
} catch (error) {
8188
if (customProxyUrl) {
8289
console.log('[AuthCommand] Custom proxy URL configured, skipping auto-login dialog on startup');
90+
} else if (usingCustomModel) {
91+
console.log('[AuthCommand] Custom model configured, skipping auto-login dialog on startup');
8392
} else {
8493
console.log('[AuthCommand] auth expired at startup, opening auth dialog');
8594
openAuthDialog();

packages/vscode-ui-plugin/webview/src/components/MultiSessionApp.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,15 +2468,17 @@ User question: ${contentStr}`;
24682468
</div>
24692469

24702470
<div className="multi-session-app__header-right">
2471-
{/* 🎯 PPT 生成入口 */}
2472-
<button
2473-
className="multi-session-app__manage-btn multi-session-app__ppt-btn"
2474-
onClick={() => setIsPPTGeneratorOpen(true)}
2475-
title={t('pptGenerator.buttonTooltip', {}, 'Generate PPT with AI')}
2476-
style={{ marginRight: '8px' }}
2477-
>
2478-
<PPTGeneratorIcon size={18} />
2479-
</button>
2471+
{/* 🎯 PPT 生成入口 —— 自定义模型下隐藏(依赖 DeepV 云服务) */}
2472+
{!isCustomModelOnlyMode && !selectedModelId?.startsWith('custom:') && (
2473+
<button
2474+
className="multi-session-app__manage-btn multi-session-app__ppt-btn"
2475+
onClick={() => setIsPPTGeneratorOpen(true)}
2476+
title={t('pptGenerator.buttonTooltip', {}, 'Generate PPT with AI')}
2477+
style={{ marginRight: '8px' }}
2478+
>
2479+
<PPTGeneratorIcon size={18} />
2480+
</button>
2481+
)}
24802482
{/* 🎯 目标驱动模式入口 */}
24812483
<button
24822484
className="multi-session-app__manage-btn multi-session-app__goal-btn"
@@ -2486,15 +2488,17 @@ User question: ${contentStr}`;
24862488
>
24872489
<Target size={18} />
24882490
</button>
2489-
{/* 🎯 NanoBanana 图像生成入口 */}
2490-
<button
2491-
className="multi-session-app__manage-btn multi-session-app__nanobanana-btn"
2492-
onClick={() => setIsNanoBananaOpen(true)}
2493-
title={t('nanoBanana.buttonTooltip', {}, 'Generate images with AI')}
2494-
style={{ marginRight: '8px' }}
2495-
>
2496-
<NanoBananaIcon size={18} />
2497-
</button>
2491+
{/* 🎯 NanoBanana 图像生成入口 —— 自定义模型下隐藏(依赖 DeepV 云服务) */}
2492+
{!isCustomModelOnlyMode && !selectedModelId?.startsWith('custom:') && (
2493+
<button
2494+
className="multi-session-app__manage-btn multi-session-app__nanobanana-btn"
2495+
onClick={() => setIsNanoBananaOpen(true)}
2496+
title={t('nanoBanana.buttonTooltip', {}, 'Generate images with AI')}
2497+
style={{ marginRight: '8px' }}
2498+
>
2499+
<NanoBananaIcon size={18} />
2500+
</button>
2501+
)}
24982502
<button
24992503
className="multi-session-app__manage-btn multi-session-app__history-btn"
25002504
onClick={() => {

0 commit comments

Comments
 (0)