Skip to content

Commit fe0bfc7

Browse files
committed
fix多余注释
1 parent d449173 commit fe0bfc7

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

src/components/assistant/Sidebar.vue

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
</button>
2424
</div>
2525
</div>
26-
<!-- 聊天标签页内容 -->
2726
<div class="chat-container" >
2827
<div class="chat-messages" ref="chatMessagesRef">
2928
<div
@@ -121,14 +120,7 @@
121120
/>
122121
</svg>
123122
</button>
124-
<!-- <button
125-
class="upload-image-btn interactive-element"
126-
@click="generateImageAction"
127-
:disabled="isLoading"
128-
:title="$t('sidebar.assistant.generateImage')"
129-
>
130-
生图
131-
</button> -->
123+
132124
<div class="textarea-container interactive-element">
133125
<textarea
134126
class="interactive-element"
@@ -195,7 +187,6 @@
195187
const { t } = useI18n()
196188
const sidebarStore = useSidebarStore()
197189
198-
// 拖拽调整大小---------------------------------------'
199190
// 侧边栏宽度相关变量
200191
const sidebarWidth = ref(550) // 默认宽度
201192
const minWidth = 50 // 最小宽度
@@ -336,7 +327,6 @@
336327
time: getCurrentTime()
337328
}
338329
339-
// 延迟更新UI显示,确保所有正在进行的操作已停止
340330
setTimeout(() => {
341331
chatMessages.value = [welcomeMessage]
342332
console.log('历史记录已清空,并添加了欢迎消息')
@@ -394,13 +384,8 @@
394384
}, 0)
395385
396386
try {
397-
// 判断是否是图片编辑请求(带图片的普通消息)
398-
console.log('hasImage:', hasImage);
399-
console.log('isImageGeneration:', isImageGeneration);
400387
if (hasImage && !isImageGeneration) {
401-
processingStatus.value = '正在编辑图片...'
402-
console.log('调用到这边了');
403-
388+
processingStatus.value = '正在编辑图片...'
404389
try {
405390
// 调用图片编辑API
406391
const imageUrl = await handleImageWithKontextPro(messageText || '请编辑这张图片', previewImage.value)

src/components/assistant/util.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export function buildChatRequestBody(
7373
const mergedOptions = { ...defaultApiOptions, ...options }
7474
return {
7575
model: mergedOptions.model,
76-
// 不默认设置stream,让调用者自己决定是否流式
7776
max_tokens: mergedOptions.max_tokens,
7877
temperature: mergedOptions.temperature,
7978
top_p: mergedOptions.top_p,
@@ -264,9 +263,6 @@ export async function sendStreamChatRequest(
264263
'Content-Type': 'application/json',
265264
Authorization: Cookies.get('bizy_token') || '',
266265
...(options as any)?.headers
267-
'Content-Type': 'application/json',
268-
Authorization: Cookies.get('bizy_token') || '',
269-
...(options as any)?.headers
270266
},
271267
body: JSON.stringify(requestBody),
272268
signal: abortController.signal // 添加中止信号
@@ -512,11 +508,6 @@ export async function handleImageWithKontextPro(prompt: string, imageBase64: str
512508
});
513509
console.log(response,'请求结果');
514510

515-
// if (!response.ok) {
516-
// const errorText = await response.text();
517-
// console.error('API请求失败:', response.status, errorText);
518-
// throw new Error(`图像编辑API请求失败: ${response.status} ${response.statusText}`);
519-
// }
520511

521512
const responseData = await response.json();
522513
console.log('API响应数据:', responseData);

0 commit comments

Comments
 (0)