完善充值功能,添加支付宝和微信的充值逻辑及二维码展示
This commit is contained in:
33
src/actions/user.ts
Normal file
33
src/actions/user.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
'use server'
|
||||
|
||||
import {callByUser} from '@/actions/base'
|
||||
|
||||
export async function RechargeByAlipay(props: {
|
||||
amount: number
|
||||
}) {
|
||||
return callByUser<{
|
||||
trade_no: string
|
||||
pay_url: string
|
||||
}>('/api/user/recharge/prepare/alipay', props)
|
||||
}
|
||||
|
||||
export async function RechargeByAlipayConfirm(props: {
|
||||
trade_no: string
|
||||
}) {
|
||||
return callByUser('/api/user/recharge/confirm/alipay', props)
|
||||
}
|
||||
|
||||
export async function RechargeByWechat(props: {
|
||||
amount: number
|
||||
}) {
|
||||
return callByUser<{
|
||||
trade_no: string
|
||||
pay_url: string
|
||||
}>('/api/user/recharge/prepare/wechat', props)
|
||||
}
|
||||
|
||||
export async function RechargeByWechatConfirm(props: {
|
||||
trade_no: string
|
||||
}) {
|
||||
return callByUser('/api/user/recharge/confirm/wechat', props)
|
||||
}
|
||||
Reference in New Issue
Block a user