Files
copilot-toolbox-ts-tp/src/api/common.ts

29 lines
782 B
TypeScript

import { cacheGet } from '@/utils/cacheUtil'
export function getAgentBaseInfo(params: { id: string }) {
const Tenantid = cacheGet('tenantId')
const Token = cacheGet('token')
return fetch(`${import.meta.env.VITE_API_BASE_AI}/agent/baseInfo/info?id=${params.id}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Tenantid,
Token
}
}).then(res => res.json())
}
// 获取用户信息
export async function getUserInfoById() {
const Tenantid = cacheGet('tenantId')
const Token = cacheGet('token')
return fetch(`${import.meta.env['VITE_API_BASE_LAMP']}/oauth/anyone/getUserInfoById`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Tenantid,
Token
}
}).then(res => res.json())
}