- Add environment configs for dev/staging/prod environments - Implement centralized axios request utility with standardized error handling - Add shared TypeScript types for API responses and requests - Create comprehensive API client modules for all core endpoints - Configure vue router with all application page routes - Add icon fonts, static assets, and loading animations - Set up project documentation and collaboration guidelines - Remove deprecated uni-app bridge component files
30 lines
594 B
TypeScript
30 lines
594 B
TypeScript
export interface ApiResponse<T> {
|
|
code: number;
|
|
message?: string;
|
|
data: T;
|
|
}
|
|
|
|
export interface RequestOptions {
|
|
signal?: AbortSignal;
|
|
headers?: Record<string, string>;
|
|
skipAuth?: boolean;
|
|
}
|
|
|
|
export type RequestContext = {
|
|
token: string | null;
|
|
clientId: string | null;
|
|
latitude: number | null;
|
|
longitude: number | null;
|
|
language: string | null;
|
|
};
|
|
|
|
export type NormalizedErrorKind = "business" | "http" | "network" | "unknown";
|
|
|
|
export interface NormalizedError extends Error {
|
|
kind: NormalizedErrorKind;
|
|
code?: number;
|
|
httpStatus?: number;
|
|
response?: unknown;
|
|
}
|
|
|