You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

70 lines
2.0 KiB

import request from '../utils/request'
const APIurl = import.meta.env.VITE_APP_API_BASE_URL
//各个模块权限code接口
export const pessionAPI = function (params) {
return request({
url: `${APIurl}/api/brain/privilege`,
method: 'post',
data: new URLSearchParams(params),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
//数据接口
export const dataListAPI = function (params) {
// URLSearchParams只接受全部字符串的数据
// 将传入数据转化成字符串
const StringParams = new URLSearchParams(
Object.entries(params).map(([key, value]) => [key, String(value)])
)
return request({
url: `${APIurl}/api/brain/data`,
method: 'post',
data: StringParams,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
//统计用户行为接口
export const computedUsersAPI = function (params) {
return request({
url: `${APIurl}/BrainStatistics/getStatistic`,
method: 'post',
data: new URLSearchParams(params),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
// 获取回复接口
export const getReplyAPI = function (params) {
return request({
url: `https://api.coze.cn/v1/workflow/stream_run`,
method: 'post',
data: JSON.stringify(params),
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer pat_TJbuxUiZdl6U3oiiSeceQnHg5XdaZsWpxc6oIozc2Auhd9YuyBvFslJJQUFUym1F'
}
})
}
export const getReplyStreamAPI = function (params) {
return fetch(`https://api.coze.cn/v1/workflow/stream_run`,
{
method: 'POST',
body: JSON.stringify(params),
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer pat_TJbuxUiZdl6U3oiiSeceQnHg5XdaZsWpxc6oIozc2Auhd9YuyBvFslJJQUFUym1F'
}
}
)
}