feat: initial project setup with core infrastructure and api clients
- 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
This commit is contained in:
29
src/shared/request-types.ts
Normal file
29
src/shared/request-types.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user