Template
feat: 模板适配层、易班能力与全局状态
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
3995656175
commit
d3ae0a8ca7
45 files changed
+6931
-179
No files matched your search
+2
-11
@@ -3,19 +3,10 @@
|
||||
* 可以根据项目需求使用 axios、fetch 或其他 HTTP 客户端
|
||||
*/
|
||||
|
||||
import type { ApiError, ApiResponse } from "./client.types";
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "/api";
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
data: T;
|
||||
message?: string;
|
||||
code?: number;
|
||||
}
|
||||
|
||||
export interface ApiError {
|
||||
message: string;
|
||||
code?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础请求函数
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
export interface ApiResponse<T> {
|
||||
data: T;
|
||||
message?: string;
|
||||
code?: number;
|
||||
}
|
||||
|
||||
export interface ApiError {
|
||||
message: string;
|
||||
code?: number;
|
||||
}
|
||||
+2
-9
@@ -1,9 +1,2 @@
|
||||
export {
|
||||
type ApiError,
|
||||
type ApiResponse,
|
||||
del,
|
||||
get,
|
||||
post,
|
||||
put,
|
||||
request,
|
||||
} from "./client.ts";
|
||||
export { del, get, post, put, request } from "./client.ts";
|
||||
export type { ApiError, ApiResponse } from "./client.types";
|
||||
Reference in new issue
Block a user