更新移动端API,新增登录位置相关类型定义,优化类型结构以提升代码可读性和可维护性。

This commit is contained in:
zyh
2025-04-10 06:59:14 +00:00
parent 52c4e2d187
commit 777bfe70ed
2 changed files with 43 additions and 3 deletions

View File

@@ -2,9 +2,9 @@ import axios from 'axios';
import type { MinioUploadPolicy, OSSUploadPolicy } from '@d8d-appcontainer/types';
import 'dayjs/locale/zh-cn';
import type {
User, FileLibrary, FileCategory, KnowInfo,
AuthContextType, ThemeContextType, Attachment, ThemeSettings,
SystemSetting, SystemSettingGroupData
User, FileLibrary, FileCategory, ThemeSettings,
SystemSetting, SystemSettingGroupData,
LoginLocation, LoginLocationDetail
} from '../share/types.ts';

View File

@@ -408,3 +408,43 @@ export interface KnowInfo {
/** 更新时间 */
updated_at: Date;
}
// 登录位置详细信息
export interface LoginLocationDetail {
/** 记录ID */
id: number;
/** 用户ID */
user_id: number;
/** 登录时间 */
login_time: string;
/** IP地址 */
ip_address: string;
/** 用户代理 */
user_agent: string;
/** 纬度 */
latitude: number | null;
/** 经度 */
longitude: number | null;
/** 位置名称 */
location_name?: string;
/** 关联用户信息 */
user?: {
id: number;
username: string;
nickname?: string;
};
}
// 登录位置信息
export interface LoginLocation {
/** 纬度 */
latitude: number | null;
/** 经度 */
longitude: number | null;
/** IP地址 */
ip_address?: string;
/** 用户代理 */
user_agent?: string;
/** 登录时间 */
login_time?: string;
}