feat(client): add qimingclaw digital adapter

This commit is contained in:
baiyanyun
2026-06-05 15:45:55 +08:00
parent 2eb9a99da3
commit 31b4b5a281
8 changed files with 865 additions and 117 deletions

View File

@@ -32,6 +32,7 @@ import type {
} from '../types/api';
import { clearToken, getToken, setToken } from './auth';
import { apiOrigin, apiBase } from './basePath';
import { handleQimingclawDigitalApi } from './qimingclawAdapter';
// ---------------------------------------------------------------------------
// Base fetch wrapper
@@ -55,6 +56,11 @@ export async function apiFetch<T = unknown>(
path: string,
options: ApiFetchOptions = {},
): Promise<T> {
const adapterData = await handleQimingclawDigitalApi<T>(path, options);
if (adapterData !== undefined) {
return adapterData;
}
const { timeoutMs = API_FETCH_TIMEOUT_MS, ...fetchOptions } = options;
const token = getToken();
const headers = new Headers(fetchOptions.headers);