1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import request from "@/scripts/httpRequest"
 
export default {//添加对话记录
  createChat(data) {
    return request({
      url: '/api-v1/v1/chat/addDetail',
      method: 'post',
      data
    })
  },
  getDetail(params) {//获取对话详情
    return request({
      url: '/api-v1/v1/chat/detail',
      method: 'get',
      params
    })
  },
  // getChatDetail(data) {//对话检索
  //   return request({
  //     url: '/api-v1/v1/record/chat',
  //     method: 'post',
  //     data,
  //     headers: {
  //       "Content-Type": "application/json",
  //       "Accept":"text/event-stream",
  //       "Cache-Control": "no-cache"
  //     },
  //   })
  // },
  getChatDetail(data) {
    return fetch("/api-v1/v1/record/chat", { // 使用代理路径
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(data)
    }); // 直接返回 fetch 的 Promise
  }
}