feat(db): 添加Dexie数据库支持并重构数据存储结构

添加Dexie作为IndexedDB封装库,实现本地数据存储功能
重构数据接口定义和存储模块结构,优化类型定义
统一数据接口文件位置,增强代码可维护性
This commit is contained in:
超级老白兔
2025-08-29 15:13:31 +08:00
parent bdc94d853d
commit bc7cc6810d
13 changed files with 1051 additions and 82 deletions

View File

@@ -1,46 +1,4 @@
import { ContractData } from "../../pages/pc/ckbox/data";
//终端用户数据接口
export interface KfUserListData {
id: number;
tenantId: number;
wechatId: string;
nickname: string;
alias: string;
avatar: string;
gender: number;
region: string;
signature: string;
bindQQ: string;
bindEmail: string;
bindMobile: string;
createTime: string;
currentDeviceId: number;
isDeleted: boolean;
deleteTime: string;
groupId: number;
memo: string;
wechatVersion: string;
labels: string[];
lastUpdateTime: string;
isOnline?: boolean;
[key: string]: any;
}
// 账户信息接口
export interface CkAccount {
id: number;
realName: string;
nickname: string | null;
memo: string | null;
avatar: string;
userName: string;
secret: string;
accountType: number;
departmentId: number;
useGoogleSecretKey: boolean;
hasVerifyGoogleSecret: boolean;
}
import { ContractData, KfUserListData, CkAccount } from "@/pages/pc/ckbox/data";
// 权限片段接口
export interface PrivilegeFrag {

View File

@@ -1,13 +1,11 @@
import { createPersistStore } from "@/store/createPersistStore";
import { CkChatState, CkUserInfo, CkTenant } from "./ckchat.data";
import {
CkChatState,
CkUserInfo,
ContractData,
GroupData,
CkAccount,
CkTenant,
KfUserListData,
} from "./ckchat.data";
import { ContractData, GroupData } from "@/pages/pc/ckbox/data";
} from "@/pages/pc/ckbox/data";
export const useCkChatStore = createPersistStore<CkChatState>(
set => ({