重构鉴权逻辑,新增中间件刷新令牌,授权接口统一后处理无授权跳转

This commit is contained in:
2025-04-26 14:18:08 +08:00
parent 5c88cd7f32
commit 6db037204c
20 changed files with 303 additions and 318 deletions

View File

@@ -1,6 +1,6 @@
'use server'
import {callByUser} from '@/actions/base'
import {callByUser, callPublic} from '@/actions/base'
export async function RechargeByAlipay(props: {
amount: number
@@ -31,3 +31,23 @@ export async function RechargeByWechatConfirm(props: {
}) {
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)
}