🎉 chore(init): project initialization
This commit is contained in:
@@ -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 || {}),
|
||||
});
|
||||
}
|
||||
@@ -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 || {}),
|
||||
});
|
||||
}
|
||||
@@ -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
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user