mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-27 05:15:43 +08:00
18 lines
276 B
TypeScript
18 lines
276 B
TypeScript
export function useResponseSuccess<T = any>(data: T) {
|
|
return {
|
|
code: 0,
|
|
data,
|
|
error: null,
|
|
message: 'ok',
|
|
};
|
|
}
|
|
|
|
export function useResponseError(message: string, error: any = null) {
|
|
return {
|
|
code: -1,
|
|
data: null,
|
|
error,
|
|
message,
|
|
};
|
|
}
|