Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"spark-md5": "^3.0.2",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"uuid": "^11.1.0",
"vaul-vue": "^0.2.0",
"vditor": "^3.10.7",
"vee-validate": "^4.14.6",
Expand Down
4 changes: 2 additions & 2 deletions src/api/message-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export const get_messages_list = (params: any) => {
if (params.types && (typeof params.types === 'string' || typeof params.types === 'number')) {
searchParams.append('types', params.types)
}

return customFetch(`/bizyair/community/notifications?${searchParams.toString()}`, {
method: 'GET'
})
}

export const get_message_unread_count = () =>
customFetch(`/bizyair/community/notifications/unread_count`, {
method: 'GET'
method: 'GET',
shieldError: true
})

export const read_message = (id: number) =>
Expand Down
8 changes: 4 additions & 4 deletions src/components/assistant/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@

const promptId = ref('')
const requestId = ref('')

// 生成新的会话ID
const generateNewPromptId = () => {
promptId.value = uuidv4()
localStorage.setItem('bizyair-prompt-id', promptId.value)
}

// 生成新的请求ID
const generateNewRequestId = () => {
requestId.value = uuidv4()
Expand Down Expand Up @@ -365,7 +365,7 @@
const sendMessage = async () => {
if (!canSendMessage.value || isLoading.value) return
generateNewRequestId()

const messageText = userInput.value
const currentTime = getCurrentTime()
const hasImage = !!previewImage.value
Expand Down Expand Up @@ -781,7 +781,7 @@
sidebarWidth.value = width
}
}

const savedPromptId = localStorage.getItem('bizyair-prompt-id')
if (savedPromptId) {
promptId.value = savedPromptId
Expand Down
12 changes: 11 additions & 1 deletion src/utils/customFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@ export function customFetch(url: string, options = {}, needDebounce = true, need
}
fetchCache.set(message, now)

useToaster.error(message)
// 检查options中是否有shieldError字段,如果有,记录URL以确保同一URL的错误只提示一次
const hasShieldError = options && (options as any).shieldError
const errorCacheKey = `error_${url}`
if (hasShieldError) {
if (!fetchCache.has(errorCacheKey)) {
fetchCache.set(errorCacheKey, true)
useToaster.error(message)
}
} else {
useToaster.error(message)
}

throw new Error(message)
} else {
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.5
1.2.6
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default defineConfig({
}
},
build: {
// outDir: 'dist',
outDir: '../js',
outDir: 'dist',
// outDir: '../js',
cssCodeSplit: false,
lib: {
entry: 'src/main.ts',
Expand Down
Loading