feat(chat): 支持二维码批量导入与 OCR 识别,新增欢迎语配置页

This commit is contained in:
yml2213
2026-10-30 17:35:35 +08:00
parent de71e2a74a
commit f4fe2006db
5 changed files with 361 additions and 2 deletions
+41
View File
@@ -2026,3 +2026,44 @@ export async function updateCrashConfig(payload: Partial<AdminCrashConfig>) {
)
return data.data
}
export async function fetchChatAutoWelcome() {
const { data } = await adminClient.get<ApiResponse<{ message: string }>>(
'/admin/chats/auto-welcome'
)
return data.data.message ?? ''
}
export async function updateChatAutoWelcome(message: string) {
const { data } = await adminClient.put<ApiResponse<{ message: string }>>(
'/admin/chats/auto-welcome',
{ message }
)
return data.data
}
export async function fetchListingGroupWelcome() {
const { data } = await adminClient.get<ApiResponse<{ message: string }>>(
'/admin/chats/listing-group-welcome'
)
return data.data.message ?? ''
}
export async function updateListingGroupWelcome(message: string) {
const { data } = await adminClient.put<ApiResponse<{ message: string }>>(
'/admin/chats/listing-group-welcome',
{ message }
)
return data.data
}
export async function recognizeQrCodeGroupName(file: File) {
const form = new FormData()
form.append('file', file)
const { data } = await adminClient.post<{ data: { group_name?: string; text?: string } }>(
'/admin/chats/qrcodes/ocr-group-name',
form,
{ headers: { 'Content-Type': 'multipart/form-data' } }
)
return data.data
}