mirror of
https://github.com/jackhh66/ChatGPT_Web_accessToken.git
synced 2026-12-03 21:09:32 +00:00
feat: 前后端统一接口类型
This commit is contained in:
1 parent
dd522eb404
commit
847623e22a
12 files changed
+167
-78
No files matched your search
@@ -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