完善支付功能,添加支付宝的准备与创建逻辑

This commit is contained in:
2025-04-16 18:51:17 +08:00
parent d435d98887
commit 9a438491be
9 changed files with 258 additions and 86 deletions

View File

@@ -15,6 +15,7 @@ type ApiResponse<T = undefined> = {
data: T
}
type PageRecord<T = unknown> = {
total: number
page: number
@@ -22,6 +23,8 @@ type PageRecord<T = unknown> = {
list: T[]
}
type ExtractData<T extends (...args: never) => unknown> = Awaited<ReturnType<T>> extends ApiResponse<infer D> ? D : never
// 预定义错误
const UnauthorizedError = new Error('未授权访问')
@@ -31,5 +34,6 @@ export {
CLIENT_SECRET,
type ApiResponse,
type PageRecord,
type ExtractData,
UnauthorizedError,
}