feat: 请求增加requestid

This commit is contained in:
rd
2025-08-28 14:58:58 +08:00
parent cdda8ffba7
commit 0c14a0caec
4 changed files with 42 additions and 28 deletions

View File

@ -3,6 +3,7 @@ import axios from 'axios';
import { glsWithCatch } from '@/utils/stroage';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
export const BASE_PYTHON_URL = 'https://agent.lvfunai.com';
import { genRandomId } from '@/utils/tools';
// 历史记录-列表
export const getAgentHistory = (id: string) => {
@ -32,10 +33,11 @@ export const getConversationList = (params: {}) => {
export const getHeaders = () => {
const store = useEnterpriseStore();
return {
'Authorization': glsWithCatch('accessToken'),
Authorization: glsWithCatch('accessToken'),
'enterprise-id': store.enterpriseInfo?.id,
'Accept': 'application/json',
Accept: 'application/json',
'Content-Type': 'application/json',
requestid: genRandomId(),
};
};
@ -57,4 +59,4 @@ export const createSession = async () => {
headers: getHeaders(),
});
return data;
};
};