mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-05-05 21:50:44 +08:00
feat: add affiliate invite rebate flow and admin rebate-rate setting
This commit is contained in:
@@ -308,6 +308,7 @@ export interface SystemSettings {
|
||||
totp_encryption_key_configured: boolean; // TOTP 加密密钥是否已配置
|
||||
// Default settings
|
||||
default_balance: number;
|
||||
affiliate_rebate_rate: number;
|
||||
default_concurrency: number;
|
||||
default_user_rpm_limit: number;
|
||||
default_subscriptions: DefaultSubscriptionSetting[];
|
||||
@@ -489,6 +490,7 @@ export interface UpdateSettingsRequest {
|
||||
invitation_code_enabled?: boolean;
|
||||
totp_enabled?: boolean; // TOTP 双因素认证
|
||||
default_balance?: number;
|
||||
affiliate_rebate_rate?: number;
|
||||
default_concurrency?: number;
|
||||
default_user_rpm_limit?: number;
|
||||
default_subscriptions?: DefaultSubscriptionSetting[];
|
||||
|
||||
@@ -9,7 +9,14 @@ import {
|
||||
prepareOAuthBindAccessTokenCookie,
|
||||
type WeChatOAuthPublicSettings,
|
||||
} from './auth'
|
||||
import type { User, ChangePasswordRequest, NotifyEmailEntry, UserAuthProvider } from '@/types'
|
||||
import type {
|
||||
User,
|
||||
ChangePasswordRequest,
|
||||
NotifyEmailEntry,
|
||||
UserAuthProvider,
|
||||
UserAffiliateDetail,
|
||||
AffiliateTransferResponse
|
||||
} from '@/types'
|
||||
|
||||
/**
|
||||
* Get current user profile
|
||||
@@ -168,6 +175,16 @@ export async function startOAuthBinding(
|
||||
window.location.href = startURL
|
||||
}
|
||||
|
||||
export async function getAffiliateDetail(): Promise<UserAffiliateDetail> {
|
||||
const { data } = await apiClient.get<UserAffiliateDetail>('/user/aff')
|
||||
return data
|
||||
}
|
||||
|
||||
export async function transferAffiliateQuota(): Promise<AffiliateTransferResponse> {
|
||||
const { data } = await apiClient.post<AffiliateTransferResponse>('/user/aff/transfer')
|
||||
return data
|
||||
}
|
||||
|
||||
export const userAPI = {
|
||||
getProfile,
|
||||
updateProfile,
|
||||
@@ -180,7 +197,9 @@ export const userAPI = {
|
||||
bindEmailIdentity,
|
||||
unbindAuthIdentity,
|
||||
buildOAuthBindingStartURL,
|
||||
startOAuthBinding
|
||||
startOAuthBinding,
|
||||
getAffiliateDetail,
|
||||
transferAffiliateQuota
|
||||
}
|
||||
|
||||
export default userAPI
|
||||
|
||||
Reference in New Issue
Block a user