瀏覽代碼

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

zyh 8 月之前
父節點
當前提交
777bfe70ed
共有 2 個文件被更改,包括 43 次插入3 次删除
  1. 3 3
      client/mobile/api.ts
  2. 40 0
      client/share/types.ts

+ 3 - 3
client/mobile/api.ts

@@ -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';
 
 

+ 40 - 0
client/share/types.ts

@@ -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;
+}