mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-30 07:46:13 +00:00
refactor: 统一项目中状态字段类型为数字类型
这是一个大规模的类型对齐优化: 1. 将多处字符串类型的status字段统一改为数字类型,包括前后端接口定义、数据模型、页面组件 2. 重构编排节点相关的命名和注释,统一改为"节点类型"替代"编排节点类型" 3. 移除了过时的忘记密码相关接口和模板代码 4. 优化搜索栏组件,支持展开仅显示次要字段 5. 调整部分接口参数和路由逻辑,对齐前后端参数格式
This commit is contained in:
@@ -23,7 +23,7 @@ const AuthAPI = {
|
||||
},
|
||||
|
||||
refreshToken(body: RefreshToekenBody) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
return request<ApiResponse<JWTOut>>({
|
||||
url: `${API_PATH}/token/refresh`,
|
||||
method: "post",
|
||||
data: body,
|
||||
@@ -45,32 +45,6 @@ const AuthAPI = {
|
||||
});
|
||||
},
|
||||
|
||||
/** 获取免登录用户列表 */
|
||||
getAutoLoginUsers() {
|
||||
return request<ApiResponse<AutoLoginUser[]>>({
|
||||
url: `${API_PATH}/auto-login/users`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
/** 获取免登录Token */
|
||||
getAutoLoginToken(userId: number) {
|
||||
return request<ApiResponse<AutoLoginToken>>({
|
||||
url: `${API_PATH}/auto-login/token`,
|
||||
method: "post",
|
||||
params: { user_id: userId },
|
||||
});
|
||||
},
|
||||
|
||||
/** 免登录 */
|
||||
autoLogin(token: string) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `${API_PATH}/auto-login`,
|
||||
method: "post",
|
||||
params: { token },
|
||||
});
|
||||
},
|
||||
|
||||
/** 获取当前用户的可选租户列表 */
|
||||
getTenants() {
|
||||
return request<ApiResponse<TenantOption[]>>({
|
||||
@@ -129,12 +103,16 @@ export interface LoginFormData {
|
||||
login_type?: string;
|
||||
}
|
||||
|
||||
/** 登录成功返回 (JWTOutSchema) */
|
||||
export interface LoginResult {
|
||||
/** JWT 响应 (JWTOutSchema) */
|
||||
export interface JWTOut {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
}
|
||||
|
||||
/** 登录成功返回 */
|
||||
export interface LoginResult extends JWTOut {
|
||||
tenants?: TenantOption[];
|
||||
}
|
||||
|
||||
@@ -148,20 +126,6 @@ export interface LogoutBody {
|
||||
token: string;
|
||||
}
|
||||
|
||||
/** 免登录用户 (AutoLoginUserSchema) */
|
||||
export interface AutoLoginUser {
|
||||
id: number;
|
||||
username: string;
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/** 免登录 Token (AutoLoginTokenSchema) */
|
||||
export interface AutoLoginToken {
|
||||
token: string;
|
||||
user: AutoLoginUser;
|
||||
}
|
||||
|
||||
/** 租户选项 */
|
||||
export interface TenantOption {
|
||||
id: number;
|
||||
|
||||
Reference in New Issue
Block a user