mock create drawing

This commit is contained in:
XIE7654
2025-07-21 22:22:32 +08:00
parent 816668530c
commit 71d5053b9c
19 changed files with 504 additions and 43 deletions

View File

@@ -1,11 +1,14 @@
import { formatToken } from '#/utils/auth';
import { useAccessStore } from '@vben/stores';
import { formatToken } from '#/utils/auth';
export const API_BASE = '/api/ai/v1/';
export function fetchWithAuth(input: RequestInfo, init: RequestInit = {}) {
const accessStore = useAccessStore();
const token = accessStore.accessToken;
const headers = new Headers(init.headers || {});
headers.append('Content-Type', 'application/json');
headers.append('Authorization', formatToken(token) as string);
return fetch(input, { ...init, headers });
return fetch(API_BASE + input, { ...init, headers });
}