70 lines
1.4 KiB
TypeScript
70 lines
1.4 KiB
TypeScript
'use server'
|
|
import {callByUser, callPublic} from '@/actions/base'
|
|
|
|
export async function RechargeByAlipay(props: {
|
|
amount: string
|
|
}) {
|
|
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: string
|
|
}) {
|
|
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)
|
|
}
|
|
|
|
export async function Identify(props: {
|
|
type: number
|
|
name: string
|
|
iden_no: string
|
|
}) {
|
|
return await callByUser<{
|
|
identified: boolean
|
|
target: string
|
|
}>('/api/user/identify', props)
|
|
}
|
|
|
|
export async function IdentifyCallback(props: {
|
|
id: string
|
|
}) {
|
|
return await callPublic<{
|
|
success: boolean
|
|
message: string
|
|
}>('/api/user/identify/callback', props)
|
|
}
|
|
|
|
export async function update(props: {
|
|
username: string
|
|
email: string
|
|
contact_qq: string
|
|
contact_wechat: string
|
|
}) {
|
|
return await callByUser('/api/user/update', props)
|
|
}
|
|
|
|
export async function updatePassword(props: {
|
|
phone: string
|
|
code: string
|
|
password: string
|
|
}) {
|
|
return await callByUser('/api/user/update/password', props)
|
|
}
|