feat(chat): 支持二维码批量导入与 OCR 识别,新增欢迎语配置页
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user