test publish
Some checks failed
Deploy / deploy (push) Has been cancelled
Deploy / publish-web (push) Successful in 1m43s
Deploy / publish-tauri (push) Has been cancelled

This commit is contained in:
2025-12-22 19:23:06 +06:00
parent e3d0106d8f
commit 76f0ec74b5
27 changed files with 2123 additions and 1344 deletions

View File

@@ -1,8 +1,9 @@
import { ToastEventBus } from 'primevue'
const instance = $fetch.create({
baseURL: process.env.API_BASE_URL || 'https://api.koptilnya.xyz/chad',
baseURL: __API_BASE_URL__,
credentials: 'include',
retry: false,
onResponseError({ response }) {
if (!import.meta.client)
return
@@ -13,4 +14,48 @@ const instance = $fetch.create({
},
})
// function instance(url: string, request: Request) {
// console.log(url)
// return fetch({
// url: `https://api.koptilnya.xyz${url}`,
// credentials: 'include',
// method: 'GET',
// headers: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json',
// ...request.headers,
// },
// ...request,
// body: request.body ? JSON.stringify(request.body) : undefined,
// })
// }
// async function instance(url: string, options: Partial<Request> = {}) {
// const response = await fetch(`https://api.koptilnya.xyz/chad${url}`, {
// method: options.method || 'GET',
// headers: {
// 'Content-Type': 'application/json',
// ...(options.headers || {}),
// },
// body: JSON.stringify(options.body ?? {}),
// responseType: 2,
// credentials: 'include',
// })
//
// const data = await response.json()
//
// if (response.status >= 400) {
// if (!import.meta.client)
// return
//
// const message = data?.error || 'Something went wrong'
//
// ToastEventBus.emit('add', { severity: 'error', summary: 'Error', detail: message, closable: false, life: 3000 })
//
// throw new Error(`HTTP ${response.status}: ${data?.message || 'Ошибка'}`)
// }
//
// return data
// }
export default instance