mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-08-02 20:18:01 +00:00
perf: 优化部份判断
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
interface SendResponseOptions {
|
||||
interface SendResponseOptions<T = any> {
|
||||
type: 'Success' | 'Fail'
|
||||
message?: string
|
||||
data?: any
|
||||
data?: T
|
||||
}
|
||||
|
||||
export function sendResponse(options: SendResponseOptions) {
|
||||
export function sendResponse<T>(options: SendResponseOptions<T>) {
|
||||
if (options.type === 'Success') {
|
||||
return Promise.resolve({
|
||||
message: options.message ?? null,
|
||||
|
Reference in New Issue
Block a user