mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-08-01 19:38:16 +00:00
feat: 前后端统一接口类型
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
interface SendResponseOptions {
|
||||
type: 'success' | 'fail'
|
||||
type: 'Success' | 'Fail'
|
||||
message?: string
|
||||
data?: any
|
||||
}
|
||||
|
||||
export function sendResponse(options: SendResponseOptions) {
|
||||
if (options.type === 'success') {
|
||||
if (options.type === 'Success') {
|
||||
return Promise.resolve({
|
||||
message: options.message ?? 'Success',
|
||||
message: options.message ?? null,
|
||||
data: options.data ?? null,
|
||||
status: options.type,
|
||||
})
|
||||
|
Reference in New Issue
Block a user