🎉 chore(init): project initialization

This commit is contained in:
web@ppanel
2024-11-14 01:22:43 +07:00
commit 829edfa824
479 changed files with 61413 additions and 0 deletions
+96
View File
@@ -0,0 +1,96 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update announcement PUT /v1/admin/announcement/ */
export async function updateAnnouncement(
body: API.UpdateAnnouncementRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/announcement/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create announcement POST /v1/admin/announcement/ */
export async function createAnnouncement(
body: API.CreateAnnouncementRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/announcement/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete announcement DELETE /v1/admin/announcement/ */
export async function deleteAnnouncement(
body: API.DeleteAnnouncementRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/announcement/', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get announcement GET /v1/admin/announcement/detail */
export async function getAnnouncement(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetAnnouncementParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.Announcement }>('/v1/admin/announcement/detail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Update announcement enable PUT /v1/admin/announcement/enable */
export async function updateAnnouncementEnable(
body: API.UpdateAnnouncementEnableRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/announcement/enable', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get announcement list GET /v1/admin/announcement/list */
export async function getAnnouncementList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetAnnouncementListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetAnnouncementListResponse }>(
'/v1/admin/announcement/list',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
+78
View File
@@ -0,0 +1,78 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update coupon PUT /v1/admin/coupon/ */
export async function updateCoupon(
body: API.UpdateCouponRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/coupon/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create coupon POST /v1/admin/coupon/ */
export async function createCoupon(
body: API.CreateCouponRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/coupon/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete coupon DELETE /v1/admin/coupon/ */
export async function deleteCoupon(
body: API.DeleteCouponRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/coupon/', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete coupon DELETE /v1/admin/coupon/batch */
export async function batchDeleteCoupon(
body: API.BatchDeleteCouponRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/coupon/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get coupon list GET /v1/admin/coupon/list */
export async function getCouponList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetCouponListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetCouponListResponse }>('/v1/admin/coupon/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
+86
View File
@@ -0,0 +1,86 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update document PUT /v1/admin/document/ */
export async function updateDocument(
body: API.UpdateDocumentRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/document/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create document POST /v1/admin/document/ */
export async function createDocument(
body: API.CreateDocumentRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/document/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete document DELETE /v1/admin/document/ */
export async function deleteDocument(
body: API.DeleteDocumentRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/document/', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete document DELETE /v1/admin/document/batch */
export async function batchDeleteDocument(
body: API.BatchDeleteDocumentRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/document/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get document detail GET /v1/admin/document/detail */
export async function getDocumentDetail(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.Document }>('/v1/admin/document/detail', {
method: 'GET',
...(options || {}),
});
}
/** Get document list GET /v1/admin/document/list */
export async function getDocumentList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetDocumentListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetDocumentListResponse }>('/v1/admin/document/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
+26
View File
@@ -0,0 +1,26 @@
// @ts-ignore
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
import * as announcement from './announcement';
import * as coupon from './coupon';
import * as document from './document';
import * as order from './order';
import * as payment from './payment';
import * as server from './server';
import * as subscribe from './subscribe';
import * as system from './system';
import * as ticket from './ticket';
import * as user from './user';
export default {
announcement,
coupon,
document,
order,
payment,
server,
subscribe,
system,
ticket,
user,
};
+45
View File
@@ -0,0 +1,45 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Create order POST /v1/admin/order/ */
export async function createOrder(body: API.CreateOrderRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/order/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get order list GET /v1/admin/order/list */
export async function getOrderList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetOrderListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetOrderListResponse }>('/v1/admin/order/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Update order status PUT /v1/admin/order/status */
export async function updateOrderStatus(
body: API.UpdateOrderStatusRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/order/status', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
+109
View File
@@ -0,0 +1,109 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Get alipay f2f payment config GET /v1/admin/payment/alipay_f2f */
export async function getAlipayF2FPaymentConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PaymentConfig }>('/v1/admin/payment/alipay_f2f', {
method: 'GET',
...(options || {}),
});
}
/** Update alipay f2f payment config PUT /v1/admin/payment/alipay_f2f */
export async function updateAlipayF2FPaymentConfig(
body: API.PaymentConfig,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/payment/alipay_f2f', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get all payment config GET /v1/admin/payment/all */
export async function getAllPaymentConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetAllPaymentConfigResponse }>(
'/v1/admin/payment/all',
{
method: 'GET',
...(options || {}),
},
);
}
/** Get epay payment config GET /v1/admin/payment/epay */
export async function getEpayPaymentConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PaymentConfig }>('/v1/admin/payment/epay', {
method: 'GET',
...(options || {}),
});
}
/** Update epay payment config PUT /v1/admin/payment/epay */
export async function updateEpayPaymentConfig(
body: API.PaymentConfig,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/payment/epay', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get stripe alipay payment config GET /v1/admin/payment/stripe_alipay */
export async function getStripeAlipayPaymentConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PaymentConfig }>('/v1/admin/payment/stripe_alipay', {
method: 'GET',
...(options || {}),
});
}
/** Update stripe alipay payment config PUT /v1/admin/payment/stripe_alipay */
export async function updateStripeAlipayPaymentConfig(
body: API.PaymentConfig,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/payment/stripe_alipay', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get stripe wechat pay payment config GET /v1/admin/payment/stripe_wechat_pay */
export async function getStripeWeChatPayPaymentConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PaymentConfig }>(
'/v1/admin/payment/stripe_wechat_pay',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update stripe wechat pay payment config PUT /v1/admin/payment/stripe_wechat_pay */
export async function updateStripeWeChatPayPaymentConfig(
body: API.PaymentConfig,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/payment/stripe_wechat_pay', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
+155
View File
@@ -0,0 +1,155 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update node PUT /v1/admin/server/ */
export async function updateNode(body: API.UpdateNodeRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/server/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create node POST /v1/admin/server/ */
export async function createNode(body: API.CreateNodeRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/server/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete node DELETE /v1/admin/server/ */
export async function deleteNode(body: API.DeleteNodeRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/server/', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete node DELETE /v1/admin/server/batch */
export async function batchDeleteNode(
body: API.BatchDeleteNodeRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/server/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get node detail GET /v1/admin/server/detail */
export async function getNodeDetail(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetNodeDetailParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.Server }>('/v1/admin/server/detail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Update node group PUT /v1/admin/server/group */
export async function updateNodeGroup(
body: API.UpdateNodeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/server/group', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create node group POST /v1/admin/server/group */
export async function createNodeGroup(
body: API.CreateNodeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/server/group', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete node group DELETE /v1/admin/server/group */
export async function deleteNodeGroup(
body: API.DeleteNodeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/server/group', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete node group DELETE /v1/admin/server/group/batch */
export async function batchDeleteNodeGroup(
body: API.BatchDeleteNodeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/server/group/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get node group list GET /v1/admin/server/group/list */
export async function getNodeGroupList(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetNodeGroupListResponse }>(
'/v1/admin/server/group/list',
{
method: 'GET',
...(options || {}),
},
);
}
/** Get node list GET /v1/admin/server/list */
export async function getNodeList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetNodeListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetNodeServerListResponse }>('/v1/admin/server/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
+167
View File
@@ -0,0 +1,167 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update subscribe PUT /v1/admin/subscribe/ */
export async function updateSubscribe(
body: API.UpdateSubscribeRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create subscribe POST /v1/admin/subscribe/ */
export async function createSubscribe(
body: API.CreateSubscribeRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete subscribe DELETE /v1/admin/subscribe/ */
export async function deleteSubscribe(
body: API.DeleteSubscribeRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete subscribe DELETE /v1/admin/subscribe/batch */
export async function batchDeleteSubscribe(
body: API.BatchDeleteSubscribeRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get subscribe details GET /v1/admin/subscribe/details */
export async function getSubscribeDetails(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetSubscribeDetailsParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.Subscribe }>('/v1/admin/subscribe/details', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Update subscribe group PUT /v1/admin/subscribe/group */
export async function updateSubscribeGroup(
body: API.UpdateSubscribeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/group', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create subscribe group POST /v1/admin/subscribe/group */
export async function createSubscribeGroup(
body: API.CreateSubscribeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/group', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete subscribe group DELETE /v1/admin/subscribe/group */
export async function deleteSubscribeGroup(
body: API.DeleteSubscribeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/group', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Batch delete subscribe group DELETE /v1/admin/subscribe/group/batch */
export async function batchDeleteSubscribeGroup(
body: API.BatchDeleteSubscribeGroupRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/subscribe/group/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get subscribe group list GET /v1/admin/subscribe/group/list */
export async function getSubscribeGroupList(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscribeGroupListResponse }>(
'/v1/admin/subscribe/group/list',
{
method: 'GET',
...(options || {}),
},
);
}
/** Get subscribe list GET /v1/admin/subscribe/list */
export async function getSubscribeList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetSubscribeListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetSubscribeListResponse }>(
'/v1/admin/subscribe/list',
{
method: 'GET',
params: {
...params,
},
...(options || {}),
},
);
}
+345
View File
@@ -0,0 +1,345 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Get application GET /v1/admin/system/application */
export async function getApplication(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetApplicationResponse }>(
'/v1/admin/system/application',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update application PUT /v1/admin/system/application */
export async function updateApplication(
body: API.UpdateApplicationRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/application', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create application POST /v1/admin/system/application */
export async function createApplication(
body: API.CreateApplicationRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/application', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete application DELETE /v1/admin/system/application */
export async function deleteApplication(
body: API.DeleteApplicationRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/application', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get Currency Config GET /v1/admin/system/currency_config */
export async function getCurrencyConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetCurrencyConfigResponse }>(
'/v1/admin/system/currency_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update Currency Config PUT /v1/admin/system/currency_config */
export async function updateCurrencyConfig(
body: API.UpdateCurrencyConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/currency_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get email smtp config GET /v1/admin/system/email_config */
export async function getEmailSmtpConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetEmailSmtpConfigResponse }>(
'/v1/admin/system/email_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update email smtp config PUT /v1/admin/system/email_config */
export async function updateEmailSmtpConfig(
body: API.UpdateEmailSmtpConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/email_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get invite config GET /v1/admin/system/invite_config */
export async function getInviteConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetInviteConfigResponse }>(
'/v1/admin/system/invite_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update invite config PUT /v1/admin/system/invite_config */
export async function updateInviteConfig(
body: API.UpdateInviteConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/invite_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get node config GET /v1/admin/system/node_config */
export async function getNodeConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetNodeConfigResponse }>(
'/v1/admin/system/node_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update node config PUT /v1/admin/system/node_config */
export async function updateNodeConfig(
body: API.UpdateNodeConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/node_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get register config GET /v1/admin/system/register_config */
export async function getRegisterConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetRegisterConfigResponse }>(
'/v1/admin/system/register_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update register config PUT /v1/admin/system/register_config */
export async function updateRegisterConfig(
body: API.UpdateRegisterConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/register_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get site config GET /v1/admin/system/site_config */
export async function getSiteConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSiteConfigResponse }>(
'/v1/admin/system/site_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update site config PUT /v1/admin/system/site_config */
export async function updateSiteConfig(
body: API.UpdateSiteConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/site_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get subscribe config GET /v1/admin/system/subscribe_config */
export async function getSubscribeConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscribeConfigResponse }>(
'/v1/admin/system/subscribe_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update subscribe config PUT /v1/admin/system/subscribe_config */
export async function updateSubscribeConfig(
body: API.UpdateSubscribeConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/subscribe_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get subscribe type GET /v1/admin/system/subscribe_type */
export async function getSubscribeType(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscribeTypeResponse }>(
'/v1/admin/system/subscribe_type',
{
method: 'GET',
...(options || {}),
},
);
}
/** Get Telegram Config GET /v1/admin/system/telegram_config */
export async function getTelegramConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetTelegramConfigResponse }>(
'/v1/admin/system/telegram_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update Telegram Config PUT /v1/admin/system/telegram_config */
export async function updateTelegramConfig(
body: API.UpdateTelegramConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/telegram_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Test email smtp POST /v1/admin/system/test_email */
export async function testEmailSmtp(
body: API.TestEmailSmtpRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/test_email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get Team of Service Config GET /v1/admin/system/tos_config */
export async function getTosConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetTosConfigResponse }>(
'/v1/admin/system/tos_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update Team of Service Config PUT /v1/admin/system/tos_config */
export async function updateTosConfig(
body: API.UpdateTosConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/tos_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get verify config GET /v1/admin/system/verify_config */
export async function getVerifyConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetVerifyConfigResponse }>(
'/v1/admin/system/verify_config',
{
method: 'GET',
...(options || {}),
},
);
}
/** Update verify config PUT /v1/admin/system/verify_config */
export async function updateVerifyConfig(
body: API.UpdateVerifyConfigRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/system/verify_config', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
+63
View File
@@ -0,0 +1,63 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update ticket status PUT /v1/admin/ticket/ */
export async function updateTicketStatus(
body: API.UpdateTicketStatusRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/ticket/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get ticket detail GET /v1/admin/ticket/detail */
export async function getTicket(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetTicketParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.Ticket }>('/v1/admin/ticket/detail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Create ticket follow POST /v1/admin/ticket/follow */
export async function createTicketFollow(
body: API.CreateTicketFollowRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/ticket/follow', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Get ticket list GET /v1/admin/ticket/list */
export async function getTicketList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetTicketListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetTicketListResponse }>('/v1/admin/ticket/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
+900
View File
@@ -0,0 +1,900 @@
declare namespace API {
type Announcement = {
id: number;
title: string;
content: string;
enable: boolean;
created_at: number;
updated_at: number;
};
type Application = {
id: number;
name: string;
platform: string;
subscribe_type: string;
icon: string;
url: string;
};
type BatchDeleteCouponRequest = {
ids: number[];
};
type BatchDeleteDocumentRequest = {
ids: number[];
};
type BatchDeleteNodeGroupRequest = {
ids: number[];
};
type BatchDeleteNodeRequest = {
ids: number[];
};
type BatchDeleteSubscribeGroupRequest = {
ids: number[];
};
type BatchDeleteSubscribeRequest = {
ids: number[];
};
type BatchDeleteUserRequest = {
ids: number[];
};
type Coupon = {
id: number;
name: string;
code: string;
count: number;
type: number;
discount: number;
start_time: number;
expire_time: number;
user_limit: number;
subscribe: number[];
used_count: number;
enable: boolean;
created_at: number;
updated_at: number;
};
type CreateAnnouncementRequest = {
title: string;
content: string;
};
type CreateApplicationRequest = {
name: string;
platform: 'windows' | 'mac' | 'linux' | 'android' | 'ios';
subscribe_type: string;
icon: string;
url: string;
};
type CreateCouponRequest = {
name: string;
code?: string;
count?: number;
type: number;
discount: number;
start_time: number;
expire_time: number;
user_limit?: number;
subscribe?: number[];
used_count?: number;
enable?: boolean;
};
type CreateDocumentRequest = {
title: string;
content: string;
tags?: string[];
show: boolean;
};
type CreateNodeGroupRequest = {
name: string;
description: string;
};
type CreateNodeRequest = {
name: string;
server_addr: string;
speed_limit: number;
traffic_ratio: number;
groupId: number;
protocol: string;
enable: boolean;
vmess?: Vmess;
vless?: Vless;
trojan?: Trojan;
shadowsocks?: Shadowsocks;
};
type CreateOrderRequest = {
user_id: number;
type: number;
price: number;
amount: number;
fee_amount: number;
coupon?: string;
reduction?: number;
method?: string;
trade_no?: string;
status?: number;
subscribe_id?: number;
};
type CreateSubscribeGroupRequest = {
name: string;
description: string;
};
type CreateSubscribeRequest = {
name: string;
description: string;
unit_price: number;
discount: SubscribeDiscount[];
replacement: number;
inventory: number;
traffic: number;
speed_limit: number;
device_limit: number;
quota: number;
group_id: number;
server_group: number[];
server: number[];
show: boolean;
sell: boolean;
};
type CreateTicketFollowRequest = {
ticket_id: number;
from: string;
type: number;
content: string;
};
type CreateUserRequest = {
email: string;
password: string;
product_id: number;
duration: number;
referer_user: string;
refer_code: string;
balance: number;
is_admin: boolean;
};
type DeleteAnnouncementRequest = {
id: number;
};
type DeleteApplicationRequest = {
id: number;
};
type DeleteCouponRequest = {
id: number;
};
type DeleteDocumentRequest = {
id: number;
};
type DeleteNodeGroupRequest = {
id: number;
};
type DeleteNodeRequest = {
id: number;
};
type DeleteSubscribeGroupRequest = {
id: number;
};
type DeleteSubscribeRequest = {
id: number;
};
type DeleteUserParams = {
id: number;
};
type Document = {
id: number;
title: string;
content: string;
tags: string[];
show: boolean;
created_at: number;
updated_at: number;
};
type Follow = {
id: number;
ticket_id: number;
from: string;
type: number;
content: string;
created_at: number;
};
type GetAllPaymentConfigResponse = {
list: PaymentConfig[];
};
type GetAnnouncementListParams = {
page: number;
size: number;
enable?: boolean;
search?: string;
};
type GetAnnouncementListRequest = {
page: number;
size: number;
enable?: boolean;
search?: string;
};
type GetAnnouncementListResponse = {
total: number;
list: Announcement[];
};
type GetAnnouncementParams = {
id: number;
};
type GetAnnouncementRequest = {
id: number;
};
type GetApplicationResponse = {
windows: Application[];
mac: Application[];
linux: Application[];
android: Application[];
ios: Application[];
};
type GetCouponListParams = {
page: number;
size: number;
subscribe?: number;
search?: string;
};
type GetCouponListRequest = {
page: number;
size: number;
subscribe?: number;
search?: string;
};
type GetCouponListResponse = {
total: number;
list: Coupon[];
};
type GetCurrencyConfigResponse = {
currency_unit: string;
currency_symbol: string;
access_key: string;
};
type GetDetailRequest = {
id: number;
};
type GetDocumentDetailRequest = {
id: number;
};
type GetDocumentListParams = {
page: number;
size: number;
tag?: string;
search?: string;
};
type GetDocumentListRequest = {
page: number;
size: number;
tag?: string;
search?: string;
};
type GetDocumentListResponse = {
total: number;
list: Document[];
};
type GetEmailSmtpConfigResponse = {
email_smtp_host: string;
email_smtp_port: number;
email_smtp_user: string;
email_smtp_pass: string;
email_smtp_from: string;
email_smtp_ssl: boolean;
verify_email_template: string;
maintenance_email_template: string;
expiration_email_template: string;
};
type GetInviteConfigResponse = {
forced_invite: boolean;
referral_percentage: number;
only_first_purchase: boolean;
};
type GetNodeConfigResponse = {
node_secret: string;
node_pull_interval: number;
node_push_interval: number;
};
type GetNodeDetailParams = {
id: number;
};
type GetNodeDetailRequest = {
id: number;
};
type GetNodeGroupListResponse = {
total: number;
list: ServerGroup[];
};
type GetNodeListParams = {
page: number;
size: number;
group_id?: number;
search?: string;
};
type GetNodeServerListRequest = {
page: number;
size: number;
group_id?: number;
search?: string;
};
type GetNodeServerListResponse = {
total: number;
list: Server[];
};
type GetOrderListParams = {
page: number;
size: number;
user_id?: number;
status?: number;
subscribe_id?: number;
search?: string;
};
type GetOrderListRequest = {
page: number;
size: number;
user_id?: number;
status?: number;
subscribe_id?: number;
search?: string;
};
type GetOrderListResponse = {
total: number;
list: Order[];
};
type GetRegisterConfigResponse = {
stop_register: boolean;
enable_trial: boolean;
enable_email_verify: boolean;
enable_email_domain_suffix: boolean;
email_domain_suffix_list: string;
enable_ip_register_limit: boolean;
ip_register_limit: number;
ip_register_limit_duration: number;
};
type GetSiteConfigResponse = {
host: string;
site_name: string;
site_desc: string;
site_logo: string;
};
type GetSubscribeConfigResponse = {
single_model: boolean;
subscribe_path: string;
subscribe_domain: string;
pan_domain: boolean;
};
type GetSubscribeDetailsParams = {
id: number;
};
type GetSubscribeDetailsRequest = {
id: number;
};
type GetSubscribeGroupListResponse = {
list: SubscribeGroup[];
total: number;
};
type GetSubscribeListParams = {
page: number;
size: number;
group_id?: number;
search?: string;
};
type GetSubscribeListRequest = {
page: number;
size: number;
group_id?: number;
search?: string;
};
type GetSubscribeListResponse = {
list: Subscribe[];
total: number;
};
type GetSubscribeTypeResponse = {
subscribe_types: string[];
};
type GetTelegramConfigResponse = {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
};
type GetTicketListParams = {
page: number;
size: number;
user_id?: number;
status?: number;
search?: string;
};
type GetTicketListRequest = {
page: number;
size: number;
user_id?: number;
status?: number;
search?: string;
};
type GetTicketListResponse = {
total: number;
list: Ticket[];
};
type GetTicketParams = {
id: number;
};
type GetTicketRequest = {
id: number;
};
type GetTosConfigResponse = {
tos_content: string;
};
type GetUserDetailParams = {
id: number;
};
type GetUserListParams = {
page: number;
size: number;
search?: string;
};
type GetUserListRequest = {
page: number;
size: number;
search?: string;
};
type GetUserListResponse = {
total: number;
list: User[];
};
type GetVerifyConfigResponse = {
turnstile_site_key: string;
turnstile_secret: string;
enable_login_verify: boolean;
enable_register_verify: boolean;
enable_reset_password_verify: boolean;
};
type Order = {
id: number;
user_id: number;
order_no: string;
type: number;
price: number;
amount: number;
fee_amount: number;
coupon: string;
reduction: number;
method: string;
trade_no: string;
status: number;
subscribe_id: number;
created_at: number;
updated_at: number;
};
type PaymentConfig = {
id: number;
name: string;
mark: string;
icon?: string;
domain?: string;
config: Record<string, any>;
fee_mode: number;
fee_percent?: number;
fee_amount?: number;
enable: boolean;
};
type Response = {
/** 状态码 */
code?: number;
/** 消息 */
msg?: string;
/** 数据 */
data?: Record<string, any>;
};
type Server = {
id: number;
name: string;
server_addr: string;
speed_limit: number;
traffic_ratio: number;
groupId: number;
protocol: string;
enable: boolean;
vmess?: Vmess;
vless?: Vless;
trojan?: Trojan;
shadowsocks?: Shadowsocks;
created_at: number;
updated_at: number;
};
type ServerGroup = {
id: number;
name: string;
description: string;
created_at: number;
updated_at: number;
};
type Shadowsocks = {
method: string;
port: number;
enable_relay: boolean;
relay_host: string;
relay_port: number;
};
type Subscribe = {
id: number;
name: string;
description: string;
unit_price: number;
discount: SubscribeDiscount[];
replacement: number;
inventory: number;
traffic: number;
speed_limit: number;
device_limit: number;
quota: number;
group_id: number;
server_group: number[];
server: number[];
show: boolean;
sell: boolean;
created_at: number;
updated_at: number;
};
type SubscribeDiscount = {
months: number;
discount: number;
};
type SubscribeGroup = {
id: number;
name: string;
description: string;
created_at: number;
updated_at: number;
};
type TestEmailSmtpRequest = {
email: string;
};
type Ticket = {
id: number;
title: string;
description: string;
user_id: number;
follow?: Follow[];
status: number;
created_at: number;
updated_at: number;
};
type Trojan = {
network: string;
port: number;
host: string;
sni: string;
allow_insecure: boolean;
transport: Record<string, any>;
enable_relay: boolean;
relay_host: string;
relay_rort: number;
};
type UpdateAnnouncementEnableRequest = {
id: number;
enable: boolean;
};
type UpdateAnnouncementRequest = {
id: number;
title: string;
content: string;
enable: boolean;
};
type UpdateApplicationRequest = {
id: number;
name: string;
subscribe_type: string;
icon: string;
url: string;
};
type UpdateCouponRequest = {
id: number;
name: string;
code?: string;
count?: number;
type: number;
discount: number;
start_time: number;
expire_time: number;
user_limit?: number;
subscribe?: number[];
used_count?: number;
enable?: boolean;
};
type UpdateCurrencyConfigRequest = {
currency_unit: string;
currency_symbol: string;
access_key: string;
};
type UpdateDocumentRequest = {
id: number;
title: string;
content: string;
tags?: string[];
show: boolean;
};
type UpdateEmailSmtpConfigRequest = {
email_smtp_host: string;
email_smtp_port: number;
email_smtp_user: string;
email_smtp_pass: string;
email_smtp_from: string;
email_smtp_ssl: boolean;
email_template: string;
};
type UpdateInviteConfigRequest = {
forced_invite: boolean;
referral_percentage: number;
only_first_purchase: boolean;
};
type UpdateNodeConfigRequest = {
node_secret: string;
node_pull_interval: number;
node_push_interval: number;
};
type UpdateNodeGroupRequest = {
id: number;
name: string;
description: string;
};
type UpdateNodeRequest = {
id: number;
name: string;
server_addr: string;
speed_limit: number;
traffic_ratio: number;
groupId: number;
protocol: string;
enable: boolean;
vmess?: Vmess;
vless?: Vless;
trojan?: Trojan;
shadowsocks?: Shadowsocks;
};
type UpdateOrderStatusRequest = {
id: number;
status: number;
method?: string;
trade_no?: string;
};
type UpdateRegisterConfigRequest = {
stop_register: boolean;
enable_trial: boolean;
enable_email_verify: boolean;
enable_email_domain_suffix: boolean;
email_domain_suffix_list: string;
enable_ip_register_limit: boolean;
ip_register_limit: number;
ip_register_limit_duration: number;
};
type UpdateSiteConfigRequest = {
host: string;
site_name: string;
site_desc: string;
site_logo: string;
};
type UpdateSubscribeConfigRequest = {
single_model: boolean;
subscribe_path: string;
subscribe_domain: string;
pan_domain: boolean;
};
type UpdateSubscribeGroupRequest = {
id: number;
name: string;
description: string;
};
type UpdateSubscribeRequest = {
id: number;
name: string;
description: string;
unit_price: number;
discount: SubscribeDiscount[];
replacement: number;
inventory: number;
traffic: number;
speed_limit: number;
device_limit: number;
quota: number;
group_id: number;
server_group: number[];
server: number[];
show: boolean;
sell: boolean;
};
type UpdateTelegramConfigRequest = {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
};
type UpdateTicketStatusRequest = {
id: number;
status: number;
};
type UpdateTosConfigRequest = {
tos_content: string;
};
type UpdateUserRequest = {
id: number;
email: string;
password: string;
avatar: string;
balance: number;
telegram: number;
refer_code: string;
referer_id: number;
enable: boolean;
is_admin: boolean;
valid_email: boolean;
enable_email_notify: boolean;
enable_telegram_notify: boolean;
enable_balance_notify: boolean;
enable_login_notify: boolean;
enable_subscribe_notify: boolean;
enable_trade_notify: boolean;
};
type UpdateVerifyConfigRequest = {
turnstile_site_key: string;
turnstile_secret: string;
enable_login_verify: boolean;
enable_register_verify: boolean;
enable_reset_password_verify: boolean;
};
type User = {
id: number;
email: string;
avatar: string;
balance: number;
telegram: number;
refer_code: string;
referer_id: number;
enable: boolean;
is_admin?: boolean;
valid_email: boolean;
enable_email_notify: boolean;
enable_telegram_notify: boolean;
enable_balance_notify: boolean;
enable_login_notify: boolean;
enable_subscribe_notify: boolean;
enable_trade_notify: boolean;
created_at: number;
updated_at: number;
deleted_at?: number;
is_del?: boolean;
};
type Vless = {
host: string;
port: number;
network: string;
transport: Record<string, any>;
security: string;
security_config: Record<string, any>;
xtls: string;
enable_relay: boolean;
relay_host: string;
relay_port: number;
};
type Vmess = {
host: string;
port: number;
enable_tls: boolean;
tls_config: Record<string, any>;
network: string;
transport: Record<string, any>;
enable_relay: boolean;
relay_host: string;
relay_port: number;
};
}
+95
View File
@@ -0,0 +1,95 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Update user PUT /v1/admin/user/ */
export async function updateUser(body: API.UpdateUserRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/user/', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Create user POST /v1/admin/user/ */
export async function createUser(body: API.CreateUserRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/user/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Delete user DELETE /v1/admin/user/ */
export async function deleteUser(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.DeleteUserParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/user/', {
method: 'DELETE',
params: {
...params,
},
...(options || {}),
});
}
/** Batch delete user DELETE /v1/admin/user/batch */
export async function batchDeleteUser(
body: API.BatchDeleteUserRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: any }>('/v1/admin/user/batch', {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Current user GET /v1/admin/user/current */
export async function currentUser(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.User }>('/v1/admin/user/current', {
method: 'GET',
...(options || {}),
});
}
/** Get user detail GET /v1/admin/user/detail */
export async function getUserDetail(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetUserDetailParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.User }>('/v1/admin/user/detail', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** Get user list GET /v1/admin/user/list */
export async function getUserList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetUserListParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.GetUserListResponse }>('/v1/admin/user/list', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
+60
View File
@@ -0,0 +1,60 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Check user is exist GET /v1/auth/check */
export async function checkUser(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.CheckUserParams,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.CheckUserResponse }>('/v1/auth/check', {
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', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** User register POST /v1/auth/register */
export async function userRegister(
body: API.UserRegisterRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** Reset password POST /v1/auth/reset */
export async function resetPassword(
body: API.ResetPasswordRequest,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/reset', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
+23
View File
@@ -0,0 +1,23 @@
// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';
/** Get verification code POST /v1/common/send_code */
export async function sendEmailCode(body: API.SendCodeRequest, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.SendCodeResponse }>('/v1/common/send_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', {
method: 'GET',
...(options || {}),
});
}
+10
View File
@@ -0,0 +1,10 @@
// @ts-ignore
/* eslint-disable */
// API 更新时间:
// API 唯一标识:
import * as auth from './auth';
import * as common from './common';
export default {
auth,
common,
};
+102
View File
@@ -0,0 +1,102 @@
declare namespace API {
type CheckUserParams = {
email: string;
};
type CheckUserRequest = {
email: string;
};
type CheckUserResponse = {
exist: boolean;
};
type CurrencyConfig = {
currency_unit: string;
currency_symbol: string;
};
type GetGlobalConfigResponse = {
site: SiteConfig;
verify: VeifyConfig;
register: RegisterConfig;
invite: InviteConfig;
currency: CurrencyConfig;
subscribe: SubscribeConfig;
};
type InviteConfig = {
forced_invite: boolean;
};
type LoginResponse = {
token: string;
};
type RegisterConfig = {
stop_register: boolean;
enable_email_verify: boolean;
enable_email_domain_suffix: boolean;
email_domain_suffix_list: string;
};
type ResetPasswordRequest = {
email: string;
password: string;
code?: string;
cf_token?: string;
};
type Response = {
/** 状态码 */
code?: number;
/** 消息 */
msg?: string;
/** 数据 */
data?: Record<string, any>;
};
type SendCodeRequest = {
email: string;
type: number;
};
type SendCodeResponse = {
status: boolean;
};
type SiteConfig = {
host: string;
site_name: string;
site_desc: string;
site_logo: string;
};
type SubscribeConfig = {
single_model: boolean;
subscribe_path: string;
subscribe_domain: string;
pan_domain: boolean;
};
type UserLoginRequest = {
email: string;
password: string;
cf_token?: string;
};
type UserRegisterRequest = {
email: string;
password: string;
invite?: string;
code?: string;
cf_token?: string;
};
type VeifyConfig = {
turnstile_site_key: string;
enable_login_verify: boolean;
enable_register_verify: boolean;
enable_reset_password_verify: boolean;
};
}