mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-08 10:39:59 +00:00
refactor: 重构项目模块结构与代码细节优化
1. 调整后端模块路由与插件文件结构,迁移部分模块代码至api/v1目录 2. 优化代码注释格式与文档字符串,简化冗余代码 3. 添加监控仪表盘、工单评论等新模块功能 4. 修复前端部分组件交互逻辑与类型定义 5. 清理冗余的初始化数据与废弃配置文件 6. 新增租户注册表单字段与国际化支持 7. 优化HTTP请求拦截器与快捷键功能
This commit is contained in:
@@ -61,6 +61,24 @@ const AuthAPI = {
|
||||
data: { tenant_id: tenantId },
|
||||
});
|
||||
},
|
||||
|
||||
/** 返回平台管理模式,清除 tenant_id 返回平台作用域 JWT */
|
||||
enterPlatform() {
|
||||
return request<ApiResponse<SelectTenantResult>>({
|
||||
url: `${API_PATH}/enter-platform`,
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
|
||||
/** 平台管理员代签入(以指定租户身份登录) */
|
||||
impersonate(tenantId: number) {
|
||||
return request<ApiResponse<ImpersonateResult>>({
|
||||
url: `${API_PATH}/impersonate`,
|
||||
method: "post",
|
||||
data: { tenant_id: tenantId },
|
||||
});
|
||||
},
|
||||
|
||||
/** 租户自助注册(PRD §4.5) */
|
||||
tenantRegister(body: TenantRegisterForm) {
|
||||
return request<ApiResponse<TenantRegisterResult>>({
|
||||
@@ -69,6 +87,23 @@ const AuthAPI = {
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/** 根据编码查询租户 */
|
||||
lookupTenant(code: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/tenant/${encodeURIComponent(code)}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 根据域名查询租户 */
|
||||
lookupTenantByDomain(domain: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/tenant-by-domain`,
|
||||
method: "get",
|
||||
params: { domain },
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default AuthAPI;
|
||||
@@ -140,6 +175,16 @@ export interface SelectTenantResult {
|
||||
expires_in: number;
|
||||
}
|
||||
|
||||
/** 平台管理员代签入返回 (ImpersonateOutSchema) */
|
||||
export interface ImpersonateResult {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
tenant_id: number;
|
||||
tenant_name: string;
|
||||
}
|
||||
|
||||
/** 验证码信息 */
|
||||
export interface CaptchaInfo {
|
||||
enable: boolean;
|
||||
|
||||
Reference in New Issue
Block a user