✨ feat: Update Auth Control
This commit is contained in:
@@ -17,6 +17,24 @@ export async function checkUser(
|
||||
});
|
||||
}
|
||||
|
||||
/** Check user telephone is exist GET /v1/auth/check/telephone */
|
||||
export async function checkUserTelephone(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.CheckUserTelephoneParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.TelephoneCheckUserResponse }>(
|
||||
'/v1/auth/check/telephone',
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** User login POST /v1/auth/login */
|
||||
export async function userLogin(body: API.UserLoginRequest, options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/login', {
|
||||
@@ -29,6 +47,36 @@ export async function userLogin(body: API.UserLoginRequest, options?: { [key: st
|
||||
});
|
||||
}
|
||||
|
||||
/** User Telephone login POST /v1/auth/login/telephone */
|
||||
export async function telephoneLogin(
|
||||
body: API.TelephoneLoginRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/login/telephone', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** User Telephone login POST /v1/auth/login/telephone/code */
|
||||
export async function telephoneCodeLogin(
|
||||
body: API.TelephoneCodeLoginRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/login/telephone/code', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** User register POST /v1/auth/register */
|
||||
export async function userRegister(
|
||||
body: API.UserRegisterRequest,
|
||||
@@ -44,6 +92,21 @@ export async function userRegister(
|
||||
});
|
||||
}
|
||||
|
||||
/** User Telephone register POST /v1/auth/register/telephone */
|
||||
export async function telephoneUserRegister(
|
||||
body: API.TelephoneRegisterRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/register/telephone', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Reset password POST /v1/auth/reset */
|
||||
export async function resetPassword(
|
||||
body: API.ResetPasswordRequest,
|
||||
@@ -58,3 +121,18 @@ export async function resetPassword(
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Reset password POST /v1/auth/reset/telephone */
|
||||
export async function telephoneResetPassword(
|
||||
body: API.TelephoneResetPasswordRequest,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/reset/telephone', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,18 @@ export async function sendEmailCode(body: API.SendCodeRequest, options?: { [key:
|
||||
});
|
||||
}
|
||||
|
||||
/** Get sms verification code POST /v1/common/send_sms_code */
|
||||
export async function sendSmsCode(body: API.SendSmsCodeRequest, options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.SendCodeResponse }>('/v1/common/send_sms_code', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: body,
|
||||
...(options || {}),
|
||||
});
|
||||
}
|
||||
|
||||
/** Get global config GET /v1/common/site/config */
|
||||
export async function getGlobalConfig(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.GetGlobalConfigResponse }>('/v1/common/site/config', {
|
||||
|
||||
+64
@@ -39,6 +39,10 @@ declare namespace API {
|
||||
exist: boolean;
|
||||
};
|
||||
|
||||
type CheckUserTelephoneParams = {
|
||||
telephone: string;
|
||||
};
|
||||
|
||||
type Coupon = {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -262,8 +266,14 @@ declare namespace API {
|
||||
status: boolean;
|
||||
};
|
||||
|
||||
type SendSmsCodeRequest = {
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
};
|
||||
|
||||
type Server = {
|
||||
id: number;
|
||||
tags: string[];
|
||||
name: string;
|
||||
server_addr: string;
|
||||
relay_mode: string;
|
||||
@@ -308,6 +318,22 @@ declare namespace API {
|
||||
site_logo: string;
|
||||
};
|
||||
|
||||
type SmsConfig = {
|
||||
sms_enabled: boolean;
|
||||
sms_api_url: string;
|
||||
sms_api_foreign_url: string;
|
||||
sms_key: string;
|
||||
sms_secret: string;
|
||||
sms_region: string;
|
||||
sms_template: string;
|
||||
sms_template_code: string;
|
||||
sms_template_param: string;
|
||||
sms_platform: string;
|
||||
sms_limit: number;
|
||||
sms_interval: number;
|
||||
sms_expire_time: number;
|
||||
};
|
||||
|
||||
type SortItem = {
|
||||
id: number;
|
||||
sort: number;
|
||||
@@ -371,6 +397,44 @@ declare namespace API {
|
||||
telegram_web_hook_domain: string;
|
||||
};
|
||||
|
||||
type TelephoneCheckUserRequest = {
|
||||
telephone_area_code: string;
|
||||
};
|
||||
|
||||
type TelephoneCheckUserResponse = {
|
||||
exist: boolean;
|
||||
};
|
||||
|
||||
type TelephoneCodeLoginRequest = {
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
telephone_code: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type TelephoneLoginRequest = {
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type TelephoneRegisterRequest = {
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
invite?: string;
|
||||
code?: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type TelephoneResetPasswordRequest = {
|
||||
telephone: string;
|
||||
password: string;
|
||||
code?: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type Ticket = {
|
||||
id: number;
|
||||
title: string;
|
||||
|
||||
Vendored
+40
@@ -46,6 +46,14 @@ declare namespace API {
|
||||
orderNo: string;
|
||||
};
|
||||
|
||||
type CommissionLog = {
|
||||
id: number;
|
||||
user_id: number;
|
||||
order_no: string;
|
||||
amount: number;
|
||||
created_at: number;
|
||||
};
|
||||
|
||||
type Coupon = {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -360,6 +368,21 @@ declare namespace API {
|
||||
total: number;
|
||||
};
|
||||
|
||||
type QueryUserCommissionLogListRequest = {
|
||||
page: number;
|
||||
size: number;
|
||||
};
|
||||
|
||||
type QueryUserCommissionLogListResponse = {
|
||||
list: CommissionLog[];
|
||||
total: number;
|
||||
};
|
||||
|
||||
type QueryUserCommissionLogParams = {
|
||||
page: number;
|
||||
size: number;
|
||||
};
|
||||
|
||||
type QueryUserSubscribeListResponse = {
|
||||
list: UserSubscribe[];
|
||||
total: number;
|
||||
@@ -427,6 +450,7 @@ declare namespace API {
|
||||
|
||||
type Server = {
|
||||
id: number;
|
||||
tags: string[];
|
||||
name: string;
|
||||
server_addr: string;
|
||||
relay_mode: string;
|
||||
@@ -471,6 +495,22 @@ declare namespace API {
|
||||
site_logo: string;
|
||||
};
|
||||
|
||||
type SmsConfig = {
|
||||
sms_enabled: boolean;
|
||||
sms_api_url: string;
|
||||
sms_api_foreign_url: string;
|
||||
sms_key: string;
|
||||
sms_secret: string;
|
||||
sms_region: string;
|
||||
sms_template: string;
|
||||
sms_template_code: string;
|
||||
sms_template_param: string;
|
||||
sms_platform: string;
|
||||
sms_limit: number;
|
||||
sms_interval: number;
|
||||
sms_expire_time: number;
|
||||
};
|
||||
|
||||
type SortItem = {
|
||||
id: number;
|
||||
sort: number;
|
||||
|
||||
@@ -53,6 +53,24 @@ export async function bindTelegram(options?: { [key: string]: any }) {
|
||||
);
|
||||
}
|
||||
|
||||
/** Query User Commission Log GET /v1/public/user/commission_log */
|
||||
export async function queryUserCommissionLog(
|
||||
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
|
||||
params: API.QueryUserCommissionLogParams,
|
||||
options?: { [key: string]: any },
|
||||
) {
|
||||
return request<API.Response & { data?: API.QueryUserCommissionLogListResponse }>(
|
||||
'/v1/public/user/commission_log',
|
||||
{
|
||||
method: 'GET',
|
||||
params: {
|
||||
...params,
|
||||
},
|
||||
...(options || {}),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** Query User Info GET /v1/public/user/info */
|
||||
export async function queryUserInfo(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.User }>('/v1/public/user/info', {
|
||||
|
||||
Reference in New Issue
Block a user