import axios from './config' // export const SERVER_URL = 'http://localhost:5000' export const SERVER_URL = (import.meta.env.MODE === 'development') ? '/api' : 'https://server.pptist.cn' export const ASSET_URL = 'https://asset.pptist.cn' export default { getMockData(filename: string): Promise { return axios.get(`./mocks/${filename}.json`) }, getFileData(filename: string): Promise { return axios.get(`${ASSET_URL}/data/${filename}.json`) }, AIPPT_Outline( content: string, language: string, model: string, ): Promise { return fetch(`${SERVER_URL}/tools/aippt_outline`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ content, language, model, stream: true, }), }) }, AIPPT( content: string, language: string, model: string, ): Promise { return fetch(`${SERVER_URL}/tools/aippt`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ content, language, model, stream: true, }), }) }, }