mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-12 16:18:45 +08:00
Refactor the backend
This commit is contained in:
@@ -12,10 +12,10 @@ export class ApiResponse<T> {
|
||||
}
|
||||
|
||||
static success<T>(data?: T, message = "操作成功"): ApiResponse<T> {
|
||||
return new ApiResponse(true, 200, data, message);
|
||||
return new ApiResponse(true, 0, data, message);
|
||||
}
|
||||
|
||||
static error(message: string, code = 500): ApiResponse<null> {
|
||||
static error(message: string, code = 10000): ApiResponse<null> {
|
||||
return new ApiResponse(false, code, null, message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user