feat: glm-z1-flash只能深度思考,隐藏深度思考按钮
This commit is contained in:
parent
bb44134e08
commit
ecff6edd61
|
|
@ -97,7 +97,9 @@
|
|||
<Minimize2 v-else :size="16" />
|
||||
</button>
|
||||
<!-- 深度思考开关 -->
|
||||
<!-- 如果模型不是glm-z1-flash,则显示深度思考开关 -->
|
||||
<button
|
||||
v-if="modelName !== 'glm-z1-flash'"
|
||||
class="toolbar-btn"
|
||||
:class="{ active: isDeepThinking, disabled: !supports_thinking }"
|
||||
:disabled="!supports_thinking"
|
||||
|
|
@ -131,7 +133,6 @@
|
|||
<Globe :size="16" />
|
||||
<span>联网搜索</span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -201,6 +202,7 @@ const emit = defineEmits<{
|
|||
// 响应式状态
|
||||
const authStore = useAuthStore();
|
||||
const settingsStore = useSettingsStore();
|
||||
const modelName = computed(() => settingsStore.settings.defaultModel);
|
||||
|
||||
const inputText = ref("");
|
||||
const attachments = ref<AttachmentWithProgress[]>([]);
|
||||
|
|
@ -224,7 +226,7 @@ const imageInputRef = ref<HTMLInputElement | null>(null);
|
|||
let lastToastTime = 0;
|
||||
const toastThrottleMs = 2000;
|
||||
|
||||
function showThrottledToast(message: string, type: 'error' = 'error') {
|
||||
function showThrottledToast(message: string, type: "error" = "error") {
|
||||
const now = Date.now();
|
||||
if (now - lastToastTime >= toastThrottleMs) {
|
||||
lastToastTime = now;
|
||||
|
|
@ -252,7 +254,7 @@ function autoResize() {
|
|||
textarea.style.height = "auto";
|
||||
const maxHeight = isExpanded.value ? 400 : 160;
|
||||
// 增加1px是为了避免滚动条出现
|
||||
textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight)+1}px`;
|
||||
textarea.style.height = `${Math.min(textarea.scrollHeight, maxHeight) + 1}px`;
|
||||
}
|
||||
|
||||
// 处理输入前事件,限制字数
|
||||
|
|
@ -263,7 +265,8 @@ function handleBeforeInput(event: InputEvent) {
|
|||
// 检查输入后是否会超过限制
|
||||
const currentLength = inputText.value.length;
|
||||
const insertLength = event.data?.length || 0;
|
||||
const selectionStart = (event.target as HTMLTextAreaElement).selectionStart || 0;
|
||||
const selectionStart =
|
||||
(event.target as HTMLTextAreaElement).selectionStart || 0;
|
||||
const selectionEnd = (event.target as HTMLTextAreaElement).selectionEnd || 0;
|
||||
const selectedLength = selectionEnd - selectionStart;
|
||||
|
||||
|
|
@ -321,7 +324,7 @@ async function handlePaste(event: ClipboardEvent) {
|
|||
if (!items) return;
|
||||
|
||||
// 检查粘贴文本是否会超过字数限制
|
||||
const text = event.clipboardData?.getData('text');
|
||||
const text = event.clipboardData?.getData("text");
|
||||
if (text) {
|
||||
const textarea = event.target as HTMLTextAreaElement;
|
||||
const selectionStart = textarea.selectionStart || 0;
|
||||
|
|
@ -388,7 +391,7 @@ async function addFileAsAttachment(
|
|||
) {
|
||||
// 检查认证状态
|
||||
if (!authStore.isAuthenticated) {
|
||||
window.$toast?.('请先登录', 'error');
|
||||
window.$toast?.("请先登录", "error");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -452,17 +455,17 @@ async function removeAttachment(id: string) {
|
|||
const attachment = attachments.value[index];
|
||||
|
||||
// 如果已上传到 OSS(不是本地 blob URL),则从 OSS 删除
|
||||
if (attachment.url && !attachment.url.startsWith('blob:')) {
|
||||
if (attachment.url && !attachment.url.startsWith("blob:")) {
|
||||
try {
|
||||
await chatApi.deleteAttachment(attachment.url);
|
||||
} catch (error) {
|
||||
console.error('删除 OSS 文件失败:', error);
|
||||
console.error("删除 OSS 文件失败:", error);
|
||||
// 即使删除失败也继续移除本地引用
|
||||
}
|
||||
}
|
||||
|
||||
// 释放 blob URL(如果是本地的)
|
||||
if (attachment.url.startsWith('blob:')) {
|
||||
if (attachment.url.startsWith("blob:")) {
|
||||
URL.revokeObjectURL(attachment.url);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue