Merge branch 'develop' of https://gitee.com/cunkebao/cunkebao_v3 into develop

# Conflicts:
#	Cunkebao/src/pages/mobile/mine/wechat-accounts/detail/index.tsx
This commit is contained in:
wong
2025-12-01 10:15:45 +08:00
58 changed files with 7190 additions and 602 deletions

View File

@@ -8,7 +8,6 @@ import {
LogoutOutlined,
SettingOutlined,
LockOutlined,
ReloadOutlined,
} from "@ant-design/icons";
import Layout from "@/components/Layout/Layout";
import { useUserStore } from "@/store/module/user";
@@ -16,7 +15,7 @@ import { useSettingsStore } from "@/store/module/settings";
import style from "./index.module.scss";
import NavCommon from "@/components/NavCommon";
import { sendMessageToParent, TYPE_EMUE } from "@/utils/postApp";
import { updateChecker } from "@/utils/updateChecker";
import { clearApplicationCache } from "@/utils/cacheCleaner";
interface SettingItem {
id: string;
@@ -58,13 +57,35 @@ const Setting: React.FC = () => {
const handleClearCache = () => {
Dialog.confirm({
content: "确定要清除缓存吗?这将清除所有本地数据。",
onConfirm: () => {
sendMessageToParent(
{
action: "clearCache",
},
TYPE_EMUE.FUNCTION,
);
onConfirm: async () => {
const handler = Toast.show({
icon: "loading",
content: "正在清理缓存...",
duration: 0,
});
try {
await clearApplicationCache();
sendMessageToParent(
{
action: "clearCache",
},
TYPE_EMUE.FUNCTION,
);
handler.close();
Toast.show({
icon: "success",
content: "缓存清理完成",
position: "top",
});
} catch (error) {
console.error("clear cache failed", error);
handler.close();
Toast.show({
icon: "fail",
content: "缓存清理失败,请稍后再试",
position: "top",
});
}
},
});
};

View File

@@ -2,13 +2,11 @@
export * from "./module/user";
export * from "./module/app";
export * from "./module/settings";
export * from "./module/websocket/websocket";
// 导入store实例
import { useUserStore } from "./module/user";
import { useAppStore } from "./module/app";
import { useSettingsStore } from "./module/settings";
import { useWebSocketStore } from "./module/websocket/websocket";
// 导出持久化store创建函数
export {
@@ -34,7 +32,6 @@ export interface StoreState {
user: ReturnType<typeof useUserStore.getState>;
app: ReturnType<typeof useAppStore.getState>;
settings: ReturnType<typeof useSettingsStore.getState>;
websocket: ReturnType<typeof useWebSocketStore.getState>;
}
// 便利的store访问函数
@@ -42,14 +39,12 @@ export const getStores = (): StoreState => ({
user: useUserStore.getState(),
app: useAppStore.getState(),
settings: useSettingsStore.getState(),
websocket: useWebSocketStore.getState(),
});
// 获取特定store状态
export const getUserStore = () => useUserStore.getState();
export const getAppStore = () => useAppStore.getState();
export const getSettingsStore = () => useSettingsStore.getState();
export const getWebSocketStore = () => useWebSocketStore.getState();
// 清除所有持久化数据(使用工具函数)
export const clearAllPersistedData = clearAllData;
@@ -61,7 +56,6 @@ export const getPersistKeys = () => Object.values(PERSIST_KEYS);
export const subscribeToUserStore = useUserStore.subscribe;
export const subscribeToAppStore = useAppStore.subscribe;
export const subscribeToSettingsStore = useSettingsStore.subscribe;
export const subscribeToWebSocketStore = useWebSocketStore.subscribe;
// 组合订阅函数
export const subscribeToAllStores = (callback: (state: StoreState) => void) => {
@@ -74,14 +68,10 @@ export const subscribeToAllStores = (callback: (state: StoreState) => void) => {
const unsubscribeSettings = useSettingsStore.subscribe(() => {
callback(getStores());
});
const unsubscribeWebSocket = useWebSocketStore.subscribe(() => {
callback(getStores());
});
return () => {
unsubscribeUser();
unsubscribeApp();
unsubscribeSettings();
unsubscribeWebSocket();
};
};

View File

@@ -0,0 +1,70 @@
// 全局缓存清理工具:浏览器存储 + IndexedDB + Zustand store
import { clearAllPersistedData } from "@/store";
import { useUserStore } from "@/store/module/user";
import { useAppStore } from "@/store/module/app";
import { useSettingsStore } from "@/store/module/settings";
const isBrowser = typeof window !== "undefined";
const safeStorageClear = (storage?: Storage) => {
if (!storage) return;
try {
storage.clear();
} catch (error) {
console.warn("清理存储失败:", error);
}
};
export const clearBrowserStorage = () => {
if (!isBrowser) return;
safeStorageClear(window.localStorage);
safeStorageClear(window.sessionStorage);
try {
clearAllPersistedData();
} catch (error) {
console.warn("清理持久化 store 失败:", error);
}
};
export const clearAllIndexedDB = async (): Promise<void> => {
if (!isBrowser || !window.indexedDB || !indexedDB.databases) return;
const databases = await indexedDB.databases();
const deleteJobs = databases
.map(db => db.name)
.filter((name): name is string => Boolean(name))
.map(
name =>
new Promise<void>((resolve, reject) => {
const request = indexedDB.deleteDatabase(name);
request.onsuccess = () => resolve();
request.onerror = () => reject(new Error(`删除数据库 ${name} 失败`));
request.onblocked = () => {
setTimeout(() => {
const retry = indexedDB.deleteDatabase(name);
retry.onsuccess = () => resolve();
retry.onerror = () =>
reject(new Error(`删除数据库 ${name} 失败`));
}, 100);
};
}),
);
await Promise.allSettled(deleteJobs);
};
export const resetAllStores = () => {
const userStore = useUserStore.getState();
const appStore = useAppStore.getState();
const settingsStore = useSettingsStore.getState();
userStore?.clearUser?.();
appStore?.resetAppState?.();
settingsStore?.resetSettings?.();
};
export const clearApplicationCache = async () => {
clearBrowserStorage();
await clearAllIndexedDB();
resetAllStores();
};

View File

@@ -0,0 +1,73 @@
// 缓存清理工具,统一处理浏览器存储与 Zustand store
import { clearAllPersistedData } from "@/store";
import { useUserStore } from "@/store/module/user";
import { useAppStore } from "@/store/module/app";
import { useSettingsStore } from "@/store/module/settings";
const isBrowser = typeof window !== "undefined";
const safeStorageClear = (storage?: Storage) => {
if (!storage) return;
try {
storage.clear();
} catch (error) {
console.warn("清理存储失败:", error);
}
};
export const clearBrowserStorage = () => {
if (!isBrowser) return;
safeStorageClear(window.localStorage);
safeStorageClear(window.sessionStorage);
// 清理自定义持久化数据
try {
clearAllPersistedData();
} catch (error) {
console.warn("清理持久化 store 失败:", error);
}
};
export const clearAllIndexedDB = async (): Promise<void> => {
if (!isBrowser || !window.indexedDB || !indexedDB.databases) return;
const databases = await indexedDB.databases();
const deleteJobs = databases
.map(db => db.name)
.filter((name): name is string => Boolean(name))
.map(
name =>
new Promise<void>((resolve, reject) => {
const request = indexedDB.deleteDatabase(name);
request.onsuccess = () => resolve();
request.onerror = () =>
reject(new Error(`删除数据库 ${name} 失败`));
request.onblocked = () => {
setTimeout(() => {
const retry = indexedDB.deleteDatabase(name);
retry.onsuccess = () => resolve();
retry.onerror = () =>
reject(new Error(`删除数据库 ${name} 失败`));
}, 100);
};
}),
);
await Promise.allSettled(deleteJobs);
};
export const resetAllStores = () => {
const userStore = useUserStore.getState();
const appStore = useAppStore.getState();
const settingsStore = useSettingsStore.getState();
userStore?.clearUser?.();
appStore?.resetAppState?.();
settingsStore?.resetSettings?.();
};
export const clearApplicationCache = async () => {
clearBrowserStorage();
await clearAllIndexedDB();
resetAllStores();
};

3
Moncter/weChat.ts Normal file
View File

@@ -0,0 +1,3 @@

374
Moncter/数据库/KR.js Normal file
View File

@@ -0,0 +1,374 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:11
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 厦门京东内
// ----------------------------
db.getCollection("厦门京东内").drop();
db.createCollection("厦门京东内");
// ----------------------------
// Collection structure for 厦门用户资产2025年9月
// ----------------------------
db.getCollection("厦门用户资产2025年9月").drop();
db.createCollection("厦门用户资产2025年9月");
// ----------------------------
// Collection structure for 厦门用户资产2025年9月_优化版
// ----------------------------
db.getCollection("厦门用户资产2025年9月_优化版").drop();
db.createCollection("厦门用户资产2025年9月_优化版");
db.getCollection("厦门用户资产2025年9月_优化版").createIndex({
user_level: NumberInt("1")
}, {
name: "user_level_1"
});
db.getCollection("厦门用户资产2025年9月_优化版").createIndex({
total_score: NumberInt("-1")
}, {
name: "total_score_-1"
});
db.getCollection("厦门用户资产2025年9月_优化版").createIndex({
mobile: NumberInt("1")
}, {
name: "mobile_1"
});
db.getCollection("厦门用户资产2025年9月_优化版").createIndex({
city: NumberInt("1")
}, {
name: "city_1"
});
db.getCollection("厦门用户资产2025年9月_优化版").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
// ----------------------------
// Collection structure for 游戏_深度用户有过语音聊天、魔兽等
// ----------------------------
db.getCollection("游戏_深度用户有过语音聊天、魔兽等").drop();
db.createCollection("游戏_深度用户有过语音聊天、魔兽等");
db.getCollection("游戏_深度用户有过语音聊天、魔兽等").createIndex({
user_id: NumberInt("1")
}, {
name: "user_id_1"
});
db.getCollection("游戏_深度用户有过语音聊天、魔兽等").createIndex({
user_value: NumberInt("1")
}, {
name: "user_value_1"
});
db.getCollection("游戏_深度用户有过语音聊天、魔兽等").createIndex({
overlap_count: NumberInt("1")
}, {
name: "overlap_count_1"
});
// ----------------------------
// Collection structure for 用户估值
// ----------------------------
db.getCollection("用户估值").drop();
db.createCollection("用户估值");
db.getCollection("用户估值").createIndex({
user_key: NumberInt("1")
}, {
name: "user_key_1",
unique: true
});
db.getCollection("用户估值").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("用户估值").createIndex({
phone_masked: NumberInt("1")
}, {
name: "phone_masked_1"
});
db.getCollection("用户估值").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("用户估值").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("用户估值").createIndex({
province: NumberInt("1"),
city: NumberInt("1")
}, {
name: "province_1_city_1"
});
db.getCollection("用户估值").createIndex({
computed_at: NumberInt("-1")
}, {
name: "computed_at_-1"
});
db.getCollection("用户估值").createIndex({
source_channels: NumberInt("1")
}, {
name: "source_channels_1"
});
db.getCollection("用户估值").createIndex({
"data_quality.completeness": NumberInt("-1")
}, {
name: "data_quality.completeness_-1"
});
db.getCollection("用户估值").createIndex({
user_evaluation_score: NumberInt("-1")
}, {
name: "user_evaluation_score_-1"
});
// ----------------------------
// Collection structure for 用户资产整合
// ----------------------------
db.getCollection("用户资产整合").drop();
db.createCollection("用户资产整合");
db.getCollection("用户资产整合").createIndex({
user_key: NumberInt("1")
}, {
name: "idx_user_key"
});
db.getCollection("用户资产整合").createIndex({
phone: NumberInt("1")
}, {
name: "idx_phone"
});
db.getCollection("用户资产整合").createIndex({
consumption_level: NumberInt("1")
}, {
name: "idx_consumption_level"
});
db.getCollection("用户资产整合").createIndex({
consumption_score: NumberInt("-1")
}, {
name: "idx_consumption_score_desc"
});
db.getCollection("用户资产整合").createIndex({
city: NumberInt("1")
}, {
name: "idx_city"
});
db.getCollection("用户资产整合").createIndex({
age_range: NumberInt("1")
}, {
name: "idx_age_range"
});
db.getCollection("用户资产整合").createIndex({
user_evaluation_score: NumberInt("-1")
}, {
name: "idx_user_evaluation_score_desc"
});
db.getCollection("用户资产整合").createIndex({
consumption_level: NumberInt("1"),
consumption_score: NumberInt("-1")
}, {
name: "idx_level_score"
});
// ----------------------------
// Collection structure for 金融客户_厦门_A级用户
// ----------------------------
db.getCollection("金融客户_厦门_A级用户").drop();
db.createCollection("金融客户_厦门_A级用户");
db.getCollection("金融客户_厦门_A级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_A级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_A级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融客户_厦门_B级用户
// ----------------------------
db.getCollection("金融客户_厦门_B级用户").drop();
db.createCollection("金融客户_厦门_B级用户");
db.getCollection("金融客户_厦门_B级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_B级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_B级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融客户_厦门_C级用户
// ----------------------------
db.getCollection("金融客户_厦门_C级用户").drop();
db.createCollection("金融客户_厦门_C级用户");
db.getCollection("金融客户_厦门_C级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_C级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_C级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融客户_厦门_D级用户
// ----------------------------
db.getCollection("金融客户_厦门_D级用户").drop();
db.createCollection("金融客户_厦门_D级用户");
db.getCollection("金融客户_厦门_D级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_D级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_D级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融客户_厦门_E级用户
// ----------------------------
db.getCollection("金融客户_厦门_E级用户").drop();
db.createCollection("金融客户_厦门_E级用户");
db.getCollection("金融客户_厦门_E级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_E级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_E级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融客户_厦门_S级用户
// ----------------------------
db.getCollection("金融客户_厦门_S级用户").drop();
db.createCollection("金融客户_厦门_S级用户");
db.getCollection("金融客户_厦门_S级用户").createIndex({
total_score: NumberInt("1")
}, {
name: "total_score_1",
background: true
});
db.getCollection("金融客户_厦门_S级用户").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1",
background: true
});
db.getCollection("金融客户_厦门_S级用户").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1",
background: true
});
// ----------------------------
// Collection structure for 金融组02250905
// ----------------------------
db.getCollection("金融组02250905").drop();
db.createCollection("金融组02250905");
db.getCollection("金融组02250905").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1"
});
db.getCollection("金融组02250905").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1"
});
db.getCollection("金融组02250905").createIndex({
"身份证": NumberInt("1")
}, {
name: "身份证_1"
});
db.getCollection("金融组02250905").createIndex({
"综合评分": NumberInt("-1")
}, {
name: "综合评分_-1"
});
db.getCollection("金融组02250905").createIndex({
"用户等级": NumberInt("1")
}, {
name: "用户等级_1"
});
db.getCollection("金融组02250905").createIndex({
"城市": NumberInt("1")
}, {
name: "城市_1"
});

509
Moncter/数据库/KR_KR.js Normal file
View File

@@ -0,0 +1,509 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_KR
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:19
*/
// ----------------------------
// Collection structure for 34万HR人力资源经理企业1
// ----------------------------
db.getCollection("34万HR人力资源经理企业1").drop();
db.createCollection("34万HR人力资源经理企业1");
db.getCollection("34万HR人力资源经理企业1").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("34万HR人力资源经理企业1").createIndex({
"电话": NumberInt("1")
}, {
name: "电话_1"
});
// ----------------------------
// Collection structure for 34万HR人力资源经理企业3
// ----------------------------
db.getCollection("34万HR人力资源经理企业3").drop();
db.createCollection("34万HR人力资源经理企业3");
db.getCollection("34万HR人力资源经理企业3").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 34万HR人力资源经理企业4
// ----------------------------
db.getCollection("34万HR人力资源经理企业4").drop();
db.createCollection("34万HR人力资源经理企业4");
db.getCollection("34万HR人力资源经理企业4").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 34万HR人力资源经理企业5
// ----------------------------
db.getCollection("34万HR人力资源经理企业5").drop();
db.createCollection("34万HR人力资源经理企业5");
db.getCollection("34万HR人力资源经理企业5").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 51JOB
// ----------------------------
db.getCollection("51JOB").drop();
db.createCollection("51JOB");
// ----------------------------
// Collection structure for 8万条借款数据
// ----------------------------
db.getCollection("8万条借款数据").drop();
db.createCollection("8万条借款数据");
db.getCollection("8万条借款数据").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for CSDN用户数据
// ----------------------------
db.getCollection("CSDN用户数据").drop();
db.createCollection("CSDN用户数据");
db.getCollection("CSDN用户数据").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("CSDN用户数据").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("CSDN用户数据").createIndex({
domain: NumberInt("1")
}, {
name: "domain_1"
});
db.getCollection("CSDN用户数据").createIndex({
created_at: NumberInt("-1")
}, {
name: "created_at_-1"
});
db.getCollection("CSDN用户数据").createIndex({
data_source: NumberInt("1")
}, {
name: "data_source_1"
});
db.getCollection("CSDN用户数据").createIndex({
username: NumberInt("1"),
email: NumberInt("1")
}, {
name: "username_1_email_1",
unique: true
});
// ----------------------------
// Collection structure for Sheet2
// ----------------------------
db.getCollection("Sheet2").drop();
db.createCollection("Sheet2");
db.getCollection("Sheet2").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for pw_members
// ----------------------------
db.getCollection("pw_members").drop();
db.createCollection("pw_members");
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for www.jfclub.com
// ----------------------------
db.getCollection("www.jfclub.com").drop();
db.createCollection("www.jfclub.com");
db.getCollection("www.jfclub.com").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("www.jfclub.com").createIndex({
u_id: NumberInt("1")
}, {
name: "u_id_1"
});
db.getCollection("www.jfclub.com").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("www.jfclub.com").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("www.jfclub.com").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("www.jfclub.com").createIndex({
email: NumberInt("1"),
name: NumberInt("1")
}, {
name: "email_1_name_1"
});
db.getCollection("www.jfclub.com").createIndex({
phone: NumberInt("1"),
name: NumberInt("1")
}, {
name: "phone_1_name_1"
});
// ----------------------------
// Collection structure for 人人网用户数据
// ----------------------------
db.getCollection("人人网用户数据").drop();
db.createCollection("人人网用户数据");
// ----------------------------
// Collection structure for 借贷
// ----------------------------
db.getCollection("借贷").drop();
db.createCollection("借贷");
// ----------------------------
// Collection structure for 全国车主数据集_2020年
// ----------------------------
db.getCollection("全国车主数据集_2020年").drop();
db.createCollection("全国车主数据集_2020年");
// ----------------------------
// Collection structure for 北京本科
// ----------------------------
db.getCollection("北京本科").drop();
db.createCollection("北京本科");
db.getCollection("北京本科").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 千脑云电脑_qiannao_com
// ----------------------------
db.getCollection("千脑云电脑_qiannao_com").drop();
db.createCollection("千脑云电脑_qiannao_com");
db.getCollection("千脑云电脑_qiannao_com").createIndex({
"用户名": NumberInt("1")
}, {
name: "用户名_1"
});
db.getCollection("千脑云电脑_qiannao_com").createIndex({
"邮箱": NumberInt("1")
}, {
name: "邮箱_1"
});
db.getCollection("千脑云电脑_qiannao_com").createIndex({
"用户ID": NumberInt("1")
}, {
name: "用户ID_1"
});
db.getCollection("千脑云电脑_qiannao_com").createIndex({
"创建时间": NumberInt("1")
}, {
name: "创建时间_1"
});
// ----------------------------
// Collection structure for 天涯论坛tianya.cn
// ----------------------------
db.getCollection("天涯论坛tianya.cn").drop();
db.createCollection("天涯论坛tianya.cn");
// ----------------------------
// Collection structure for 情感
// ----------------------------
db.getCollection("情感").drop();
db.createCollection("情感");
db.getCollection("情感").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("情感").createIndex({
"手机": NumberInt("1")
}, {
name: "手机_1"
});
// ----------------------------
// Collection structure for 慈溪人才网
// ----------------------------
db.getCollection("慈溪人才网").drop();
db.createCollection("慈溪人才网");
// ----------------------------
// Collection structure for 房产网
// ----------------------------
db.getCollection("房产网").drop();
db.createCollection("房产网");
db.getCollection("房产网").createIndex({
uid: NumberInt("1")
}, {
name: "uid_1",
unique: true
});
db.getCollection("房产网").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("房产网").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("房产网").createIndex({
regdate: NumberInt("1")
}, {
name: "regdate_1"
});
// ----------------------------
// Collection structure for 抖音直播粉
// ----------------------------
db.getCollection("抖音直播粉").drop();
db.createCollection("抖音直播粉");
db.getCollection("抖音直播粉").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("抖音直播粉").createIndex({
Uid: NumberInt("1")
}, {
name: "Uid_1"
});
db.getCollection("抖音直播粉").createIndex({
sec_uid: NumberInt("1")
}, {
name: "sec_uid_1"
});
// ----------------------------
// Collection structure for 收藏品微信好友
// ----------------------------
db.getCollection("收藏品微信好友").drop();
db.createCollection("收藏品微信好友");
db.getCollection("收藏品微信好友").createIndex({
WechatId: NumberInt("1")
}, {
name: "IX_Kefure_WechatFriend_WechatId"
});
db.getCollection("收藏品微信好友").createIndex({
OwnerWechatId: NumberInt("1")
}, {
name: "IX_Kefure_WechatFriend_OwnerWechatId"
});
db.getCollection("收藏品微信好友").createIndex({
Phone: NumberInt("1")
}, {
name: "Phone_1"
});
// ----------------------------
// Collection structure for 收藏品用户
// ----------------------------
db.getCollection("收藏品用户").drop();
db.createCollection("收藏品用户");
db.getCollection("收藏品用户").createIndex({
Id: NumberInt("1")
}, {
name: "Id_1"
});
db.getCollection("收藏品用户").createIndex({
WechatAccountId: NumberInt("1")
}, {
name: "WechatAccountId_1"
});
db.getCollection("收藏品用户").createIndex({
WechatId: NumberInt("1")
}, {
name: "WechatId_1"
});
db.getCollection("收藏品用户").createIndex({
AccountId: NumberInt("1")
}, {
name: "AccountId_1"
});
db.getCollection("收藏品用户").createIndex({
OwnerWechatId: NumberInt("1")
}, {
name: "OwnerWechatId_1"
});
db.getCollection("收藏品用户").createIndex({
GroupId: NumberInt("1")
}, {
name: "GroupId_1"
});
db.getCollection("收藏品用户").createIndex({
Nickname: NumberInt("1")
}, {
name: "Nickname_1"
});
db.getCollection("收藏品用户").createIndex({
AccountNickname: NumberInt("1")
}, {
name: "AccountNickname_1"
});
db.getCollection("收藏品用户").createIndex({
OwnerNickname: NumberInt("1")
}, {
name: "OwnerNickname_1"
});
// ----------------------------
// Collection structure for 木蚂蚁munayi_com
// ----------------------------
db.getCollection("木蚂蚁munayi_com").drop();
db.createCollection("木蚂蚁munayi_com");
db.getCollection("木蚂蚁munayi_com").createIndex({
username: NumberInt("1")
}, {
name: "username_1",
unique: true,
sparse: true
});
db.getCollection("木蚂蚁munayi_com").createIndex({
email: NumberInt("1")
}, {
name: "email_1",
sparse: true
});
db.getCollection("木蚂蚁munayi_com").createIndex({
uid: NumberInt("1")
}, {
name: "uid_1",
sparse: true
});
db.getCollection("木蚂蚁munayi_com").createIndex({
data_hash: NumberInt("1")
}, {
name: "data_hash_1",
unique: true,
sparse: true
});
// ----------------------------
// Collection structure for 狂人影子库user
// ----------------------------
db.getCollection("狂人影子库user").drop();
db.createCollection("狂人影子库user");
// ----------------------------
// Collection structure for 珍爱网
// ----------------------------
db.getCollection("珍爱网").drop();
db.createCollection("珍爱网");
db.getCollection("珍爱网").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 用户身份凭证数据集
// ----------------------------
db.getCollection("用户身份凭证数据集").drop();
db.createCollection("用户身份凭证数据集");
// ----------------------------
// Collection structure for 网红库
// ----------------------------
db.getCollection("网红库").drop();
db.createCollection("网红库");
db.getCollection("网红库").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("网红库").createIndex({
sec_uid: NumberInt("1")
}, {
name: "sec_uid_1"
});
db.getCollection("网红库").createIndex({
idcard: NumberInt("1")
}, {
name: "idcard_1"
});
db.getCollection("网红库").createIndex({
collectId: NumberInt("1")
}, {
name: "collectId_1"
});
db.getCollection("网红库").createIndex({
cateId: NumberInt("1")
}, {
name: "cateId_1"
});
db.getCollection("网红库").createIndex({
authorId: NumberInt("1")
}, {
name: "authorId_1"
});
db.getCollection("网红库").createIndex({
uniqueId: NumberInt("1")
}, {
name: "uniqueId_1"
});
db.getCollection("网红库").createIndex({
phoneNumber: NumberInt("1")
}, {
name: "phoneNumber_1"
});
db.getCollection("网红库").createIndex({
nickname: NumberInt("1")
}, {
name: "nickname_1"
});
db.getCollection("网红库").createIndex({
updatedAt: NumberInt("1")
}, {
name: "updatedAt_1"
});
// ----------------------------
// Collection structure for 雅虎用户
// ----------------------------
db.getCollection("雅虎用户").drop();
db.createCollection("雅虎用户");

View File

@@ -0,0 +1,31 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_Linkedln
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:28
*/
// ----------------------------
// Collection structure for linkedin
// ----------------------------
db.getCollection("linkedin").drop();
db.createCollection("linkedin");
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});

View File

@@ -0,0 +1,31 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_京东
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:11
*/
// ----------------------------
// Collection structure for jd_com
// ----------------------------
db.getCollection("jd_com").drop();
db.createCollection("jd_com");
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});

View File

@@ -0,0 +1,37 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_人才库
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:59
*/
// ----------------------------
// Collection structure for 51JOB
// ----------------------------
db.getCollection("51JOB").drop();
db.createCollection("51JOB");
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 慈溪人才网
// ----------------------------
db.getCollection("慈溪人才网").drop();
db.createCollection("慈溪人才网");

View File

@@ -0,0 +1,142 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_企业
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:44
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 企业400号段数据
// ----------------------------
db.getCollection("企业400号段数据").drop();
db.createCollection("企业400号段数据");
db.getCollection("企业400号段数据").createIndex({
ID: NumberInt("1")
}, {
name: "ID_1"
});
db.getCollection("企业400号段数据").createIndex({
"企业名称": NumberInt("1")
}, {
name: "企业名称_1"
});
db.getCollection("企业400号段数据").createIndex({
"400号码": NumberInt("1")
}, {
name: "400号码_1"
});
db.getCollection("企业400号段数据").createIndex({
"联系人": NumberInt("1")
}, {
name: "联系人_1"
});
db.getCollection("企业400号段数据").createIndex({
"手机号码": NumberInt("1")
}, {
name: "手机号码_1"
});
db.getCollection("企业400号段数据").createIndex({
"表名": NumberInt("1")
}, {
name: "表名_1"
});
db.getCollection("企业400号段数据").createIndex({
"导入时间": NumberInt("-1")
}, {
name: "导入时间_-1"
});
db.getCollection("企业400号段数据").createIndex({
nid: NumberInt("1")
}, {
name: "nid_1"
});
db.getCollection("企业400号段数据").createIndex({
EnterpriseName: NumberInt("1")
}, {
name: "EnterpriseName_1"
});
db.getCollection("企业400号段数据").createIndex({
Number400: NumberInt("1")
}, {
name: "Number400_1"
});
db.getCollection("企业400号段数据").createIndex({
LinkMan: NumberInt("1")
}, {
name: "LinkMan_1"
});
db.getCollection("企业400号段数据").createIndex({
Mobile: NumberInt("1")
}, {
name: "Mobile_1"
});
// ----------------------------
// Collection structure for 统一用户资产表
// ----------------------------
db.getCollection("统一用户资产表").drop();
db.createCollection("统一用户资产表");
db.getCollection("统一用户资产表").createIndex({
"用户唯一ID": NumberInt("1")
}, {
name: "用户唯一ID_1"
});
db.getCollection("统一用户资产表").createIndex({
"基础信息.手机号": NumberInt("1")
}, {
name: "基础信息.手机号_1"
});
db.getCollection("统一用户资产表").createIndex({
"基础信息.邮箱": NumberInt("1")
}, {
name: "基础信息.邮箱_1"
});
db.getCollection("统一用户资产表").createIndex({
"企业信息.企业ID": NumberInt("1")
}, {
name: "企业信息.企业ID_1"
});
db.getCollection("统一用户资产表").createIndex({
"企业信息.400号码": NumberInt("1")
}, {
name: "企业信息.400号码_1"
});
db.getCollection("统一用户资产表").createIndex({
"资产概览.总资产价值": NumberInt("-1")
}, {
name: "资产概览.总资产价值_-1"
});
db.getCollection("统一用户资产表").createIndex({
"资产概览.资产等级": NumberInt("1")
}, {
name: "资产概览.资产等级_1"
});
db.getCollection("统一用户资产表").createIndex({
"用户类型": NumberInt("1")
}, {
name: "用户类型_1"
});
db.getCollection("统一用户资产表").createIndex({
"创建时间": NumberInt("-1")
}, {
name: "创建时间_-1"
});

View File

@@ -0,0 +1,115 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_企业名录
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:51
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 中国医院名录_copy1
// ----------------------------
db.getCollection("中国医院名录_copy1").drop();
db.createCollection("中国医院名录_copy1");
// ----------------------------
// Collection structure for 企业及个体工商目录
// ----------------------------
db.getCollection("企业及个体工商目录").drop();
db.createCollection("企业及个体工商目录");
// ----------------------------
// Collection structure for 企业名录
// ----------------------------
db.getCollection("企业名录").drop();
db.createCollection("企业名录");
// ----------------------------
// Collection structure for 四川企业老板
// ----------------------------
db.getCollection("四川企业老板").drop();
db.createCollection("四川企业老板");
// ----------------------------
// Collection structure for 广东工商企业库1
// ----------------------------
db.getCollection("广东工商企业库1").drop();
db.createCollection("广东工商企业库1");
// ----------------------------
// Collection structure for 广东工商企业库2
// ----------------------------
db.getCollection("广东工商企业库2").drop();
db.createCollection("广东工商企业库2");
// ----------------------------
// Collection structure for 广东工商企业库3
// ----------------------------
db.getCollection("广东工商企业库3").drop();
db.createCollection("广东工商企业库3");
// ----------------------------
// Collection structure for 广东工商企业库4
// ----------------------------
db.getCollection("广东工商企业库4").drop();
db.createCollection("广东工商企业库4");
// ----------------------------
// Collection structure for 广东工商企业库5
// ----------------------------
db.getCollection("广东工商企业库5").drop();
db.createCollection("广东工商企业库5");
// ----------------------------
// Collection structure for 广东工商企业库6
// ----------------------------
db.getCollection("广东工商企业库6").drop();
db.createCollection("广东工商企业库6");
// ----------------------------
// Collection structure for 广东工商企业库7
// ----------------------------
db.getCollection("广东工商企业库7").drop();
db.createCollection("广东工商企业库7");
// ----------------------------
// Collection structure for 行政区划代码
// ----------------------------
db.getCollection("行政区划代码").drop();
db.createCollection("行政区划代码");
// ----------------------------
// Collection structure for 表1
// ----------------------------
db.getCollection("表1").drop();
db.createCollection("表1");
// ----------------------------
// Collection structure for 表2
// ----------------------------
db.getCollection("表2").drop();
db.createCollection("表2");
// ----------------------------
// Collection structure for 销售额3000万元-5000万元企业名录
// ----------------------------
db.getCollection("销售额3000万元-5000万元企业名录").drop();
db.createCollection("销售额3000万元-5000万元企业名录");

View File

@@ -0,0 +1,228 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_卡若私域
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:24
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 存客宝流量池分类
// ----------------------------
db.getCollection("存客宝流量池分类").drop();
db.createCollection("存客宝流量池分类");
db.getCollection("存客宝流量池分类").createIndex({
province: NumberInt("1"),
wechat: NumberInt("1"),
phoneNumber: NumberInt("1"),
createdAt: NumberInt("1")
}, {
name: "user_province_wechat_phone_number_created_at"
});
db.getCollection("存客宝流量池分类").createIndex({
province: NumberInt("1"),
wechat: NumberInt("1"),
phoneNumber: NumberInt("1"),
wechatIsOpen: NumberInt("1"),
createdAt: NumberInt("1")
}, {
name: "user_province_wechat_phone_number_wechat_is_open_created_at"
});
// ----------------------------
// Collection structure for 存客宝流量池分类2
// ----------------------------
db.getCollection("存客宝流量池分类2").drop();
db.createCollection("存客宝流量池分类2");
db.getCollection("存客宝流量池分类2").createIndex({
source: NumberInt("1"),
wechat: NumberInt("1")
}, {
name: "user_source_wechat",
unique: true
});
db.getCollection("存客宝流量池分类2").createIndex({
source: NumberInt("1"),
phoneNumber: NumberInt("1")
}, {
name: "user_source_phone_number",
unique: true
});
db.getCollection("存客宝流量池分类2").createIndex({
province: NumberInt("1")
}, {
name: "user_province"
});
db.getCollection("存客宝流量池分类2").createIndex({
wechat: NumberInt("1")
}, {
name: "user_wechat"
});
db.getCollection("存客宝流量池分类2").createIndex({
phoneNumber: NumberInt("1")
}, {
name: "user_phone_number"
});
db.getCollection("存客宝流量池分类2").createIndex({
wechatIsOpen: NumberInt("1")
}, {
name: "user_wechat_is_open"
});
db.getCollection("存客宝流量池分类2").createIndex({
createdAt: NumberInt("1")
}, {
name: "user_created_at"
});
db.getCollection("存客宝流量池分类2").createIndex({
jdIsOpen: NumberInt("1")
}, {
name: "user_jd_is_open"
});
// ----------------------------
// Collection structure for 存客宝采集网红
// ----------------------------
db.getCollection("存客宝采集网红").drop();
db.createCollection("存客宝采集网红");
db.getCollection("存客宝采集网红").createIndex({
OwnerWechatId: NumberInt("1"),
Phone: NumberInt("1"),
Alias: NumberInt("1")
}, {
name: "IX_Kefure_WechatFriend_OwnerWechatId"
});
db.getCollection("存客宝采集网红").createIndex({
WechatId: NumberInt("1"),
IsSend: NumberInt("1"),
IsDeleted: NumberInt("1"),
Gender: NumberInt("1"),
Nickname: NumberInt("1")
}, {
name: "IX_Kefure_WechatFriend_WechatId_IsSend"
});
db.getCollection("存客宝采集网红").createIndex({
WechatAccountId: NumberInt("1")
}, {
name: "WechatAccountId"
});
// ----------------------------
// Collection structure for 存客宝采集网红有微信
// ----------------------------
db.getCollection("存客宝采集网红有微信").drop();
db.createCollection("存客宝采集网红有微信");
// ----------------------------
// Collection structure for 老坑爹商店 shop.lkdie.com
// ----------------------------
db.getCollection("老坑爹商店 shop.lkdie.com").drop();
db.createCollection("老坑爹商店 shop.lkdie.com");
db.getCollection("老坑爹商店 shop.lkdie.com").createIndex({
email: NumberInt("1")
}, {
name: "email",
unique: true
});
db.getCollection("老坑爹商店 shop.lkdie.com").createIndex({
nickname: NumberInt("1")
}, {
name: "nickname",
unique: true
});
db.getCollection("老坑爹商店 shop.lkdie.com").createIndex({
updatedTime: NumberInt("1")
}, {
name: "updatedTime"
});
// ----------------------------
// Collection structure for 老坑爹论坛www.lkdie.com 会员
// ----------------------------
db.getCollection("老坑爹论坛www.lkdie.com 会员").drop();
db.createCollection("老坑爹论坛www.lkdie.com 会员");
db.getCollection("老坑爹论坛www.lkdie.com 会员").createIndex({
username: NumberInt("1")
}, {
name: "username",
unique: true
});
db.getCollection("老坑爹论坛www.lkdie.com 会员").createIndex({
email: NumberInt("1")
}, {
name: "email"
});
// ----------------------------
// Collection structure for 黑科技www.quwanzhi.com 付款邮箱
// ----------------------------
db.getCollection("黑科技www.quwanzhi.com 付款邮箱").drop();
db.createCollection("黑科技www.quwanzhi.com 付款邮箱");
db.getCollection("黑科技www.quwanzhi.com 付款邮箱").createIndex({
trade_no: NumberInt("1")
}, {
name: "tradeNo"
});
db.getCollection("黑科技www.quwanzhi.com 付款邮箱").createIndex({
zid: NumberInt("1")
}, {
name: "zid"
});
db.getCollection("黑科技www.quwanzhi.com 付款邮箱").createIndex({
tid: NumberInt("1")
}, {
name: "tid"
});
// ----------------------------
// Collection structure for 黑科技www.quwanzhi.com 发卡邮箱
// ----------------------------
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").drop();
db.createCollection("黑科技www.quwanzhi.com 发卡邮箱");
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
zid: NumberInt("1")
}, {
name: "zid"
});
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
input: NumberInt("1")
}, {
name: "input"
});
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
userid: NumberInt("1")
}, {
name: "userid"
});
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
tradeno: NumberInt("1")
}, {
name: "tradeno"
});
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
id: NumberInt("1")
}, {
name: "id"
});
db.getCollection("黑科技www.quwanzhi.com 发卡邮箱").createIndex({
tid: NumberInt("1")
}, {
name: "tid"
});

View File

@@ -0,0 +1,122 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_商城
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:13
*/
// ----------------------------
// Collection structure for 21年贝蒂喜订单整合
// ----------------------------
db.getCollection("21年贝蒂喜订单整合").drop();
db.createCollection("21年贝蒂喜订单整合");
db.getCollection("21年贝蒂喜订单整合").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"特权订金订单id": NumberInt("1")
}, {
name: "特权订金订单id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"新零售导购门店id": NumberInt("1")
}, {
name: "新零售导购门店id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"新零售发货门店id": NumberInt("1")
}, {
name: "新零售发货门店id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"新零售成交门店id": NumberInt("1")
}, {
name: "新零售成交门店id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"新零售成交经销商id": NumberInt("1")
}, {
name: "新零售成交经销商id_1"
});
db.getCollection("21年贝蒂喜订单整合").createIndex({
"店铺Id": NumberInt("1")
}, {
name: "店铺Id_1"
});
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 凡客诚品_vancl.com
// ----------------------------
db.getCollection("凡客诚品_vancl.com").drop();
db.createCollection("凡客诚品_vancl.com");
db.getCollection("凡客诚品_vancl.com").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("凡客诚品_vancl.com").createIndex({
"数据来源": NumberInt("1"),
"导入时间": NumberInt("-1")
}, {
name: "数据来源_1_导入时间_-1"
});
// ----------------------------
// Collection structure for 嘟嘟牛
// ----------------------------
db.getCollection("嘟嘟牛").drop();
db.createCollection("嘟嘟牛");
// ----------------------------
// Collection structure for 嘟嘟牛 本地同城
// ----------------------------
db.getCollection("嘟嘟牛 本地同城").drop();
db.createCollection("嘟嘟牛 本地同城");
db.getCollection("嘟嘟牛 本地同城").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("嘟嘟牛 本地同城").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
// ----------------------------
// Collection structure for 小米 xiaomi_com
// ----------------------------
db.getCollection("小米 xiaomi_com").drop();
db.createCollection("小米 xiaomi_com");
// ----------------------------
// Collection structure for 购物-北京一电购公司2月整理版30万
// ----------------------------
db.getCollection("购物-北京一电购公司2月整理版30万").drop();
db.createCollection("购物-北京一电购公司2月整理版30万");
db.getCollection("购物-北京一电购公司2月整理版30万").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});

View File

@@ -0,0 +1,359 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_国外
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:56
*/
// ----------------------------
// Collection structure for Yandex俄罗斯百度用户数据
// ----------------------------
db.getCollection("Yandex俄罗斯百度用户数据").drop();
db.createCollection("Yandex俄罗斯百度用户数据");
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
domain: NumberInt("1")
}, {
name: "domain_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
password_strength: NumberInt("1")
}, {
name: "password_strength_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
country: NumberInt("1")
}, {
name: "country_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
service_provider: NumberInt("1")
}, {
name: "service_provider_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
created_at: NumberInt("-1")
}, {
name: "created_at_-1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
data_source: NumberInt("1")
}, {
name: "data_source_1"
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
email: NumberInt("1"),
password: NumberInt("1")
}, {
name: "email_password_unique",
unique: true
});
db.getCollection("Yandex俄罗斯百度用户数据").createIndex({
"$**": "text"
}, {
name: "text_search",
weights: {
email: NumberInt("1"),
username: NumberInt("1")
},
default_language: "english",
language_override: "language",
textIndexVersion: NumberInt("3")
});
// ----------------------------
// Collection structure for Yandex俄罗斯谷歌用户数据
// ----------------------------
db.getCollection("Yandex俄罗斯谷歌用户数据").drop();
db.createCollection("Yandex俄罗斯谷歌用户数据");
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
domain: NumberInt("1")
}, {
name: "domain_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
password_strength: NumberInt("1")
}, {
name: "password_strength_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
country: NumberInt("1")
}, {
name: "country_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
service_provider: NumberInt("1")
}, {
name: "service_provider_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
created_at: NumberInt("-1")
}, {
name: "created_at_-1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
data_source: NumberInt("1")
}, {
name: "data_source_1"
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
email: NumberInt("1"),
password: NumberInt("1")
}, {
name: "email_password_unique",
unique: true
});
db.getCollection("Yandex俄罗斯谷歌用户数据").createIndex({
"$**": "text"
}, {
name: "text_search",
weights: {
email: NumberInt("1"),
username: NumberInt("1")
},
default_language: "english",
language_override: "language",
textIndexVersion: NumberInt("3")
});
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for www.angeldiet.co.kr 1
// ----------------------------
db.getCollection("www.angeldiet.co.kr 1").drop();
db.createCollection("www.angeldiet.co.kr 1");
db.getCollection("www.angeldiet.co.kr 1").createIndex({
ID: NumberInt("1")
}, {
name: "ID_1"
});
// ----------------------------
// Collection structure for www.angeldiet.co.kr 2
// ----------------------------
db.getCollection("www.angeldiet.co.kr 2").drop();
db.createCollection("www.angeldiet.co.kr 2");
db.getCollection("www.angeldiet.co.kr 2").createIndex({
ID: NumberInt("1")
}, {
name: "ID_1"
});
// ----------------------------
// Collection structure for www.bookoa.com韩国学术出版
// ----------------------------
db.getCollection("www.bookoa.com韩国学术出版").drop();
db.createCollection("www.bookoa.com韩国学术出版");
db.getCollection("www.bookoa.com韩国学术出版").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("www.bookoa.com韩国学术出版").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("www.bookoa.com韩国学术出版").createIndex({
hphone: NumberInt("1")
}, {
name: "hphone_1"
});
db.getCollection("www.bookoa.com韩国学术出版").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("www.bookoa.com韩国学术出版").createIndex({
email: NumberInt("1"),
name: NumberInt("1")
}, {
name: "email_1_name_1"
});
// ----------------------------
// Collection structure for 卡塔卡银行_APP数据
// ----------------------------
db.getCollection("卡塔卡银行_APP数据").drop();
db.createCollection("卡塔卡银行_APP数据");
// ----------------------------
// Collection structure for 卡塔卡银行_交易明细
// ----------------------------
db.getCollection("卡塔卡银行_交易明细").drop();
db.createCollection("卡塔卡银行_交易明细");
// ----------------------------
// Collection structure for 卡塔卡银行_交易明细临时
// ----------------------------
db.getCollection("卡塔卡银行_交易明细临时").drop();
db.createCollection("卡塔卡银行_交易明细临时");
// ----------------------------
// Collection structure for 卡塔卡银行_卡主表
// ----------------------------
db.getCollection("卡塔卡银行_卡主表").drop();
db.createCollection("卡塔卡银行_卡主表");
// ----------------------------
// Collection structure for 卡塔卡银行_卡列表
// ----------------------------
db.getCollection("卡塔卡银行_卡列表").drop();
db.createCollection("卡塔卡银行_卡列表");
// ----------------------------
// Collection structure for 卡塔卡银行_审计主表
// ----------------------------
db.getCollection("卡塔卡银行_审计主表").drop();
db.createCollection("卡塔卡银行_审计主表");
// ----------------------------
// Collection structure for 卡塔卡银行_客户
// ----------------------------
db.getCollection("卡塔卡银行_客户").drop();
db.createCollection("卡塔卡银行_客户");
// ----------------------------
// Collection structure for 卡塔卡银行_客户主表
// ----------------------------
db.getCollection("卡塔卡银行_客户主表").drop();
db.createCollection("卡塔卡银行_客户主表");
// ----------------------------
// Collection structure for 卡塔卡银行_收款人主表
// ----------------------------
db.getCollection("卡塔卡银行_收款人主表").drop();
db.createCollection("卡塔卡银行_收款人主表");
// ----------------------------
// Collection structure for 卡塔卡银行_用户档案
// ----------------------------
db.getCollection("卡塔卡银行_用户档案").drop();
db.createCollection("卡塔卡银行_用户档案");
// ----------------------------
// Collection structure for 卡塔卡银行_申请记录
// ----------------------------
db.getCollection("卡塔卡银行_申请记录").drop();
db.createCollection("卡塔卡银行_申请记录");
// ----------------------------
// Collection structure for 卡塔卡银行_电子对账单邮箱
// ----------------------------
db.getCollection("卡塔卡银行_电子对账单邮箱").drop();
db.createCollection("卡塔卡银行_电子对账单邮箱");
// ----------------------------
// Collection structure for 卡塔卡银行_订单客户明细
// ----------------------------
db.getCollection("卡塔卡银行_订单客户明细").drop();
db.createCollection("卡塔卡银行_订单客户明细");
// ----------------------------
// Collection structure for 卡塔卡银行_账户主表
// ----------------------------
db.getCollection("卡塔卡银行_账户主表").drop();
db.createCollection("卡塔卡银行_账户主表");
// ----------------------------
// Collection structure for 卡塔卡银行_身份证变更审计
// ----------------------------
db.getCollection("卡塔卡银行_身份证变更审计").drop();
db.createCollection("卡塔卡银行_身份证变更审计");
// ----------------------------
// Collection structure for 卡塔卡银行_黑名单用户
// ----------------------------
db.getCollection("卡塔卡银行_黑名单用户").drop();
db.createCollection("卡塔卡银行_黑名单用户");
// ----------------------------
// Collection structure for 台湾财经电视台
// ----------------------------
db.getCollection("台湾财经电视台").drop();
db.createCollection("台湾财经电视台");
db.getCollection("台湾财经电视台").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("台湾财经电视台").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("台湾财经电视台").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("台湾财经电视台").createIndex({
source: NumberInt("1")
}, {
name: "source_1"
});
// ----------------------------
// Collection structure for 土耳其公民
// ----------------------------
db.getCollection("土耳其公民").drop();
db.createCollection("土耳其公民");
// ----------------------------
// Collection structure for 社工库_1.7G_www.comicstorm.co.kr 85w_1
// ----------------------------
db.getCollection("社工库_1.7G_www.comicstorm.co.kr 85w_1").drop();
db.createCollection("社工库_1.7G_www.comicstorm.co.kr 85w_1");
db.getCollection("社工库_1.7G_www.comicstorm.co.kr 85w_1").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for 社工库_1.7G_www.hacker.co.kr 140W_140W
// ----------------------------
db.getCollection("社工库_1.7G_www.hacker.co.kr 140W_140W").drop();
db.createCollection("社工库_1.7G_www.hacker.co.kr 140W_140W");
db.getCollection("社工库_1.7G_www.hacker.co.kr 140W_140W").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});

View File

@@ -0,0 +1,618 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_存客宝
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:41
*/
// ----------------------------
// Collection structure for cunkebao_AccountWechat
// ----------------------------
db.getCollection("cunkebao_AccountWechat").drop();
db.createCollection("cunkebao_AccountWechat");
db.getCollection("cunkebao_AccountWechat").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_DownloadVideoSchedule
// ----------------------------
db.getCollection("cunkebao_DownloadVideoSchedule").drop();
db.createCollection("cunkebao_DownloadVideoSchedule");
db.getCollection("cunkebao_DownloadVideoSchedule").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_FriendMessageTask
// ----------------------------
db.getCollection("cunkebao_FriendMessageTask").drop();
db.createCollection("cunkebao_FriendMessageTask");
db.getCollection("cunkebao_FriendMessageTask").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_FriendMessageTpl
// ----------------------------
db.getCollection("cunkebao_FriendMessageTpl").drop();
db.createCollection("cunkebao_FriendMessageTpl");
db.getCollection("cunkebao_FriendMessageTpl").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_FriendRequestConfig
// ----------------------------
db.getCollection("cunkebao_FriendRequestConfig").drop();
db.createCollection("cunkebao_FriendRequestConfig");
// ----------------------------
// Collection structure for cunkebao_FriendRequestTaskScan
// ----------------------------
db.getCollection("cunkebao_FriendRequestTaskScan").drop();
db.createCollection("cunkebao_FriendRequestTaskScan");
db.getCollection("cunkebao_FriendRequestTaskScan").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_FrontSession
// ----------------------------
db.getCollection("cunkebao_FrontSession").drop();
db.createCollection("cunkebao_FrontSession");
// ----------------------------
// Collection structure for cunkebao_JdPromotionSite
// ----------------------------
db.getCollection("cunkebao_JdPromotionSite").drop();
db.createCollection("cunkebao_JdPromotionSite");
db.getCollection("cunkebao_JdPromotionSite").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_JdSocialMedia
// ----------------------------
db.getCollection("cunkebao_JdSocialMedia").drop();
db.createCollection("cunkebao_JdSocialMedia");
db.getCollection("cunkebao_JdSocialMedia").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_MaterialLib
// ----------------------------
db.getCollection("cunkebao_MaterialLib").drop();
db.createCollection("cunkebao_MaterialLib");
db.getCollection("cunkebao_MaterialLib").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_MaterialPushLog
// ----------------------------
db.getCollection("cunkebao_MaterialPushLog").drop();
db.createCollection("cunkebao_MaterialPushLog");
db.getCollection("cunkebao_MaterialPushLog").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_MiniProgrameLib
// ----------------------------
db.getCollection("cunkebao_MiniProgrameLib").drop();
db.createCollection("cunkebao_MiniProgrameLib");
db.getCollection("cunkebao_MiniProgrameLib").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_PartTimer
// ----------------------------
db.getCollection("cunkebao_PartTimer").drop();
db.createCollection("cunkebao_PartTimer");
db.getCollection("cunkebao_PartTimer").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_Poster
// ----------------------------
db.getCollection("cunkebao_Poster").drop();
db.createCollection("cunkebao_Poster");
db.getCollection("cunkebao_Poster").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_SysAttach
// ----------------------------
db.getCollection("cunkebao_SysAttach").drop();
db.createCollection("cunkebao_SysAttach");
// ----------------------------
// Collection structure for cunkebao_SysAttach_20250228
// ----------------------------
db.getCollection("cunkebao_SysAttach_20250228").drop();
db.createCollection("cunkebao_SysAttach_20250228");
// ----------------------------
// Collection structure for cunkebao_SysAttach_copy
// ----------------------------
db.getCollection("cunkebao_SysAttach_copy").drop();
db.createCollection("cunkebao_SysAttach_copy");
// ----------------------------
// Collection structure for cunkebao_SysDataSource
// ----------------------------
db.getCollection("cunkebao_SysDataSource").drop();
db.createCollection("cunkebao_SysDataSource");
// ----------------------------
// Collection structure for cunkebao_SysModule
// ----------------------------
db.getCollection("cunkebao_SysModule").drop();
db.createCollection("cunkebao_SysModule");
// ----------------------------
// Collection structure for cunkebao_SysNavItem
// ----------------------------
db.getCollection("cunkebao_SysNavItem").drop();
db.createCollection("cunkebao_SysNavItem");
// ----------------------------
// Collection structure for cunkebao_SysObject
// ----------------------------
db.getCollection("cunkebao_SysObject").drop();
db.createCollection("cunkebao_SysObject");
// ----------------------------
// Collection structure for cunkebao_SysOperatorPermission
// ----------------------------
db.getCollection("cunkebao_SysOperatorPermission").drop();
db.createCollection("cunkebao_SysOperatorPermission");
// ----------------------------
// Collection structure for cunkebao_SysRelatedList
// ----------------------------
db.getCollection("cunkebao_SysRelatedList").drop();
db.createCollection("cunkebao_SysRelatedList");
// ----------------------------
// Collection structure for cunkebao_SysShare
// ----------------------------
db.getCollection("cunkebao_SysShare").drop();
db.createCollection("cunkebao_SysShare");
// ----------------------------
// Collection structure for cunkebao_SysSolution
// ----------------------------
db.getCollection("cunkebao_SysSolution").drop();
db.createCollection("cunkebao_SysSolution");
// ----------------------------
// Collection structure for cunkebao_SysUI
// ----------------------------
db.getCollection("cunkebao_SysUI").drop();
db.createCollection("cunkebao_SysUI");
// ----------------------------
// Collection structure for cunkebao_UserIncome
// ----------------------------
db.getCollection("cunkebao_UserIncome").drop();
db.createCollection("cunkebao_UserIncome");
db.getCollection("cunkebao_UserIncome").createIndex({
lId: NumberInt("1")
}, {
name: "lId_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_administrator_permissions
// ----------------------------
db.getCollection("cunkebao_v3_ck_administrator_permissions").drop();
db.createCollection("cunkebao_v3_ck_administrator_permissions");
db.getCollection("cunkebao_v3_ck_administrator_permissions").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_administrators
// ----------------------------
db.getCollection("cunkebao_v3_ck_administrators").drop();
db.createCollection("cunkebao_v3_ck_administrators");
db.getCollection("cunkebao_v3_ck_administrators").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_call_recording
// ----------------------------
db.getCollection("cunkebao_v3_ck_call_recording").drop();
db.createCollection("cunkebao_v3_ck_call_recording");
db.getCollection("cunkebao_v3_ck_call_recording").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_company
// ----------------------------
db.getCollection("cunkebao_v3_ck_company").drop();
db.createCollection("cunkebao_v3_ck_company");
db.getCollection("cunkebao_v3_ck_company").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_customer_acquisition_task
// ----------------------------
db.getCollection("cunkebao_v3_ck_customer_acquisition_task").drop();
db.createCollection("cunkebao_v3_ck_customer_acquisition_task");
db.getCollection("cunkebao_v3_ck_customer_acquisition_task").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_flow_package_order
// ----------------------------
db.getCollection("cunkebao_v3_ck_flow_package_order").drop();
db.createCollection("cunkebao_v3_ck_flow_package_order");
db.getCollection("cunkebao_v3_ck_flow_package_order").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_flow_usage_record
// ----------------------------
db.getCollection("cunkebao_v3_ck_flow_usage_record").drop();
db.createCollection("cunkebao_v3_ck_flow_usage_record");
db.getCollection("cunkebao_v3_ck_flow_usage_record").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_jd_promotion_site
// ----------------------------
db.getCollection("cunkebao_v3_ck_jd_promotion_site").drop();
db.createCollection("cunkebao_v3_ck_jd_promotion_site");
db.getCollection("cunkebao_v3_ck_jd_promotion_site").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_jd_social_media
// ----------------------------
db.getCollection("cunkebao_v3_ck_jd_social_media").drop();
db.createCollection("cunkebao_v3_ck_jd_social_media");
db.getCollection("cunkebao_v3_ck_jd_social_media").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_menus
// ----------------------------
db.getCollection("cunkebao_v3_ck_menus").drop();
db.createCollection("cunkebao_v3_ck_menus");
db.getCollection("cunkebao_v3_ck_menus").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_plan_scene
// ----------------------------
db.getCollection("cunkebao_v3_ck_plan_scene").drop();
db.createCollection("cunkebao_v3_ck_plan_scene");
db.getCollection("cunkebao_v3_ck_plan_scene").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_plan_tags
// ----------------------------
db.getCollection("cunkebao_v3_ck_plan_tags").drop();
db.createCollection("cunkebao_v3_ck_plan_tags");
db.getCollection("cunkebao_v3_ck_plan_tags").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_task_customer
// ----------------------------
db.getCollection("cunkebao_v3_ck_task_customer").drop();
db.createCollection("cunkebao_v3_ck_task_customer");
db.getCollection("cunkebao_v3_ck_task_customer").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_traffic_pool
// ----------------------------
db.getCollection("cunkebao_v3_ck_traffic_pool").drop();
db.createCollection("cunkebao_v3_ck_traffic_pool");
db.getCollection("cunkebao_v3_ck_traffic_pool").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_traffic_source
// ----------------------------
db.getCollection("cunkebao_v3_ck_traffic_source").drop();
db.createCollection("cunkebao_v3_ck_traffic_source");
db.getCollection("cunkebao_v3_ck_traffic_source").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_traffic_source_package
// ----------------------------
db.getCollection("cunkebao_v3_ck_traffic_source_package").drop();
db.createCollection("cunkebao_v3_ck_traffic_source_package");
db.getCollection("cunkebao_v3_ck_traffic_source_package").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_traffic_source_package_item
// ----------------------------
db.getCollection("cunkebao_v3_ck_traffic_source_package_item").drop();
db.createCollection("cunkebao_v3_ck_traffic_source_package_item");
db.getCollection("cunkebao_v3_ck_traffic_source_package_item").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_traffic_tag
// ----------------------------
db.getCollection("cunkebao_v3_ck_traffic_tag").drop();
db.createCollection("cunkebao_v3_ck_traffic_tag");
db.getCollection("cunkebao_v3_ck_traffic_tag").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_user_flow_package
// ----------------------------
db.getCollection("cunkebao_v3_ck_user_flow_package").drop();
db.createCollection("cunkebao_v3_ck_user_flow_package");
db.getCollection("cunkebao_v3_ck_user_flow_package").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_user_portrait
// ----------------------------
db.getCollection("cunkebao_v3_ck_user_portrait").drop();
db.createCollection("cunkebao_v3_ck_user_portrait");
db.getCollection("cunkebao_v3_ck_user_portrait").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_vendor_project
// ----------------------------
db.getCollection("cunkebao_v3_ck_vendor_project").drop();
db.createCollection("cunkebao_v3_ck_vendor_project");
db.getCollection("cunkebao_v3_ck_vendor_project").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_wechat_friendship
// ----------------------------
db.getCollection("cunkebao_v3_ck_wechat_friendship").drop();
db.createCollection("cunkebao_v3_ck_wechat_friendship");
db.getCollection("cunkebao_v3_ck_wechat_friendship").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_wechat_group_member
// ----------------------------
db.getCollection("cunkebao_v3_ck_wechat_group_member").drop();
db.createCollection("cunkebao_v3_ck_wechat_group_member");
db.getCollection("cunkebao_v3_ck_wechat_group_member").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_wechat_tag
// ----------------------------
db.getCollection("cunkebao_v3_ck_wechat_tag").drop();
db.createCollection("cunkebao_v3_ck_wechat_tag");
db.getCollection("cunkebao_v3_ck_wechat_tag").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_workbench
// ----------------------------
db.getCollection("cunkebao_v3_ck_workbench").drop();
db.createCollection("cunkebao_v3_ck_workbench");
db.getCollection("cunkebao_v3_ck_workbench").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_workbench_group_create_item
// ----------------------------
db.getCollection("cunkebao_v3_ck_workbench_group_create_item").drop();
db.createCollection("cunkebao_v3_ck_workbench_group_create_item");
db.getCollection("cunkebao_v3_ck_workbench_group_create_item").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_workbench_group_push
// ----------------------------
db.getCollection("cunkebao_v3_ck_workbench_group_push").drop();
db.createCollection("cunkebao_v3_ck_workbench_group_push");
db.getCollection("cunkebao_v3_ck_workbench_group_push").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_ck_workbench_group_push_item
// ----------------------------
db.getCollection("cunkebao_v3_ck_workbench_group_push_item").drop();
db.createCollection("cunkebao_v3_ck_workbench_group_push_item");
db.getCollection("cunkebao_v3_ck_workbench_group_push_item").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_s2_allot_rule
// ----------------------------
db.getCollection("cunkebao_v3_s2_allot_rule").drop();
db.createCollection("cunkebao_v3_s2_allot_rule");
db.getCollection("cunkebao_v3_s2_allot_rule").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for cunkebao_v3_s2_device_group
// ----------------------------
db.getCollection("cunkebao_v3_s2_device_group").drop();
db.createCollection("cunkebao_v3_s2_device_group");
db.getCollection("cunkebao_v3_s2_device_group").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 好友关系网络汇总表
// ----------------------------
db.getCollection("好友关系网络汇总表").drop();
db.createCollection("好友关系网络汇总表");
db.getCollection("好友关系网络汇总表").createIndex({
"用户微信ID": NumberInt("1")
}, {
name: "用户微信ID_1"
});
db.getCollection("好友关系网络汇总表").createIndex({
"好友微信ID": NumberInt("1")
}, {
name: "好友微信ID_1"
});
db.getCollection("好友关系网络汇总表").createIndex({
"关系等级": NumberInt("1")
}, {
name: "关系等级_1"
});
db.getCollection("好友关系网络汇总表").createIndex({
"RFM评分.总分": NumberInt("1")
}, {
name: "RFM评分.总分_1"
});
db.getCollection("好友关系网络汇总表").createIndex({
"关系强度评分": NumberInt("1")
}, {
name: "关系强度评分_1"
});
db.getCollection("好友关系网络汇总表").createIndex({
"公司ID": NumberInt("1")
}, {
name: "公司ID_1"
});

View File

@@ -0,0 +1,65 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_存客宝_四表重构KR_KR版
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:18:48
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 估值模式表
// ----------------------------
db.getCollection("估值模式表").drop();
db.createCollection("估值模式表");
// ----------------------------
// Collection structure for 微信号管理表
// ----------------------------
db.getCollection("微信号管理表").drop();
db.createCollection("微信号管理表");
// ----------------------------
// Collection structure for 微信好友表
// ----------------------------
db.getCollection("微信好友表").drop();
db.createCollection("微信好友表");
// ----------------------------
// Collection structure for 设备管理表
// ----------------------------
db.getCollection("设备管理表").drop();
db.createCollection("设备管理表");
db.getCollection("设备管理表").createIndex({
"设备ID": NumberInt("1")
}, {
name: "设备ID_1",
unique: true
});
db.getCollection("设备管理表").createIndex({
"用户ID": NumberInt("1")
}, {
name: "用户ID_1"
});
db.getCollection("设备管理表").createIndex({
"设备类型": NumberInt("1")
}, {
name: "设备类型_1"
});

View File

@@ -0,0 +1,36 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_微博
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:57
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 微博uid+手机
// ----------------------------
db.getCollection("微博uid+手机").drop();
db.createCollection("微博uid+手机");
db.getCollection("微博uid+手机").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});

View File

@@ -0,0 +1,90 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_快递
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:31
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for wlzhwu_jiezhang
// ----------------------------
db.getCollection("wlzhwu_jiezhang").drop();
db.createCollection("wlzhwu_jiezhang");
// ----------------------------
// Collection structure for wlzhwu_wlzhangwu
// ----------------------------
db.getCollection("wlzhwu_wlzhangwu").drop();
db.createCollection("wlzhwu_wlzhangwu");
// ----------------------------
// Collection structure for 可行路由
// ----------------------------
db.getCollection("可行路由").drop();
db.createCollection("可行路由");
db.getCollection("可行路由").createIndex({
_import_time: NumberInt("1")
}, {
name: "_import_time_1"
});
// ----------------------------
// Collection structure for 圆通_普通客户
// ----------------------------
db.getCollection("圆通_普通客户").drop();
db.createCollection("圆通_普通客户");
db.getCollection("圆通_普通客户").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("圆通_普通客户").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("圆通_普通客户").createIndex({
user_score: NumberInt("-1")
}, {
name: "user_score_-1"
});
// ----------------------------
// Collection structure for 圆通_潜在客户
// ----------------------------
db.getCollection("圆通_潜在客户").drop();
db.createCollection("圆通_潜在客户");
db.getCollection("圆通_潜在客户").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("圆通_潜在客户").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("圆通_潜在客户").createIndex({
user_score: NumberInt("-1")
}, {
name: "user_score_-1"
});

View File

@@ -0,0 +1,46 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_户口
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:03
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 户籍数据
// ----------------------------
db.getCollection("户籍数据").drop();
db.createCollection("户籍数据");
db.getCollection("户籍数据").createIndex({
"姓名": NumberInt("1")
}, {
name: "姓名_1"
});
db.getCollection("户籍数据").createIndex({
"身份证号": NumberInt("1")
}, {
name: "身份证号_1"
});
db.getCollection("户籍数据").createIndex({
"户籍地址": NumberInt("1")
}, {
name: "户籍地址_1"
});

View File

@@ -0,0 +1,186 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_手机
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:20
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for tmpgSyh4.renameCollection
// ----------------------------
db.getCollection("tmpgSyh4.renameCollection").drop();
db.createCollection("tmpgSyh4.renameCollection");
// ----------------------------
// Collection structure for 广东gd5800万神州行动感地带=广州GZBran2_copy2
// ----------------------------
db.getCollection("广东gd5800万神州行动感地带=广州GZBran2_copy2").drop();
db.createCollection("广东gd5800万神州行动感地带=广州GZBran2_copy2");
// ----------------------------
// Collection structure for 广东广州航空数据1
// ----------------------------
db.getCollection("广东广州航空数据1").drop();
db.createCollection("广东广州航空数据1");
// ----------------------------
// Collection structure for 广东广州航空数据2
// ----------------------------
db.getCollection("广东广州航空数据2").drop();
db.createCollection("广东广州航空数据2");
// ----------------------------
// Collection structure for 广东广州航空数据3
// ----------------------------
db.getCollection("广东广州航空数据3").drop();
db.createCollection("广东广州航空数据3");
// ----------------------------
// Collection structure for 广东广州航空数据4
// ----------------------------
db.getCollection("广东广州航空数据4").drop();
db.createCollection("广东广州航空数据4");
db.getCollection("广东广州航空数据4").createIndex({
"电话号码": NumberInt("1")
}, {
name: "电话号码_1"
});
// ----------------------------
// Collection structure for 广东深圳全球通女
// ----------------------------
db.getCollection("广东深圳全球通女").drop();
db.createCollection("广东深圳全球通女");
// ----------------------------
// Collection structure for 江西移动_701鹰潭
// ----------------------------
db.getCollection("江西移动_701鹰潭").drop();
db.createCollection("江西移动_701鹰潭");
// ----------------------------
// Collection structure for 江西移动_792九江
// ----------------------------
db.getCollection("江西移动_792九江").drop();
db.createCollection("江西移动_792九江");
// ----------------------------
// Collection structure for 江西移动_793上饶
// ----------------------------
db.getCollection("江西移动_793上饶").drop();
db.createCollection("江西移动_793上饶");
// ----------------------------
// Collection structure for 江西移动_798景德镇
// ----------------------------
db.getCollection("江西移动_798景德镇").drop();
db.createCollection("江西移动_798景德镇");
// ----------------------------
// Collection structure for 江西移动_799萍乡
// ----------------------------
db.getCollection("江西移动_799萍乡").drop();
db.createCollection("江西移动_799萍乡");
// ----------------------------
// Collection structure for 江西移动_上绕262万
// ----------------------------
db.getCollection("江西移动_上绕262万").drop();
db.createCollection("江西移动_上绕262万");
// ----------------------------
// Collection structure for 江西移动_九江222万
// ----------------------------
db.getCollection("江西移动_九江222万").drop();
db.createCollection("江西移动_九江222万");
// ----------------------------
// Collection structure for 江西移动_南昌368万
// ----------------------------
db.getCollection("江西移动_南昌368万").drop();
db.createCollection("江西移动_南昌368万");
// ----------------------------
// Collection structure for 江西移动_吉安206万
// ----------------------------
db.getCollection("江西移动_吉安206万").drop();
db.createCollection("江西移动_吉安206万");
// ----------------------------
// Collection structure for 江西移动_宜春230万
// ----------------------------
db.getCollection("江西移动_宜春230万").drop();
db.createCollection("江西移动_宜春230万");
// ----------------------------
// Collection structure for 江西移动_抚州143万
// ----------------------------
db.getCollection("江西移动_抚州143万").drop();
db.createCollection("江西移动_抚州143万");
// ----------------------------
// Collection structure for 江西移动_新余67万
// ----------------------------
db.getCollection("江西移动_新余67万").drop();
db.createCollection("江西移动_新余67万");
// ----------------------------
// Collection structure for 江西移动_景德镇76万
// ----------------------------
db.getCollection("江西移动_景德镇76万").drop();
db.createCollection("江西移动_景德镇76万");
// ----------------------------
// Collection structure for 江西移动_江西全球通带身份证
// ----------------------------
db.getCollection("江西移动_江西全球通带身份证").drop();
db.createCollection("江西移动_江西全球通带身份证");
// ----------------------------
// Collection structure for 江西移动_江西全球通身份证
// ----------------------------
db.getCollection("江西移动_江西全球通身份证").drop();
db.createCollection("江西移动_江西全球通身份证");
// ----------------------------
// Collection structure for 江西移动_江西全球通身份证姓名1226056
// ----------------------------
db.getCollection("江西移动_江西全球通身份证姓名1226056").drop();
db.createCollection("江西移动_江西全球通身份证姓名1226056");
// ----------------------------
// Collection structure for 江西移动_萍乡86万
// ----------------------------
db.getCollection("江西移动_萍乡86万").drop();
db.createCollection("江西移动_萍乡86万");
// ----------------------------
// Collection structure for 江西移动_赣州352万
// ----------------------------
db.getCollection("江西移动_赣州352万").drop();
db.createCollection("江西移动_赣州352万");
// ----------------------------
// Collection structure for 江西移动_鹰潭53万
// ----------------------------
db.getCollection("江西移动_鹰潭53万").drop();
db.createCollection("江西移动_鹰潭53万");

View File

@@ -0,0 +1,223 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_投资
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:51
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 上海
// ----------------------------
db.getCollection("上海").drop();
db.createCollection("上海");
// ----------------------------
// Collection structure for 云南
// ----------------------------
db.getCollection("云南").drop();
db.createCollection("云南");
// ----------------------------
// Collection structure for 内蒙古
// ----------------------------
db.getCollection("内蒙古").drop();
db.createCollection("内蒙古");
// ----------------------------
// Collection structure for 北京
// ----------------------------
db.getCollection("北京").drop();
db.createCollection("北京");
// ----------------------------
// Collection structure for 吉林
// ----------------------------
db.getCollection("吉林").drop();
db.createCollection("吉林");
// ----------------------------
// Collection structure for 商务部世界买家数据库 此数据由www_10195_com提供
// ----------------------------
db.getCollection("商务部世界买家数据库 此数据由www_10195_com提供").drop();
db.createCollection("商务部世界买家数据库 此数据由www_10195_com提供");
// ----------------------------
// Collection structure for 四川
// ----------------------------
db.getCollection("四川").drop();
db.createCollection("四川");
// ----------------------------
// Collection structure for 天津
// ----------------------------
db.getCollection("天津").drop();
db.createCollection("天津");
// ----------------------------
// Collection structure for 宁夏
// ----------------------------
db.getCollection("宁夏").drop();
db.createCollection("宁夏");
// ----------------------------
// Collection structure for 安徽
// ----------------------------
db.getCollection("安徽").drop();
db.createCollection("安徽");
// ----------------------------
// Collection structure for 山东
// ----------------------------
db.getCollection("山东").drop();
db.createCollection("山东");
// ----------------------------
// Collection structure for 山西
// ----------------------------
db.getCollection("山西").drop();
db.createCollection("山西");
// ----------------------------
// Collection structure for 广东
// ----------------------------
db.getCollection("广东").drop();
db.createCollection("广东");
// ----------------------------
// Collection structure for 广西
// ----------------------------
db.getCollection("广西").drop();
db.createCollection("广西");
// ----------------------------
// Collection structure for 新疆
// ----------------------------
db.getCollection("新疆").drop();
db.createCollection("新疆");
// ----------------------------
// Collection structure for 江苏
// ----------------------------
db.getCollection("江苏").drop();
db.createCollection("江苏");
// ----------------------------
// Collection structure for 江西
// ----------------------------
db.getCollection("江西").drop();
db.createCollection("江西");
// ----------------------------
// Collection structure for 河北
// ----------------------------
db.getCollection("河北").drop();
db.createCollection("河北");
// ----------------------------
// Collection structure for 河南
// ----------------------------
db.getCollection("河南").drop();
db.createCollection("河南");
// ----------------------------
// Collection structure for 浙江
// ----------------------------
db.getCollection("浙江").drop();
db.createCollection("浙江");
// ----------------------------
// Collection structure for 海南
// ----------------------------
db.getCollection("海南").drop();
db.createCollection("海南");
// ----------------------------
// Collection structure for 湖北
// ----------------------------
db.getCollection("湖北").drop();
db.createCollection("湖北");
// ----------------------------
// Collection structure for 湖南
// ----------------------------
db.getCollection("湖南").drop();
db.createCollection("湖南");
// ----------------------------
// Collection structure for 甘肃
// ----------------------------
db.getCollection("甘肃").drop();
db.createCollection("甘肃");
// ----------------------------
// Collection structure for 省份
// ----------------------------
db.getCollection("省份").drop();
db.createCollection("省份");
// ----------------------------
// Collection structure for 福建
// ----------------------------
db.getCollection("福建").drop();
db.createCollection("福建");
// ----------------------------
// Collection structure for 西藏
// ----------------------------
db.getCollection("西藏").drop();
db.createCollection("西藏");
// ----------------------------
// Collection structure for 贵州
// ----------------------------
db.getCollection("贵州").drop();
db.createCollection("贵州");
// ----------------------------
// Collection structure for 辽宁
// ----------------------------
db.getCollection("辽宁").drop();
db.createCollection("辽宁");
// ----------------------------
// Collection structure for 重庆
// ----------------------------
db.getCollection("重庆").drop();
db.createCollection("重庆");
// ----------------------------
// Collection structure for 陕西
// ----------------------------
db.getCollection("陕西").drop();
db.createCollection("陕西");
// ----------------------------
// Collection structure for 青海
// ----------------------------
db.getCollection("青海").drop();
db.createCollection("青海");
// ----------------------------
// Collection structure for 黑龙江
// ----------------------------
db.getCollection("黑龙江").drop();
db.createCollection("黑龙江");

View File

@@ -0,0 +1,223 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_淘宝
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:35
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for zippo1去重复后33万
// ----------------------------
db.getCollection("zippo1去重复后33万").drop();
db.createCollection("zippo1去重复后33万");
// ----------------------------
// Collection structure for zippo2
// ----------------------------
db.getCollection("zippo2").drop();
db.createCollection("zippo2");
// ----------------------------
// Collection structure for zippo3
// ----------------------------
db.getCollection("zippo3").drop();
db.createCollection("zippo3");
// ----------------------------
// Collection structure for zippo4
// ----------------------------
db.getCollection("zippo4").drop();
db.createCollection("zippo4");
// ----------------------------
// Collection structure for zippo5
// ----------------------------
db.getCollection("zippo5").drop();
db.createCollection("zippo5");
// ----------------------------
// Collection structure for 办公设备文具去重复64.5万)
// ----------------------------
db.getCollection("办公设备文具去重复64.5万)").drop();
db.createCollection("办公设备文具去重复64.5万)");
// ----------------------------
// Collection structure for 包去重复后71万
// ----------------------------
db.getCollection("包去重复后71万").drop();
db.createCollection("包去重复后71万");
// ----------------------------
// Collection structure for 卖家邮箱去重复后300万
// ----------------------------
db.getCollection("卖家邮箱去重复后300万").drop();
db.createCollection("卖家邮箱去重复后300万");
// ----------------------------
// Collection structure for 女士内衣去重复后132.6万)
// ----------------------------
db.getCollection("女士内衣去重复后132.6万)").drop();
db.createCollection("女士内衣去重复后132.6万)");
// ----------------------------
// Collection structure for 女士箱包配件去重复后34.8万)
// ----------------------------
db.getCollection("女士箱包配件去重复后34.8万)").drop();
db.createCollection("女士箱包配件去重复后34.8万)");
// ----------------------------
// Collection structure for 女装1去重复后388.6万)
// ----------------------------
db.getCollection("女装1去重复后388.6万)").drop();
db.createCollection("女装1去重复后388.6万)");
// ----------------------------
// Collection structure for 女装2去重复后83万带旺旺号及支付宝
// ----------------------------
db.getCollection("女装2去重复后83万带旺旺号及支付宝").drop();
db.createCollection("女装2去重复后83万带旺旺号及支付宝");
// ----------------------------
// Collection structure for 女鞋去重复后118.6万)
// ----------------------------
db.getCollection("女鞋去重复后118.6万)").drop();
db.createCollection("女鞋去重复后118.6万)");
// ----------------------------
// Collection structure for 家具定制代购去重复后20万
// ----------------------------
db.getCollection("家具定制代购去重复后20万").drop();
db.createCollection("家具定制代购去重复后20万");
// ----------------------------
// Collection structure for 家用电器去重复后93.5万)
// ----------------------------
db.getCollection("家用电器去重复后93.5万)").drop();
db.createCollection("家用电器去重复后93.5万)");
// ----------------------------
// Collection structure for 床上用品去重复后19万
// ----------------------------
db.getCollection("床上用品去重复后19万").drop();
db.createCollection("床上用品去重复后19万");
// ----------------------------
// Collection structure for 彩妆护肤去重复后138万
// ----------------------------
db.getCollection("彩妆护肤去重复后138万").drop();
db.createCollection("彩妆护肤去重复后138万");
// ----------------------------
// Collection structure for 成人用品避孕用品情趣内衣去重复后8万
// ----------------------------
db.getCollection("成人用品避孕用品情趣内衣去重复后8万").drop();
db.createCollection("成人用品避孕用品情趣内衣去重复后8万");
// ----------------------------
// Collection structure for 户外军品旅游机票去重复后64万
// ----------------------------
db.getCollection("户外军品旅游机票去重复后64万").drop();
db.createCollection("户外军品旅游机票去重复后64万");
// ----------------------------
// Collection structure for 手机去重复后80万
// ----------------------------
db.getCollection("手机去重复后80万").drop();
db.createCollection("手机去重复后80万");
// ----------------------------
// Collection structure for 数码相机图形冲印去重复后23.8万)
// ----------------------------
db.getCollection("数码相机图形冲印去重复后23.8万)").drop();
db.createCollection("数码相机图形冲印去重复后23.8万)");
// ----------------------------
// Collection structure for 数码配件电子元件去重复后51.6万)
// ----------------------------
db.getCollection("数码配件电子元件去重复后51.6万)").drop();
db.createCollection("数码配件电子元件去重复后51.6万)");
// ----------------------------
// Collection structure for 时尚家饰工艺品去重复后41万
// ----------------------------
db.getCollection("时尚家饰工艺品去重复后41万").drop();
db.createCollection("时尚家饰工艺品去重复后41万");
// ----------------------------
// Collection structure for 汽车配件去重复后38.6万)
// ----------------------------
db.getCollection("汽车配件去重复后38.6万)").drop();
db.createCollection("汽车配件去重复后38.6万)");
// ----------------------------
// Collection structure for 珠宝钻石翡翠去重复后44.5万)
// ----------------------------
db.getCollection("珠宝钻石翡翠去重复后44.5万)").drop();
db.createCollection("珠宝钻石翡翠去重复后44.5万)");
// ----------------------------
// Collection structure for 电脑硬件台式机网络设备去重复后20万
// ----------------------------
db.getCollection("电脑硬件台式机网络设备去重复后20万").drop();
db.createCollection("电脑硬件台式机网络设备去重复后20万");
// ----------------------------
// Collection structure for 男装去重复后216万
// ----------------------------
db.getCollection("男装去重复后216万").drop();
db.createCollection("男装去重复后216万");
// ----------------------------
// Collection structure for 童装婴儿服鞋帽去重复后52万
// ----------------------------
db.getCollection("童装婴儿服鞋帽去重复后52万").drop();
db.createCollection("童装婴儿服鞋帽去重复后52万");
// ----------------------------
// Collection structure for 笔记本去重复后32万
// ----------------------------
db.getCollection("笔记本去重复后32万").drop();
db.createCollection("笔记本去重复后32万");
// ----------------------------
// Collection structure for 网络服务电脑软件去重复后17万
// ----------------------------
db.getCollection("网络服务电脑软件去重复后17万").drop();
db.createCollection("网络服务电脑软件去重复后17万");
// ----------------------------
// Collection structure for 装潢灯具五金去重复后107万
// ----------------------------
db.getCollection("装潢灯具五金去重复后107万").drop();
db.createCollection("装潢灯具五金去重复后107万");
// ----------------------------
// Collection structure for 食品保健去重复后84.5万)
// ----------------------------
db.getCollection("食品保健去重复后84.5万)").drop();
db.createCollection("食品保健去重复后84.5万)");
// ----------------------------
// Collection structure for 饰品去重复14.7万)
// ----------------------------
db.getCollection("饰品去重复14.7万)").drop();
db.createCollection("饰品去重复14.7万)");

View File

@@ -0,0 +1,156 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_游戏
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:21:24
*/
// ----------------------------
// Collection structure for 178游戏网
// ----------------------------
db.getCollection("178游戏网").drop();
db.createCollection("178游戏网");
db.getCollection("178游戏网").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
// ----------------------------
// Collection structure for 766游戏网
// ----------------------------
db.getCollection("766游戏网").drop();
db.createCollection("766游戏网");
db.getCollection("766游戏网").createIndex({
"data.0": NumberInt("1")
}, {
name: "data.0_1"
});
// ----------------------------
// Collection structure for 7k7k小游戏
// ----------------------------
db.getCollection("7k7k小游戏").drop();
db.createCollection("7k7k小游戏");
db.getCollection("7k7k小游戏").createIndex({
account: NumberInt("1")
}, {
name: "account_1"
});
db.getCollection("7k7k小游戏").createIndex({
domain: NumberInt("1")
}, {
name: "domain_1"
});
db.getCollection("7k7k小游戏").createIndex({
account_type: NumberInt("1")
}, {
name: "account_type_1"
});
db.getCollection("7k7k小游戏").createIndex({
is_email: NumberInt("1")
}, {
name: "is_email_1"
});
// ----------------------------
// Collection structure for DNF
// ----------------------------
db.getCollection("DNF").drop();
db.createCollection("DNF");
db.getCollection("DNF").createIndex({
"data.0": NumberInt("1")
}, {
name: "data.0_1"
});
db.getCollection("DNF").createIndex({
id: NumberInt("1")
}, {
name: "id_1"
});
db.getCollection("DNF").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("DNF").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});
db.getCollection("DNF").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("DNF").createIndex({
character_name: NumberInt("1")
}, {
name: "character_name_1"
});
db.getCollection("DNF").createIndex({
server_name: NumberInt("1")
}, {
name: "server_name_1"
});
db.getCollection("DNF").createIndex({
level: NumberInt("-1")
}, {
name: "level_-1"
});
// ----------------------------
// Collection structure for KR_游戏_重叠用户
// ----------------------------
db.getCollection("KR_游戏_重叠用户").drop();
db.createCollection("KR_游戏_重叠用户");
db.getCollection("KR_游戏_重叠用户").createIndex({
user_id: NumberInt("1")
}, {
name: "user_id_1"
});
db.getCollection("KR_游戏_重叠用户").createIndex({
user_value: NumberInt("1")
}, {
name: "user_value_1"
});
db.getCollection("KR_游戏_重叠用户").createIndex({
overlap_count: NumberInt("1")
}, {
name: "overlap_count_1"
});
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 游戏语音ispeak_cn
// ----------------------------
db.getCollection("游戏语音ispeak_cn").drop();
db.createCollection("游戏语音ispeak_cn");
db.getCollection("游戏语音ispeak_cn").createIndex({
username: NumberInt("1")
}, {
name: "username_1"
});
db.getCollection("游戏语音ispeak_cn").createIndex({
email: NumberInt("1")
}, {
name: "email_1"
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,79 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_酒店
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:17
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 如家汉庭
// ----------------------------
db.getCollection("如家汉庭").drop();
db.createCollection("如家汉庭");
db.getCollection("如家汉庭").createIndex({
Mobile: NumberInt("1")
}, {
name: "Mobile_1"
});
// ----------------------------
// Collection structure for 酒店开房记录_2013年8月_2000万
// ----------------------------
db.getCollection("酒店开房记录_2013年8月_2000万").drop();
db.createCollection("酒店开房记录_2013年8月_2000万");
db.getCollection("酒店开房记录_2013年8月_2000万").createIndex({
name: NumberInt("1")
}, {
name: "name_1"
});
db.getCollection("酒店开房记录_2013年8月_2000万").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("酒店开房记录_2013年8月_2000万").createIndex({
id_card: NumberInt("1")
}, {
name: "id_card_1"
});
db.getCollection("酒店开房记录_2013年8月_2000万").createIndex({
mobile: NumberInt("1")
}, {
name: "mobile_1"
});
// ----------------------------
// Collection structure for 酒店开房记录_2013年8月_2000万内
// ----------------------------
db.getCollection("酒店开房记录_2013年8月_2000万内").drop();
db.createCollection("酒店开房记录_2013年8月_2000万内");
db.getCollection("酒店开房记录_2013年8月_2000万内").createIndex({
mobile: NumberInt("1")
}, {
name: "mobile_1"
});
// ----------------------------
// Collection structure for 酒店开房记录_2013年8月_2000万内_备份
// ----------------------------
db.getCollection("酒店开房记录_2013年8月_2000万内_备份").drop();
db.createCollection("酒店开房记录_2013年8月_2000万内_备份");

View File

@@ -0,0 +1,85 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_销售额3000万元-5000万元企业名录
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:21:17
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 企业名录 的副本
// ----------------------------
db.getCollection("企业名录 的副本").drop();
db.createCollection("企业名录 的副本");
// ----------------------------
// Collection structure for 企业规模代码
// ----------------------------
db.getCollection("企业规模代码").drop();
db.createCollection("企业规模代码");
// ----------------------------
// Collection structure for 控股情况代码
// ----------------------------
db.getCollection("控股情况代码").drop();
db.createCollection("控股情况代码");
// ----------------------------
// Collection structure for 机构类型代码
// ----------------------------
db.getCollection("机构类型代码").drop();
db.createCollection("机构类型代码");
// ----------------------------
// Collection structure for 经济类型代码
// ----------------------------
db.getCollection("经济类型代码").drop();
db.createCollection("经济类型代码");
// ----------------------------
// Collection structure for 营业收入代码
// ----------------------------
db.getCollection("营业收入代码").drop();
db.createCollection("营业收入代码");
// ----------------------------
// Collection structure for 行业代码
// ----------------------------
db.getCollection("行业代码").drop();
db.createCollection("行业代码");
// ----------------------------
// Collection structure for 行政区划代码
// ----------------------------
db.getCollection("行政区划代码").drop();
db.createCollection("行政区划代码");
// ----------------------------
// Collection structure for 销售额3000万元-5000万元企业名录
// ----------------------------
db.getCollection("销售额3000万元-5000万元企业名录").drop();
db.createCollection("销售额3000万元-5000万元企业名录");
// ----------------------------
// Collection structure for 隶属关系代码
// ----------------------------
db.getCollection("隶属关系代码").drop();
db.createCollection("隶属关系代码");

View File

@@ -0,0 +1,91 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_顺丰
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:20:28
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 顺丰快递数据
// ----------------------------
db.getCollection("顺丰快递数据").drop();
db.createCollection("顺丰快递数据");
db.getCollection("顺丰快递数据").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("顺丰快递数据").createIndex({
province: NumberInt("1")
}, {
name: "province_1"
});
db.getCollection("顺丰快递数据").createIndex({
city: NumberInt("1")
}, {
name: "city_1"
});
db.getCollection("顺丰快递数据").createIndex({
province: NumberInt("1"),
city: NumberInt("1")
}, {
name: "province_1_city_1"
});
db.getCollection("顺丰快递数据").createIndex({
phone: NumberInt("1"),
province: NumberInt("1")
}, {
name: "phone_1_province_1"
});
// ----------------------------
// Collection structure for 顺丰快递数据_tmpForCopy1
// ----------------------------
db.getCollection("顺丰快递数据_tmpForCopy1").drop();
db.createCollection("顺丰快递数据_tmpForCopy1");
db.getCollection("顺丰快递数据_tmpForCopy1").createIndex({
phone: NumberInt("1")
}, {
name: "phone_1"
});
db.getCollection("顺丰快递数据_tmpForCopy1").createIndex({
province: NumberInt("1")
}, {
name: "province_1"
});
db.getCollection("顺丰快递数据_tmpForCopy1").createIndex({
city: NumberInt("1")
}, {
name: "city_1"
});
db.getCollection("顺丰快递数据_tmpForCopy1").createIndex({
province: NumberInt("1"),
city: NumberInt("1")
}, {
name: "province_1_city_1"
});
db.getCollection("顺丰快递数据_tmpForCopy1").createIndex({
phone: NumberInt("1"),
province: NumberInt("1")
}, {
name: "phone_1_province_1"
});

View File

@@ -0,0 +1,217 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_香港在大陆投资企业名录
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:21:07
*/
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 上海
// ----------------------------
db.getCollection("上海").drop();
db.createCollection("上海");
// ----------------------------
// Collection structure for 云南
// ----------------------------
db.getCollection("云南").drop();
db.createCollection("云南");
// ----------------------------
// Collection structure for 内蒙
// ----------------------------
db.getCollection("内蒙").drop();
db.createCollection("内蒙");
// ----------------------------
// Collection structure for 北京
// ----------------------------
db.getCollection("北京").drop();
db.createCollection("北京");
// ----------------------------
// Collection structure for 吉林
// ----------------------------
db.getCollection("吉林").drop();
db.createCollection("吉林");
// ----------------------------
// Collection structure for 四川
// ----------------------------
db.getCollection("四川").drop();
db.createCollection("四川");
// ----------------------------
// Collection structure for 天津
// ----------------------------
db.getCollection("天津").drop();
db.createCollection("天津");
// ----------------------------
// Collection structure for 宁夏
// ----------------------------
db.getCollection("宁夏").drop();
db.createCollection("宁夏");
// ----------------------------
// Collection structure for 安徽
// ----------------------------
db.getCollection("安徽").drop();
db.createCollection("安徽");
// ----------------------------
// Collection structure for 山东
// ----------------------------
db.getCollection("山东").drop();
db.createCollection("山东");
// ----------------------------
// Collection structure for 山西
// ----------------------------
db.getCollection("山西").drop();
db.createCollection("山西");
// ----------------------------
// Collection structure for 广东
// ----------------------------
db.getCollection("广东").drop();
db.createCollection("广东");
// ----------------------------
// Collection structure for 广西
// ----------------------------
db.getCollection("广西").drop();
db.createCollection("广西");
// ----------------------------
// Collection structure for 新疆
// ----------------------------
db.getCollection("新疆").drop();
db.createCollection("新疆");
// ----------------------------
// Collection structure for 江苏
// ----------------------------
db.getCollection("江苏").drop();
db.createCollection("江苏");
// ----------------------------
// Collection structure for 江西
// ----------------------------
db.getCollection("江西").drop();
db.createCollection("江西");
// ----------------------------
// Collection structure for 河北
// ----------------------------
db.getCollection("河北").drop();
db.createCollection("河北");
// ----------------------------
// Collection structure for 河南
// ----------------------------
db.getCollection("河南").drop();
db.createCollection("河南");
// ----------------------------
// Collection structure for 浙江
// ----------------------------
db.getCollection("浙江").drop();
db.createCollection("浙江");
// ----------------------------
// Collection structure for 海南
// ----------------------------
db.getCollection("海南").drop();
db.createCollection("海南");
// ----------------------------
// Collection structure for 湖北
// ----------------------------
db.getCollection("湖北").drop();
db.createCollection("湖北");
// ----------------------------
// Collection structure for 湖南
// ----------------------------
db.getCollection("湖南").drop();
db.createCollection("湖南");
// ----------------------------
// Collection structure for 甘肃
// ----------------------------
db.getCollection("甘肃").drop();
db.createCollection("甘肃");
// ----------------------------
// Collection structure for 福建
// ----------------------------
db.getCollection("福建").drop();
db.createCollection("福建");
// ----------------------------
// Collection structure for 西藏
// ----------------------------
db.getCollection("西藏").drop();
db.createCollection("西藏");
// ----------------------------
// Collection structure for 贵州
// ----------------------------
db.getCollection("贵州").drop();
db.createCollection("贵州");
// ----------------------------
// Collection structure for 辽宁
// ----------------------------
db.getCollection("辽宁").drop();
db.createCollection("辽宁");
// ----------------------------
// Collection structure for 重庆
// ----------------------------
db.getCollection("重庆").drop();
db.createCollection("重庆");
// ----------------------------
// Collection structure for 陕西
// ----------------------------
db.getCollection("陕西").drop();
db.createCollection("陕西");
// ----------------------------
// Collection structure for 青海
// ----------------------------
db.getCollection("青海").drop();
db.createCollection("青海");
// ----------------------------
// Collection structure for 香港投资企业名录
// ----------------------------
db.getCollection("香港投资企业名录").drop();
db.createCollection("香港投资企业名录");
// ----------------------------
// Collection structure for 黑龙江
// ----------------------------
db.getCollection("黑龙江").drop();
db.createCollection("黑龙江");

View File

@@ -0,0 +1,103 @@
/*
Navicat Premium Data Transfer
Source Server : 标签数据库
Source Server Type : MongoDB
Source Server Version : 60025 (6.0.25)
Source Host : 192.168.2.6:27017
Source Schema : KR_魔兽世界
Target Server Type : MongoDB
Target Server Version : 60025 (6.0.25)
File Encoding : 65001
Date: 19/11/2025 15:19:37
*/
// ----------------------------
// Collection structure for elysn欧美_魔兽世界主题库
// ----------------------------
db.getCollection("elysn欧美_魔兽世界主题库").drop();
db.createCollection("elysn欧美_魔兽世界主题库");
db.getCollection("elysn欧美_魔兽世界主题库").createIndex({
"账号": NumberInt("1")
}, {
name: "账号_1"
});
db.getCollection("elysn欧美_魔兽世界主题库").createIndex({
"密码": NumberInt("1")
}, {
name: "密码_1"
});
// ----------------------------
// Collection structure for system.profile
// ----------------------------
db.getCollection("system.profile").drop();
db.createCollection("system.profile",{
capped: true,
size: 1048576
});
// ----------------------------
// Collection structure for 网易2500W密正数据
// ----------------------------
db.getCollection("网易2500W密正数据").drop();
db.createCollection("网易2500W密正数据");
db.getCollection("网易2500W密正数据").createIndex({
"账号": NumberInt("1")
}, {
name: "账号_1",
unique: true
});
// ----------------------------
// Collection structure for 网易IS_game.sohu.com邮箱占90%
// ----------------------------
db.getCollection("网易IS_game.sohu.com邮箱占90%").drop();
db.createCollection("网易IS_game.sohu.com邮箱占90%");
// ----------------------------
// Collection structure for 网易正确数据_已确认
// ----------------------------
db.getCollection("网易正确数据_已确认").drop();
db.createCollection("网易正确数据_已确认");
db.getCollection("网易正确数据_已确认").createIndex({
"账号": NumberInt("1")
}, {
name: "账号_1",
background: true,
unique: true
});
// ----------------------------
// Collection structure for 网易正确数据_空白数据
// ----------------------------
db.getCollection("网易正确数据_空白数据").drop();
db.createCollection("网易正确数据_空白数据");
db.getCollection("网易正确数据_空白数据").createIndex({
"账号": NumberInt("1")
}, {
name: "idx_account",
background: true
});
db.getCollection("网易正确数据_空白数据").createIndex({
"密码": NumberInt("1")
}, {
name: "idx_password",
background: true
});
db.getCollection("网易正确数据_空白数据").createIndex({
"账号": NumberInt("1"),
"密码": NumberInt("1")
}, {
name: "idx_account_password",
background: true
});
// ----------------------------
// Collection structure for 魔兽世界_3月库
// ----------------------------
db.getCollection("魔兽世界_3月库").drop();
db.createCollection("魔兽世界_3月库");

View File

@@ -74,7 +74,7 @@ class PostTransferFriends extends BaseController
$taskId = Db::name('customer_acquisition_task')->insertGetId([
'name' => '迁移好友('. $wechat['nickname'] .'',
'sceneId' => 1,
'sceneId' => 10,
'sceneConf' => json_encode($sceneConf),
'reqConf' => json_encode($reqConf),
'tagConf' => json_encode([]),

View File

@@ -18,11 +18,11 @@ export interface DataProcessingParams {
/**
* 群消息
*/
chatroomMessage?: string[];
chatroomMessage?: any[];
/**
* 个人信息
*/
friendMessage?: string[];
friendMessage?: any[];
/**
* 类型固定值
*/
@@ -30,7 +30,7 @@ export interface DataProcessingParams {
/**
* 公共
*/
wechatAccountId?: string;
wechatAccountId?: number;
[property: string]: any;
}

View File

@@ -28,10 +28,20 @@ instance.interceptors.request.use((config: any) => {
instance.interceptors.response.use(
(res: AxiosResponse) => {
const { code, success, msg } = res.data || {};
if (code === 200 || success) {
return res.data.data ?? res.data;
const payload = res.data || {};
const { code, success, msg } = payload;
const hasBizCode = typeof code === "number";
const hasBizSuccess = typeof success === "boolean";
const bizSuccess = hasBizCode
? code === 200
: hasBizSuccess
? success
: undefined;
if (bizSuccess === true || (!hasBizCode && !hasBizSuccess)) {
return payload.data ?? payload;
}
Toast.show({ content: msg || "接口错误", position: "top" });
if (code === 401) {
localStorage.removeItem("token");

View File

@@ -0,0 +1,431 @@
import React, { useEffect, useState } from "react";
import { Drawer, Avatar, Space, Button, Badge, Empty, Tabs, Tag } from "antd";
import { BellOutlined } from "@ant-design/icons";
import {
noticeList,
readMessage,
readAll,
friendRequestList as fetchFriendRequestListApi,
} from "./api";
import styles from "./index.module.scss";
interface MessageItem {
id: number;
type: number;
companyId: number;
userId: number;
bindId: number;
title: string;
message: string;
isRead: number;
createTime: string;
readTime: string;
friendData: {
nickname: string;
avatar: string;
};
}
interface FriendRequestItem {
taskId: number;
phone: string;
wechatId: string;
adder?: {
avatar?: string;
nickname?: string;
username?: string;
accountNickname?: string;
accountRealName?: string;
};
status?: {
code?: number;
text?: string;
};
time?: {
addTime?: string;
addTimeStamp?: number;
updateTime?: string;
updateTimeStamp?: number;
passTime?: string;
passTimeStamp?: number;
};
friend?: {
nickname?: string;
isPassed?: boolean;
};
other?: {
msgContent?: string;
remark?: string;
from?: string;
labels?: string[];
};
}
const DEFAULT_QUERY = { page: 1, limit: 20 };
const Notice: React.FC = () => {
const [messageDrawerVisible, setMessageDrawerVisible] = useState(false);
const [activeTab, setActiveTab] = useState("messages");
const [messageList, setMessageList] = useState<MessageItem[]>([]);
const [messageCount, setMessageCount] = useState(0);
const [loading, setLoading] = useState(false);
const [friendRequestList, setFriendRequestList] = useState<
FriendRequestItem[]
>([]);
const [friendRequestLoading, setFriendRequestLoading] = useState(false);
const fetchMessageList = async () => {
try {
setLoading(true);
const response = await noticeList(DEFAULT_QUERY);
if (response?.list) {
setMessageList(response.list);
const unreadCount = response.list.filter(
(item: MessageItem) => item.isRead === 0,
).length;
setMessageCount(unreadCount);
}
} catch (error) {
console.error("获取消息列表失败:", error);
} finally {
setLoading(false);
}
};
const refreshUnreadCount = async () => {
try {
const response = await noticeList(DEFAULT_QUERY);
if (response && typeof response.noRead === "number") {
setMessageCount(response.noRead);
}
} catch (error) {
console.error("获取未读消息数失败:", error);
}
};
useEffect(() => {
fetchMessageList();
const timer = window.setInterval(refreshUnreadCount, 30 * 1000);
return () => {
window.clearInterval(timer);
};
}, []);
const handleMessageClick = () => {
setMessageDrawerVisible(true);
fetchMessageList();
fetchFriendRequestList();
};
const handleTabChange = (key: string) => {
setActiveTab(key);
if (key === "friendRequests") {
fetchFriendRequestList();
}
};
const handleMessageDrawerClose = () => {
setMessageDrawerVisible(false);
};
const handleReadMessage = async (messageId: number) => {
try {
await readMessage({ id: messageId });
setMessageList(prev => {
const updated = prev.map(item =>
item.id === messageId ? { ...item, isRead: 1 } : item,
);
const unreadCount = updated.filter(item => item.isRead === 0).length;
setMessageCount(unreadCount);
return updated;
});
} catch (error) {
console.error("标记消息已读失败:", error);
}
};
const handleReadAll = async () => {
try {
await readAll();
setMessageList(prev => prev.map(item => ({ ...item, isRead: 1 })));
setMessageCount(0);
} catch (error) {
console.error("全部已读失败:", error);
}
};
const fetchFriendRequestList = async () => {
try {
setFriendRequestLoading(true);
const response = await fetchFriendRequestListApi(DEFAULT_QUERY);
if (response?.list) {
setFriendRequestList(response.list);
}
} catch (error) {
console.error("获取好友添加记录失败:", error);
} finally {
setFriendRequestLoading(false);
}
};
const formatTime = (timeStr?: string) => {
if (!timeStr) {
return "-";
}
const date = new Date(timeStr);
const now = new Date();
const diff = now.getTime() - date.getTime();
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
if (days === 0) {
return date.toLocaleTimeString("zh-CN", {
hour: "2-digit",
minute: "2-digit",
});
} else if (days === 1) {
return "昨天";
} else if (days < 7) {
return `${days}天前`;
} else {
return date.toLocaleDateString("zh-CN", {
month: "2-digit",
day: "2-digit",
});
}
};
const getStatusText = (statusCode?: number, statusText?: string) => {
if (statusText) {
return statusText;
}
switch (statusCode) {
case 0:
return "待处理";
case 1:
return "已同意";
case 2:
return "已拒绝";
default:
return "未知";
}
};
const getStatusColor = (statusCode?: number) => {
switch (statusCode) {
case 0:
return "#1890ff";
case 1:
return "#52c41a";
case 2:
return "#ff4d4f";
default:
return "#999";
}
};
const getFriendRequestKey = (item: FriendRequestItem) => {
return (
item.taskId?.toString() ||
item.wechatId ||
item.phone ||
`${item.adder?.username || "unknown"}-${item.time?.addTime || "time"}`
);
};
const getAddedUserName = (item: FriendRequestItem) => {
return (
item.friend?.nickname ||
item.phone ||
item.wechatId ||
item.adder?.nickname ||
"未知好友"
);
};
const getAdderName = (item: FriendRequestItem) => {
return (
item.adder?.nickname ||
item.adder?.username ||
item.adder?.accountNickname ||
item.adder?.accountRealName ||
"未知添加人"
);
};
return (
<>
<div className={styles.messageButton} onClick={handleMessageClick}>
<Badge count={messageCount} size="small">
<BellOutlined style={{ fontSize: 20 }} />
</Badge>
</div>
<Drawer
title="通知中心"
placement="right"
onClose={handleMessageDrawerClose}
open={messageDrawerVisible}
width={400}
className={styles.messageDrawer}
extra={
activeTab === "messages" && (
<Space>
<Button type="text" size="small" onClick={handleReadAll}>
</Button>
</Space>
)
}
>
<div style={{ padding: "0 20px" }}>
<Tabs
activeKey={activeTab}
onChange={handleTabChange}
items={[
{
key: "messages",
label: "消息列表",
children: (
<div className={styles.messageContent}>
{loading ? (
<div style={{ textAlign: "center", padding: "20px" }}>
...
</div>
) : messageList.length === 0 ? (
<Empty description="暂无消息" />
) : (
messageList.map(item => (
<div
key={item.id}
className={`${styles.messageItem} ${
item.isRead === 0 ? styles.unread : ""
}`}
onClick={() => handleReadMessage(item.id)}
>
<div className={styles.messageAvatar}>
<Avatar
size={40}
src={item.friendData?.avatar}
style={{ backgroundColor: "#87d068" }}
>
{item.friendData?.nickname?.charAt(0) || "U"}
</Avatar>
</div>
<div className={styles.messageInfo}>
<div className={styles.messageTitle}>
<span className={styles.messageType}>
{item.title}
</span>
{item.isRead === 0 && (
<div className={styles.messageStatus}></div>
)}
</div>
<div className={styles.messageText}>
{item.message}
</div>
{item.isRead === 0 && (
<div className={styles.messageTime}>
{formatTime(item.createTime)}
<Button
type="link"
size="small"
onClick={event => {
event.stopPropagation();
handleReadMessage(item.id);
}}
>
</Button>
</div>
)}
</div>
</div>
))
)}
</div>
),
},
{
key: "friendRequests",
label: "好友添加记录",
children: (
<div className={styles.messageContent}>
{friendRequestLoading ? (
<div style={{ textAlign: "center", padding: "20px" }}>
...
</div>
) : friendRequestList.length === 0 ? (
<Empty description="暂无好友添加记录" />
) : (
friendRequestList.map(item => (
<div
key={getFriendRequestKey(item)}
className={styles.messageItem}
>
<div className={styles.messageAvatar}>
<Avatar
size={40}
src={item.adder?.avatar}
style={{ backgroundColor: "#87d068" }}
>
{item.adder?.nickname?.charAt(0) || "U"}
</Avatar>
</div>
<div className={styles.messageInfo}>
<div className={styles.messageTitle}>
<span className={styles.messageType}>
<Tag color="blue">{getAddedUserName(item)}</Tag>
</span>
<span
style={{
fontSize: "12px",
color: getStatusColor(item.status?.code),
fontWeight: 500,
}}
>
{getStatusText(
item.status?.code,
item.status?.text,
)}
</span>
</div>
<div
className={styles.messageText}
style={{ color: "#595959" }}
>
{getAdderName(item)}
</div>
<div className={styles.messageText}>
{item.other?.msgContent || "无"}
</div>
<div
className={styles.messageText}
style={{ color: "#999", fontSize: 12 }}
>
{item.other?.remark && (
<Tag color="orange" style={{ marginTop: 4 }}>
{item.other.remark}
</Tag>
)}
</div>
<div className={styles.messageTime}>
{formatTime(item.time?.addTime)}
</div>
</div>
</div>
))
)}
</div>
),
},
]}
/>
</div>
</Drawer>
</>
);
};
export default Notice;

View File

@@ -14,3 +14,8 @@ export const readMessage = (params: { id: number }) => {
export const readAll = () => {
return request(`/v1/kefu/notice/readAll`, undefined, "PUT");
};
// 好友添加任务列表
export const friendRequestList = (params: { page: number; limit: number }) => {
return request(`/v1/kefu/wechatFriend/addTaskList`, params, "GET");
};

View File

@@ -1,29 +1,18 @@
import React, { useState, useEffect } from "react";
import {
Layout,
Drawer,
Avatar,
Space,
Button,
Badge,
Dropdown,
Empty,
message,
} from "antd";
import React, { useState } from "react";
import { Layout, Avatar, Space, Button, Dropdown, message } from "antd";
import {
BarChartOutlined,
UserOutlined,
BellOutlined,
LogoutOutlined,
ThunderboltOutlined,
SettingOutlined,
SendOutlined,
ClearOutlined,
} from "@ant-design/icons";
import { noticeList, readMessage, readAll } from "./api";
import { useUserStore } from "@/store/module/user";
import { useNavigate, useLocation } from "react-router-dom";
import styles from "./index.module.scss";
import Notice from "./Notice";
const { Header } = Layout;
@@ -32,40 +21,12 @@ interface NavCommonProps {
onMenuClick?: () => void;
}
// 消息数据类型
interface MessageItem {
id: number;
type: number;
companyId: number;
userId: number;
bindId: number;
title: string;
message: string;
isRead: number;
createTime: string;
readTime: string;
friendData: {
nickname: string;
avatar: string;
};
}
const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
const [messageDrawerVisible, setMessageDrawerVisible] = useState(false);
const [messageList, setMessageList] = useState<MessageItem[]>([]);
const [messageCount, setMessageCount] = useState(0);
const [loading, setLoading] = useState(false);
const [clearingCache, setClearingCache] = useState(false);
const navigate = useNavigate();
const location = useLocation();
const { user, logout } = useUserStore();
// 初始化时获取消息列表
useEffect(() => {
fetchMessageList();
setInterval(IntervalMessageCount, 30 * 1000);
}, []);
// 处理菜单图标点击:在两个路由之间切换
const handleMenuClick = () => {
if (!location.pathname.startsWith("/pc/powerCenter")) {
@@ -74,48 +35,6 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
navigate("/pc/weChat");
}
};
// 定时器获取消息条数
const IntervalMessageCount = async () => {
try {
const response = await noticeList({ page: 1, limit: 20 });
if (response && response.noRead) {
setMessageCount(response.noRead);
}
} catch (error) {
console.error("获取消息列表失败:", error);
}
};
// 获取消息列表
const fetchMessageList = async () => {
try {
setLoading(true);
const response = await noticeList({ page: 1, limit: 20 });
if (response && response.list) {
setMessageList(response.list);
// 计算未读消息数量
const unreadCount = response.list.filter(
(item: MessageItem) => item.isRead === 0,
).length;
setMessageCount(unreadCount);
}
} catch (error) {
console.error("获取消息列表失败:", error);
} finally {
setLoading(false);
}
};
// 处理消息中心点击
const handleMessageClick = () => {
setMessageDrawerVisible(true);
fetchMessageList();
};
// 处理消息抽屉关闭
const handleMessageDrawerClose = () => {
setMessageDrawerVisible(false);
};
// 处理退出登录
const handleLogout = () => {
logout(); // 清除localStorage中的token和用户状态
@@ -215,61 +134,6 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
}
};
// 处理消息已读
const handleReadMessage = async (messageId: number) => {
try {
await readMessage({ id: messageId }); // 这里需要根据实际API调整参数
// 更新本地状态
setMessageList(prev =>
prev.map(item =>
item.id === messageId ? { ...item, isRead: 1 } : item,
),
);
// 重新计算未读数量
const unreadCount =
messageList.filter(item => item.isRead === 0).length - 1;
setMessageCount(Math.max(0, unreadCount));
} catch (error) {
console.error("标记消息已读失败:", error);
}
};
// 处理全部已读
const handleReadAll = async () => {
try {
await readAll(); // 这里需要根据实际API调整参数
// 更新本地状态
setMessageList(prev => prev.map(item => ({ ...item, isRead: 1 })));
setMessageCount(0);
} catch (error) {
console.error("全部已读失败:", error);
}
};
// 格式化时间
const formatTime = (timeStr: string) => {
const date = new Date(timeStr);
const now = new Date();
const diff = now.getTime() - date.getTime();
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
if (days === 0) {
return date.toLocaleTimeString("zh-CN", {
hour: "2-digit",
minute: "2-digit",
});
} else if (days === 1) {
return "昨天";
} else if (days < 7) {
return `${days}天前`;
} else {
return date.toLocaleDateString("zh-CN", {
month: "2-digit",
day: "2-digit",
});
}
};
// 用户菜单项
const userMenuItems = [
{
@@ -333,11 +197,7 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
</span>
{user?.tokens}
</span>
<div className={styles.messageButton} onClick={handleMessageClick}>
<Badge count={messageCount} size="small">
<BellOutlined style={{ fontSize: 20 }} />
</Badge>
</div>
<Notice />
<Dropdown
menu={{ items: userMenuItems }}
@@ -361,69 +221,6 @@ const NavCommon: React.FC<NavCommonProps> = ({ title = "触客宝" }) => {
</Space>
</div>
</Header>
<Drawer
title="通知中心"
placement="right"
onClose={handleMessageDrawerClose}
open={messageDrawerVisible}
width={400}
className={styles.messageDrawer}
extra={
<Space>
<Button type="text" size="small" onClick={handleReadAll}>
</Button>
</Space>
}
>
<div className={styles.messageContent}>
{loading ? (
<div style={{ textAlign: "center", padding: "20px" }}>
...
</div>
) : messageList.length === 0 ? (
<Empty description="暂无消息" />
) : (
messageList.map(item => (
<div
key={item.id}
className={`${styles.messageItem} ${
item.isRead === 0 ? styles.unread : ""
}`}
onClick={() => handleReadMessage(item.id)}
>
<div className={styles.messageAvatar}>
<Avatar
size={40}
src={item.friendData?.avatar}
style={{ backgroundColor: "#87d068" }}
>
{item.friendData?.nickname?.charAt(0) || "U"}
</Avatar>
</div>
<div className={styles.messageInfo}>
<div className={styles.messageTitle}>
<span className={styles.messageType}>{item.title}</span>
{item.isRead === 0 && (
<div className={styles.messageStatus}></div>
)}
</div>
<div className={styles.messageText}>{item.message}</div>
{item.isRead === 0 && (
<div className={styles.messageTime}>
{formatTime(item.createTime)}
<Button type="link" size="small">
</Button>
</div>
)}
</div>
</div>
))
)}
</div>
</Drawer>
</>
);
};

View File

@@ -28,14 +28,30 @@ export function getTrafficPoolList() {
"GET",
);
}
type ListRequestOptions = {
debounceGap?: number;
};
// 好友列表
export function getContactList(params) {
return request("/v1/kefu/wechatFriend/list", params, "GET");
export function getContactList(params, options?: ListRequestOptions) {
return request(
"/v1/kefu/wechatFriend/list",
params,
"GET",
undefined,
options?.debounceGap,
);
}
// 群列表
export function getGroupList(params) {
return request("/v1/kefu/wechatChatroom/list", params, "GET");
export function getGroupList(params, options?: ListRequestOptions) {
return request(
"/v1/kefu/wechatChatroom/list",
params,
"GET",
undefined,
options?.debounceGap,
);
}
// 分组列表
export function getLabelsListByGroup(params) {

View File

@@ -6,11 +6,14 @@ import {
WechatFriendAllot,
WechatFriendRebackAllot,
} from "@/pages/pc/ckbox/weChat/api";
import { dataProcessing } from "@/api/ai";
import { useCurrentContact } from "@/store/module/weChat/weChat";
import { ContactManager } from "@/utils/dbAction/contact";
import { MessageManager } from "@/utils/dbAction/message";
import { useUserStore } from "@/store/module/user";
import { useWeChatStore } from "@/store/module/weChat/weChat";
import { useMessageStore } from "@weChatStore/message";
import { useContactStore } from "@weChatStore/contacts";
const { TextArea } = Input;
const { Option } = Select;
@@ -37,6 +40,8 @@ const ToContract: React.FC<ToContractProps> = ({
const clearCurrentContact = useWeChatStore(
state => state.clearCurrentContact,
);
const removeSessionById = useMessageStore(state => state.removeSessionById);
const deleteContact = useContactStore(state => state.deleteContact);
const [visible, setVisible] = useState(false);
const [selectedTarget, setSelectedTarget] = useState<number | null>(null);
const [comment, setComment] = useState<string>("");
@@ -79,6 +84,12 @@ const ToContract: React.FC<ToContractProps> = ({
notifyReceiver: true,
comment: comment.trim(),
});
dataProcessing({
type: "CmdAllotFriend",
wechatChatroomId: currentContact.id,
toAccountId: selectedTarget as number,
wechatAccountId: currentContact.wechatAccountId,
});
} else {
await WechatFriendAllot({
wechatFriendId: currentContact.id,
@@ -86,6 +97,12 @@ const ToContract: React.FC<ToContractProps> = ({
notifyReceiver: true,
comment: comment.trim(),
});
dataProcessing({
type: "CmdAllotFriend",
wechatFriendId: currentContact.id,
toAccountId: selectedTarget as number,
wechatAccountId: currentContact.wechatAccountId,
});
}
}
@@ -97,7 +114,10 @@ const ToContract: React.FC<ToContractProps> = ({
const currentUserId = useUserStore.getState().user?.id || 0;
const contactType = "chatroomId" in currentContact ? "group" : "friend";
// 1. 从会话列表数据库删除
// 1. 立即从Store中删除会话更新UI
removeSessionById(currentContact.id, contactType);
// 2. 从会话列表数据库删除
await MessageManager.deleteSession(
currentUserId,
currentContact.id,
@@ -105,11 +125,19 @@ const ToContract: React.FC<ToContractProps> = ({
);
console.log("✅ 已从会话列表删除");
// 2. 从联系人数据库删除
// 3. 从联系人数据库删除
await ContactManager.deleteContact(currentContact.id);
console.log("✅ 已从联系人数据库删除");
// 3. 清空当前选中的联系人(关闭聊天窗口
// 4. 从联系人Store中删除更新联系人列表UI
try {
await deleteContact(currentContact.id);
console.log("✅ 已从联系人列表Store删除");
} catch (error) {
console.error("从联系人Store删除失败:", error);
}
// 5. 清空当前选中的联系人(关闭聊天窗口)
clearCurrentContact();
message.success("转接成功,已清理本地数据");
@@ -151,7 +179,10 @@ const ToContract: React.FC<ToContractProps> = ({
const currentUserId = useUserStore.getState().user?.id || 0;
const contactType = "chatroomId" in currentContact ? "group" : "friend";
// 1. 从会话列表数据库删除
// 1. 立即从Store中删除会话更新UI
removeSessionById(currentContact.id, contactType);
// 2. 从会话列表数据库删除
await MessageManager.deleteSession(
currentUserId,
currentContact.id,
@@ -159,11 +190,19 @@ const ToContract: React.FC<ToContractProps> = ({
);
console.log("✅ 已从会话列表删除");
// 2. 从联系人数据库删除
// 3. 从联系人数据库删除
await ContactManager.deleteContact(currentContact.id);
console.log("✅ 已从联系人数据库删除");
// 3. 清空当前选中的联系人(关闭聊天窗口
// 4. 从联系人Store中删除更新联系人列表UI
try {
await deleteContact(currentContact.id);
console.log("✅ 已从联系人列表Store删除");
} catch (error) {
console.error("从联系人Store删除失败:", error);
}
// 5. 清空当前选中的联系人(关闭聊天窗口)
clearCurrentContact();
message.success("转回成功,已清理本地数据");
@@ -209,9 +248,9 @@ const ToContract: React.FC<ToContractProps> = ({
width: "100%",
}}
>
<Button onClick={handleReturn} disabled={loading}>
{/* <Button onClick={handleReturn} disabled={loading}>
一键转回
</Button>
</Button> */}
<div>
<Button
onClick={closeModal}

View File

@@ -176,19 +176,21 @@ const MessageEnter: React.FC<MessageEnterProps> = ({ contract }) => {
updateQuoteMessageContent("");
};
// AI 消息处理
// AI 消息处理 - 只处理AI辅助模式
// AI接管模式已经在weChat.ts中直接发送不经过此组件
// 快捷语填充:当 quoteMessageContent 更新时,填充到输入框
useEffect(() => {
if (quoteMessageContent) {
if (isAiAssist) {
// AI辅助模式直接填充输入框
setInputValue(quoteMessageContent);
} else {
// 快捷语模式:直接填充输入框(用户主动点击快捷语,应该替换当前内容)
setInputValue(quoteMessageContent);
}
if (isAiTakeover) {
handleSend(quoteMessageContent);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [quoteMessageContent, aiQuoteMessageContent, isAiAssist, isAiTakeover]);
}, [quoteMessageContent, aiQuoteMessageContent, isAiAssist]);
const handleKeyPress = (e: React.KeyboardEvent) => {
if (e.key === "Enter" && !e.shiftKey && !e.ctrlKey) {

View File

@@ -1,6 +1,6 @@
// 朋友圈相关的API接口
import { useWebSocketStore } from "@/store/module/websocket/websocket";
import request from "@/api/request";
// 朋友圈请求参数接口
export interface FetchMomentParams {
friendMessageId: number;
@@ -30,3 +30,16 @@ export const fetchVoiceToTextApi = async (params: VoiceToTextParams) => {
seq: params.seq,
});
};
export const getChatroomMemberList = async (params: { groupId: number }) => {
return request(
"/v1/chatroom/getMemberList",
{
groupId: params.groupId,
keyword: "",
limit: 500,
page: 1,
},
"GET",
);
};

View File

@@ -0,0 +1,160 @@
// 红包消息样式
.redPacketMessage {
background: transparent;
box-shadow: none;
max-width: 300px;
}
.redPacketCard {
position: relative;
display: flex;
flex-direction: column;
padding: 16px 20px;
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
border-radius: 8px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
overflow: hidden;
// 红包装饰背景
&::before {
content: "";
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(
circle,
rgba(255, 215, 0, 0.15) 0%,
transparent 70%
);
animation: shimmer 3s ease-in-out infinite;
}
// 金色装饰边框
&::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 2px solid rgba(255, 215, 0, 0.4);
border-radius: 8px;
pointer-events: none;
}
&:hover {
transform: translateY(-2px);
box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
background: linear-gradient(135deg, #ff7b7b 0%, #ff6b7f 100%);
}
&:active {
transform: translateY(0);
}
}
@keyframes shimmer {
0%,
100% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
}
.redPacketHeader {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
position: relative;
z-index: 1;
}
.redPacketIcon {
font-size: 32px;
line-height: 1;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-4px);
}
}
.redPacketTitle {
flex: 1;
font-size: 16px;
font-weight: 600;
color: #ffffff;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
letter-spacing: 0.5px;
line-height: 1.4;
word-break: break-word;
}
.redPacketFooter {
display: flex;
align-items: center;
justify-content: flex-end;
position: relative;
z-index: 1;
padding-top: 8px;
border-top: 1px solid rgba(255, 255, 255, 0.3);
}
.redPacketLabel {
font-size: 12px;
color: rgba(255, 255, 255, 0.9);
font-weight: 500;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
&::before {
content: "💰";
margin-right: 4px;
font-size: 14px;
}
}
// 消息文本样式(用于错误提示)
.messageText {
line-height: 1.4;
white-space: pre-wrap;
word-break: break-word;
color: #8c8c8c;
font-size: 13px;
}
// 响应式设计
@media (max-width: 768px) {
.redPacketMessage {
max-width: 200px;
}
.redPacketCard {
padding: 12px 16px;
}
.redPacketIcon {
font-size: 28px;
}
.redPacketTitle {
font-size: 14px;
}
.redPacketLabel {
font-size: 11px;
}
}

View File

@@ -0,0 +1,62 @@
import React from "react";
import styles from "./RedPacketMessage.module.scss";
interface RedPacketData {
nativeurl?: string;
paymsgid?: string;
sendertitle?: string;
[key: string]: any;
}
interface RedPacketMessageProps {
content: string;
}
const RedPacketMessage: React.FC<RedPacketMessageProps> = ({ content }) => {
const renderErrorMessage = (fallbackText: string) => (
<div className={styles.messageText}>{fallbackText}</div>
);
if (typeof content !== "string" || !content.trim()) {
return renderErrorMessage("[红包消息 - 无效内容]");
}
try {
const trimmedContent = content.trim();
const jsonData: RedPacketData = JSON.parse(trimmedContent);
// 验证是否为红包消息
const isRedPacket =
jsonData.nativeurl &&
typeof jsonData.nativeurl === "string" &&
jsonData.nativeurl.includes(
"wxpay://c2cbizmessagehandler/hongbao/receivehongbao",
);
if (!isRedPacket) {
return renderErrorMessage("[红包消息 - 格式错误]");
}
const title = jsonData.sendertitle || "恭喜发财,大吉大利";
const paymsgid = jsonData.paymsgid || "";
return (
<div className={styles.redPacketMessage}>
<div className={styles.redPacketCard}>
<div className={styles.redPacketHeader}>
<div className={styles.redPacketIcon}>🧧</div>
<div className={styles.redPacketTitle}>{title}</div>
</div>
<div className={styles.redPacketFooter}>
<span className={styles.redPacketLabel}></span>
</div>
</div>
</div>
);
} catch (e) {
console.warn("红包消息解析失败:", e);
return renderErrorMessage("[红包消息 - 解析失败]");
}
};
export default RedPacketMessage;

View File

@@ -7,6 +7,7 @@ import VideoMessage from "./components/VideoMessage";
import ClickMenu from "./components/ClickMeau";
import LocationMessage from "./components/LocationMessage";
import SystemRecommendRemarkMessage from "./components/SystemRecommendRemarkMessage/index";
import RedPacketMessage from "./components/RedPacketMessage";
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
import { formatWechatTime } from "@/utils/common";
import { getEmojiPath } from "@/components/EmojiSeclection/wechatEmoji";
@@ -14,7 +15,11 @@ import styles from "./com.module.scss";
import { useWeChatStore } from "@/store/module/weChat/weChat";
import { useContactStore } from "@/store/module/weChat/contacts";
import { useCustomerStore } from "@weChatStore/customer";
import { fetchReCallApi, fetchVoiceToTextApi } from "./api";
import {
fetchReCallApi,
fetchVoiceToTextApi,
getChatroomMemberList,
} from "./api";
import TransmitModal from "./components/TransmitModal";
const IMAGE_EXT_REGEX = /\.(jpg|jpeg|png|gif|webp|bmp|svg)$/i;
@@ -131,6 +136,16 @@ const tryParseContentJson = (content: string): Record<string, any> | null => {
interface MessageRecordProps {
contract: ContractData | weChatGroup;
}
type GroupRenderItem = {
id: number;
identifier: string;
nickname: string;
avatar: string;
groupId: number;
chatroomId?: string;
wechatId?: string;
};
const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
const messagesEndRef = useRef<HTMLDivElement>(null);
// 右键菜单状态
@@ -152,9 +167,6 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
const loadChatMessages = useWeChatStore(state => state.loadChatMessages);
const messagesLoading = useWeChatStore(state => state.messagesLoading);
const isLoadingData = useWeChatStore(state => state.isLoadingData);
const currentGroupMembers = useWeChatStore(
state => state.currentGroupMembers,
);
const showCheckbox = useWeChatStore(state => state.showCheckbox);
const prevMessagesRef = useRef(currentMessages);
const updateShowCheckbox = useWeChatStore(state => state.updateShowCheckbox);
@@ -168,6 +180,7 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
);
const setTransmitModal = useContactStore(state => state.setTransmitModal);
const [groupRender, setGroupRender] = useState<GroupRenderItem[]>([]);
const currentContract = useWeChatStore(state => state.currentContract);
const updateQuoteMessageContent = useWeChatStore(
@@ -242,6 +255,7 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
msg?: ChatRecord,
contract?: ContractData | weChatGroup,
) => {
console.log("红包");
if (isLegacyEmojiContent(trimmedContent)) {
return renderEmojiContent(rawContent);
}
@@ -249,6 +263,17 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
const jsonData = tryParseContentJson(trimmedContent);
if (jsonData && typeof jsonData === "object") {
// 判断是否为红包消息
if (
jsonData.nativeurl &&
typeof jsonData.nativeurl === "string" &&
jsonData.nativeurl.includes(
"wxpay://c2cbizmessagehandler/hongbao/receivehongbao",
)
) {
return <RedPacketMessage content={rawContent} />;
}
if (jsonData.type === "file" && msg && contract) {
return (
<SmallProgramMessage
@@ -345,6 +370,39 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
);
};
useEffect(() => {
const fetchGroupMembers = async () => {
if (!contract.chatroomId) {
setGroupRender([]);
return;
}
try {
const res = await getChatroomMemberList({ groupId: contract.id });
setGroupRender(res?.list || []);
} catch (error) {
console.error("获取群成员失败", error);
setGroupRender([]);
}
};
fetchGroupMembers();
}, [contract.id, contract.chatroomId]);
const renderGroupUser = (msg: ChatRecord) => {
if (!msg) {
return { avatar: "", nickname: "" };
}
const member = groupRender.find(
user => user?.identifier === msg?.senderWechatId,
);
console.log(member, "member");
return {
avatar: member?.avatar || msg?.avatar,
nickname: member?.nickname || msg?.senderNickname,
};
};
useEffect(() => {
const prevMessages = prevMessagesRef.current;
const prevLength = prevMessages.length;
@@ -498,13 +556,6 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
};
// 获取群成员头像
const groupMemberAvatar = (msg: ChatRecord) => {
const groupMembers = currentGroupMembers.find(
v => v?.wechatId == msg?.sender?.wechatId,
);
return groupMembers?.avatar;
};
// 清理微信ID前缀
const clearWechatidInContent = (sender: any, content: string) => {
try {
@@ -579,6 +630,7 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
const isOwn = msg?.isSend;
const isGroup = !!contract.chatroomId;
return (
<div
key={msg.id || `msg-${Date.now()}`}
@@ -619,7 +671,7 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
{/* 如果是群聊 */}
{isGroup && !isOwn && (
<>
{/* Checkbox 显示控制 */}
{/* 群聊场景下根据消息发送者匹配头像与昵称 */}
{showCheckbox && (
<div className={styles.checkboxContainer}>
<Checkbox
@@ -630,14 +682,14 @@ const MessageRecord: React.FC<MessageRecordProps> = ({ contract }) => {
)}
<Avatar
size={32}
src={groupMemberAvatar(msg)}
src={renderGroupUser(msg)?.avatar}
icon={<UserOutlined />}
className={styles.messageAvatar}
/>
<div>
{!isOwn && (
<div className={styles.messageSender}>
{msg?.sender?.nickname}
{renderGroupUser(msg)?.nickname}
</div>
)}
<>

View File

@@ -62,7 +62,7 @@ export interface QuickWordsProps {
const QuickWords: React.FC<QuickWordsProps> = ({ onInsert }) => {
const [activeTab, setActiveTab] = useState<QuickWordsType>(
QuickWordsType.PUBLIC,
QuickWordsType.PERSONAL,
);
const [keyword, setKeyword] = useState("");
const [loading, setLoading] = useState(false);

View File

@@ -42,16 +42,25 @@
&.active {
.userAvatar {
border: 4px solid #1890ff;
border-color: #1890ff;
}
}
.active & {
border-color: #1890ff;
}
.avatarWrapper {
position: relative;
}
&.offline {
filter: grayscale(100%);
opacity: 0.6;
}
.userAvatar {
border: 4px solid transparent;
border-radius: 50%;
transition:
filter 0.2s ease,
opacity 0.2s ease,
border-color 0.2s ease;
&.offline {
filter: grayscale(100%);
opacity: 0.75;
}
}
.allUser {
@@ -81,20 +90,13 @@
.onlineIndicator {
position: absolute;
bottom: 10px;
right: 10px;
width: 8px;
height: 8px;
bottom: 4px;
right: 4px;
width: 12px;
height: 12px;
border-radius: 50%;
border: 1px solid #2e2e2e;
&.online {
background-color: #52c41a; // 绿色表示在线
}
&.offline {
background-color: #8c8c8c; // 灰色表示离线
}
border: 2px solid #ffffff;
background-color: #52c41a;
}
// 骨架屏样式

View File

@@ -101,16 +101,25 @@ const CustomerList: React.FC = () => {
overflowCount={99}
className={styles.messageBadge}
>
<Avatar
src={customer.avatar}
size={50}
className={`${styles.userAvatar} ${!customer.isOnline ? styles.offline : ""}`}
style={{
backgroundColor: !customer.avatar ? "#1890ff" : undefined,
}}
>
{!customer.avatar && customer.name.charAt(0)}
</Avatar>
<div className={styles.avatarWrapper}>
<Avatar
src={customer.avatar}
size={50}
className={`${styles.userAvatar} ${!customer.isOnline ? styles.offline : ""}`}
style={{
backgroundColor: !customer.avatar
? "#1890ff"
: undefined,
}}
>
{!customer.avatar && customer.name.charAt(0)}
</Avatar>
{customer.isOnline && (
<span
className={`${styles.onlineIndicator} ${styles.online}`}
/>
)}
</div>
</Badge>
</div>
))}

View File

@@ -188,6 +188,37 @@
text-align: center;
}
// 加载容器样式
.loadingContainer {
height: 100%;
display: flex;
align-items: flex-start;
justify-content: center;
min-height: 400px;
position: relative;
padding-top: 40px;
:global(.ant-spin-container) {
width: 100%;
}
:global(.ant-spin-spinning) {
position: relative;
}
:global(.ant-spin-text) {
color: #1890ff;
font-size: 14px;
margin-top: 12px;
}
}
.loadingContent {
width: 100%;
height: 100%;
opacity: 0.6;
}
// 骨架屏样式
.skeletonContainer {
padding: 10px;
@@ -211,3 +242,41 @@
align-items: center;
margin-bottom: 8px;
}
// 同步状态提示栏样式
.syncStatusBar {
height: 50px;
display: flex;
align-items: center;
justify-content: center;
border-bottom: 1px solid #f0f0f0;
background-color: #fafafa;
padding: 0 16px;
flex-shrink: 0;
}
.syncStatusContent {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
justify-content: space-between;
padding: 0px 20px;
}
.syncStatusText {
font-size: 14px;
color: #666;
}
.syncButton {
color: green;
cursor: pointer;
font-size: 14px;
&:hover {
color: green;
}
&:active {
transform: scale(0.98);
}
}

View File

@@ -1,11 +1,13 @@
import React, { useEffect, useState, useRef } from "react";
import { List, Avatar, Badge, Modal, Input, message, Skeleton } from "antd";
import { List, Avatar, Badge, Modal, Input, message } from "antd";
import {
UserOutlined,
TeamOutlined,
PushpinOutlined,
DeleteOutlined,
EditOutlined,
LoadingOutlined,
CheckCircleOutlined,
} from "@ant-design/icons";
import styles from "./com.module.scss";
import {
@@ -38,14 +40,13 @@ const MessageList: React.FC<MessageListProps> = () => {
// Store状态
const {
loading,
hasLoadedOnce,
setLoading,
setHasLoadedOnce,
sessions,
setSessions: setSessionState,
} = useMessageStore();
const [filteredSessions, setFilteredSessions] = useState<ChatSession[]>([]);
const [syncing, setSyncing] = useState(false); // 同步状态
// 右键菜单相关状态
const [contextMenu, setContextMenu] = useState<{
@@ -74,6 +75,7 @@ const MessageList: React.FC<MessageListProps> = () => {
const contextMenuRef = useRef<HTMLDivElement>(null);
const previousUserIdRef = useRef<number | null>(null);
const loadRequestRef = useRef(0);
const autoClickRef = useRef(false);
// 右键菜单事件处理
const handleContextMenu = (e: React.MouseEvent, session: ChatSession) => {
@@ -296,70 +298,104 @@ const MessageList: React.FC<MessageListProps> = () => {
// ==================== 数据加载 ====================
// 与服务器同步数据
// 与服务器同步数据优化版逐页同步立即更新UI
const syncWithServer = async () => {
if (!currentUserId) return;
setSyncing(true); // 开始同步,显示同步状态栏
try {
// 获取会话列表数据(分页获取所有数据)
let allMessages: any[] = [];
let page = 1;
const limit = 500;
let hasMore = true;
let totalProcessed = 0;
let successCount = 0;
let failCount = 0;
// 分页获取会话列表
// 分页获取会话列表,每页成功后立即同步
while (hasMore) {
const result: any = await getMessageList({
page,
limit,
});
try {
const result: any = await getMessageList({
page,
limit,
});
if (!result || !Array.isArray(result) || result.length === 0) {
hasMore = false;
break;
}
if (!result || !Array.isArray(result) || result.length === 0) {
hasMore = false;
break;
}
allMessages = [...allMessages, ...result];
// 立即处理这一页的数据
const friends = result.filter(
(msg: any) => msg.dataType === "friend" || !msg.chatroomId,
);
const groups = result
.filter((msg: any) => msg.dataType === "group" || msg.chatroomId)
.map((msg: any) => ({
...msg,
chatroomAvatar: msg.chatroomAvatar || msg.avatar || "",
}));
if (result.length < limit) {
hasMore = false;
} else {
// 立即同步这一页到数据库会触发UI更新
// 分页同步时跳过删除检查,避免误删其他页的会话
await MessageManager.syncSessions(
currentUserId,
{
friends,
groups,
},
{ skipDelete: true },
);
totalProcessed += result.length;
successCount++;
// 判断是否还有下一页
if (result.length < limit) {
hasMore = false;
} else {
page++;
}
} catch (error) {
// 忽略单页失败,继续处理下一页
console.error(`${page}页同步失败:`, error);
failCount++;
// 如果连续失败太多,停止同步
if (failCount >= 3) {
console.warn("连续失败次数过多,停止同步");
break;
}
// 继续下一页
page++;
if (page > 100) {
// 防止无限循环
hasMore = false;
}
}
}
// 分离好友和群聊数据
const friends = allMessages.filter(
(msg: any) => msg.dataType === "friend" || !msg.chatroomId,
);
const groups = allMessages
.filter((msg: any) => msg.dataType === "group" || msg.chatroomId)
.map((msg: any) => {
// 确保群聊数据包含正确的头像字段
// 如果接口返回的是 avatar 字段,需要映射到 chatroomAvatar
return {
...msg,
chatroomAvatar: msg.chatroomAvatar || msg.avatar || "",
};
});
// 执行增量同步
const syncResult = await MessageManager.syncSessions(currentUserId, {
friends,
groups,
});
// 同步后验证数据
const verifySession = await MessageManager.getUserSessions(currentUserId);
console.log("同步后的会话数据示例:", verifySession[0]);
console.log(
`会话同步完成: 新增${syncResult.added}, 更新${syncResult.updated}, 删除${syncResult.deleted}`,
`会话同步完成: 成功${successCount}, 失败${failCount}, 共处理${totalProcessed}条数据`,
);
// 会话管理器会在有变更时触发订阅回调
} catch (error) {
console.error("同步服务器数据失败:", error);
} finally {
setSyncing(false); // 同步完成,更新状态栏
}
};
// 手动触发同步的函数
const handleManualSync = async () => {
if (syncing) return; // 如果正在同步,不重复触发
setSyncing(true);
try {
await syncWithServer();
} catch (error) {
console.error("手动同步失败:", error);
} finally {
setSyncing(false);
}
};
@@ -370,6 +406,7 @@ const MessageList: React.FC<MessageListProps> = () => {
previousUserIdRef.current = currentUserId;
setHasLoadedOnce(false);
setSessionState([]);
autoClickRef.current = false; // 重置自动点击标记
}, [currentUserId, setHasLoadedOnce, setSessionState]);
// 初始化加载会话列表
@@ -383,8 +420,6 @@ const MessageList: React.FC<MessageListProps> = () => {
const requestId = ++loadRequestRef.current;
const initializeSessions = async () => {
// setLoading(true);
try {
const cachedSessions =
await MessageManager.getUserSessions(currentUserId);
@@ -393,6 +428,7 @@ const MessageList: React.FC<MessageListProps> = () => {
return;
}
// 有缓存数据立即显示
if (cachedSessions.length > 0) {
setSessionState(cachedSessions);
}
@@ -400,12 +436,18 @@ const MessageList: React.FC<MessageListProps> = () => {
const needsFullSync = cachedSessions.length === 0 || !hasLoadedOnce;
if (needsFullSync) {
await syncWithServer();
if (isCancelled || loadRequestRef.current !== requestId) {
return;
}
setHasLoadedOnce(true);
// 不等待同步完成让它在后台进行第一页数据同步后会立即更新UI
syncWithServer()
.then(() => {
if (!isCancelled && loadRequestRef.current === requestId) {
setHasLoadedOnce(true);
}
})
.catch(error => {
console.error("同步失败:", error);
});
} else {
// 后台同步
syncWithServer().catch(error => {
console.error("后台同步失败:", error);
});
@@ -414,10 +456,6 @@ const MessageList: React.FC<MessageListProps> = () => {
if (!isCancelled) {
console.error("初始化会话列表失败:", error);
}
} finally {
if (!isCancelled && loadRequestRef.current === requestId) {
// setLoading(false);
}
}
};
@@ -447,25 +485,97 @@ const MessageList: React.FC<MessageListProps> = () => {
// 根据客服和搜索关键词筛选会话
useEffect(() => {
let filtered = [...sessions];
const filterSessions = async () => {
let filtered = [...sessions];
// 根据当前选中的客服筛选
if (currentCustomer && currentCustomer.id !== 0) {
filtered = filtered.filter(v => v.wechatAccountId === currentCustomer.id);
// 根据当前选中的客服筛选
if (currentCustomer && currentCustomer.id !== 0) {
filtered = filtered.filter(
v => v.wechatAccountId === currentCustomer.id,
);
}
// 根据搜索关键词进行模糊匹配(支持搜索昵称、备注名、微信号)
if (searchKeyword.trim()) {
const keyword = searchKeyword.toLowerCase();
// 如果搜索关键词可能是微信号,需要从联系人表补充 wechatId
const sessionsNeedingWechatId = filtered.filter(
v => !v.wechatId && v.type === "friend",
);
// 批量从联系人表获取 wechatId
if (sessionsNeedingWechatId.length > 0) {
const contactPromises = sessionsNeedingWechatId.map(session =>
ContactManager.getContactByIdAndType(
currentUserId,
session.id,
session.type,
),
);
const contacts = await Promise.all(contactPromises);
// 补充 wechatId 到会话数据
contacts.forEach((contact, index) => {
if (contact && contact.wechatId) {
const session = sessionsNeedingWechatId[index];
const sessionIndex = filtered.findIndex(
s => s.id === session.id && s.type === session.type,
);
if (sessionIndex !== -1) {
filtered[sessionIndex] = {
...filtered[sessionIndex],
wechatId: contact.wechatId,
};
}
}
});
}
filtered = filtered.filter(v => {
const nickname = (v.nickname || "").toLowerCase();
const conRemark = (v.conRemark || "").toLowerCase();
const wechatId = (v.wechatId || "").toLowerCase();
return (
nickname.includes(keyword) ||
conRemark.includes(keyword) ||
wechatId.includes(keyword)
);
});
}
setFilteredSessions(filtered);
};
filterSessions();
}, [sessions, currentCustomer, searchKeyword, currentUserId]);
// 渲染完毕后自动点击第一个聊天记录
useEffect(() => {
// 只在以下条件满足时自动点击:
// 1. 有过滤后的会话列表
// 2. 当前没有选中的联系人
// 3. 还没有自动点击过
// 4. 不在搜索状态(避免搜索时自动切换)
if (
filteredSessions.length > 0 &&
!currentContract &&
!autoClickRef.current &&
!searchKeyword.trim()
) {
// 延迟一点时间确保DOM已渲染
const timer = setTimeout(() => {
const firstSession = filteredSessions[0];
if (firstSession) {
autoClickRef.current = true;
onContactClick(firstSession);
}
}, 100);
return () => clearTimeout(timer);
}
// 根据搜索关键词进行模糊匹配
if (searchKeyword.trim()) {
const keyword = searchKeyword.toLowerCase();
filtered = filtered.filter(v => {
const nickname = (v.nickname || "").toLowerCase();
const conRemark = (v.conRemark || "").toLowerCase();
return nickname.includes(keyword) || conRemark.includes(keyword);
});
}
setFilteredSessions(filtered);
}, [sessions, currentCustomer, searchKeyword]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [filteredSessions, currentContract, searchKeyword]);
// ==================== WebSocket消息处理 ====================
@@ -711,147 +821,146 @@ const MessageList: React.FC<MessageListProps> = () => {
}
};
// 渲染骨架屏
const renderSkeleton = () => (
<div className={styles.skeletonContainer}>
{Array(8)
.fill(null)
.map((_, index) => (
<div key={`skeleton-${index}`} className={styles.skeletonItem}>
<Skeleton.Avatar active size={48} shape="circle" />
<div className={styles.skeletonContent}>
<div className={styles.skeletonHeader}>
<Skeleton.Input active size="small" style={{ width: "40%" }} />
<Skeleton.Input active size="small" style={{ width: "20%" }} />
</div>
<Skeleton.Input
active
size="small"
style={{ width: "70%", marginTop: "8px" }}
/>
</div>
</div>
))}
// 渲染同步状态提示栏
const renderSyncStatusBar = () => (
<div className={styles.syncStatusBar}>
{syncing ? (
<div className={styles.syncStatusContent}>
<span className={styles.syncStatusText}>
<LoadingOutlined style={{ marginRight: "10px" }} /> ...
</span>
</div>
) : (
<div className={styles.syncStatusContent}>
<span className={styles.syncStatusText}>
<CheckCircleOutlined
style={{ color: "green", marginRight: "10px" }}
/>
</span>
<span className={styles.syncButton} onClick={handleManualSync}>
</span>
</div>
)}
</div>
);
return (
<div className={styles.messageList}>
{loading ? (
// 加载状态:显示骨架屏
renderSkeleton()
) : (
<>
<List
dataSource={filteredSessions as any[]}
renderItem={session => (
<List.Item
key={session.id}
className={`${styles.messageItem} ${
currentContract?.id === session.id ? styles.active : ""
} ${(session.config as any)?.top ? styles.pinned : ""}`}
onClick={() => onContactClick(session)}
onContextMenu={e => handleContextMenu(e, session)}
>
<div className={styles.messageInfo}>
<Badge count={session.config.unreadCount || 0} size="small">
<Avatar
size={48}
src={session.avatar}
icon={
session?.type === "group" ? (
<TeamOutlined />
) : (
<UserOutlined />
)
}
/>
</Badge>
<div className={styles.messageDetails}>
<div className={styles.messageHeader}>
<div className={styles.messageName}>
{session.conRemark ||
session.nickname ||
session.wechatId}
</div>
<div className={styles.messageTime}>
{formatWechatTime(session?.lastUpdateTime)}
</div>
</div>
<div className={styles.messageContent}>
{messageFilter(session.content)}
</div>
{/* 同步状态提示栏 */}
{renderSyncStatusBar()}
<List
dataSource={filteredSessions as any[]}
renderItem={session => (
<List.Item
key={session.id}
className={`${styles.messageItem} ${
currentContract?.id === session.id ? styles.active : ""
} ${(session.config as any)?.top ? styles.pinned : ""}`}
onClick={() => onContactClick(session)}
onContextMenu={e => handleContextMenu(e, session)}
>
<div className={styles.messageInfo}>
<Badge count={session.config.unreadCount || 0} size="small">
<Avatar
size={48}
src={session.avatar}
icon={
session?.type === "group" ? (
<TeamOutlined />
) : (
<UserOutlined />
)
}
/>
</Badge>
<div className={styles.messageDetails}>
<div className={styles.messageHeader}>
<div className={styles.messageName}>
{session.conRemark || session.nickname || session.wechatId}
</div>
<div className={styles.messageTime}>
{formatWechatTime(session?.lastUpdateTime)}
</div>
</div>
</List.Item>
)}
/>
{/* 右键菜单 */}
{contextMenu.visible && contextMenu.session && (
<div
ref={contextMenuRef}
className={styles.contextMenu}
style={{
position: "fixed",
left: contextMenu.x,
top: contextMenu.y,
zIndex: 1000,
}}
>
<div
className={styles.menuItem}
onClick={() => handleTogglePin(contextMenu.session!)}
>
<PushpinOutlined />
{(contextMenu.session.config as any)?.top ? "取消置顶" : "置顶"}
</div>
<div
className={styles.menuItem}
onClick={() => handleEditRemark(contextMenu.session!)}
>
<EditOutlined />
</div>
<div
className={styles.menuItem}
onClick={() => handleDelete(contextMenu.session!)}
>
<DeleteOutlined />
<div className={styles.messageContent}>
{messageFilter(session.content)}
</div>
</div>
</div>
)}
</List.Item>
)}
locale={{
emptyText:
filteredSessions.length === 0 && !syncing ? "暂无会话" : null,
}}
/>
{/* 修改备注Modal */}
<Modal
title="修改备注"
open={editRemarkModal.visible}
onOk={handleSaveRemark}
onCancel={() =>
setEditRemarkModal({
visible: false,
session: null,
remark: "",
})
}
okText="保存"
cancelText="取消"
{/* 右键菜单 */}
{contextMenu.visible && contextMenu.session && (
<div
ref={contextMenuRef}
className={styles.contextMenu}
style={{
position: "fixed",
left: contextMenu.x,
top: contextMenu.y,
zIndex: 1000,
}}
>
<div
className={styles.menuItem}
onClick={() => handleTogglePin(contextMenu.session!)}
>
<Input
value={editRemarkModal.remark}
onChange={e =>
setEditRemarkModal(prev => ({
...prev,
remark: e.target.value,
}))
}
placeholder="请输入备注"
maxLength={20}
/>
</Modal>
</>
<PushpinOutlined />
{(contextMenu.session.config as any)?.top ? "取消置顶" : "置顶"}
</div>
<div
className={styles.menuItem}
onClick={() => handleEditRemark(contextMenu.session!)}
>
<EditOutlined />
</div>
<div
className={styles.menuItem}
onClick={() => handleDelete(contextMenu.session!)}
>
<DeleteOutlined />
</div>
</div>
)}
{/* 修改备注Modal */}
<Modal
title="修改备注"
open={editRemarkModal.visible}
onOk={handleSaveRemark}
onCancel={() =>
setEditRemarkModal({
visible: false,
session: null,
remark: "",
})
}
okText="保存"
cancelText="取消"
>
<Input
value={editRemarkModal.remark}
onChange={e =>
setEditRemarkModal(prev => ({
...prev,
remark: e.target.value,
}))
}
placeholder="请输入备注"
maxLength={20}
/>
</Modal>
</div>
);
};

View File

@@ -48,6 +48,43 @@
font-weight: 500;
font-size: 14px;
color: #262626;
display: flex;
justify-content: space-between;
align-items: center;
gap: 12px;
}
.headerActions {
display: flex;
gap: 8px;
:global(.ant-btn-sm) {
padding: 0 8px;
}
}
.actionButton {
color: #fff !important;
border: none !important;
transition: background-color 0.2s ease;
&:hover,
&:focus {
color: #fff;
opacity: 0.9;
}
}
.currentPageButton {
background-color: #1677ff !important;
}
.allSelectButton {
background-color: #13c2c2 !important;
}
.deselectState {
background-color: #ff7875 !important;
}
.listContent {
@@ -57,6 +94,14 @@
min-height: 0;
}
.selectedList {
.listContent {
flex: unset;
height: 600px;
overflow-y: auto;
}
}
.contactItem,
.selectedItem {
display: flex;

View File

@@ -1,4 +1,4 @@
import React, { useState, useEffect, useMemo } from "react";
import React, { useState, useEffect, useMemo, useCallback } from "react";
import {
Modal,
Input,
@@ -32,6 +32,7 @@ const PopChatRoom: React.FC<PopChatRoomProps> = ({ visible, onCancel }) => {
const [showNameModal, setShowNameModal] = useState(false);
const [chatroomName, setChatroomName] = useState("");
const pageSize = 10;
const MAX_SELECT_COUNT = 50; // 最多选择联系人数量
const { sendCommand } = useWebSocketStore();
const currentUserId = useUserStore(state => state.user?.id) || 0;
const currentCustomer = useCustomerStore(state => state.currentCustomer);
@@ -91,12 +92,115 @@ const PopChatRoom: React.FC<PopChatRoomProps> = ({ visible, onCancel }) => {
return filteredContacts.slice(start, end);
}, [filteredContacts, page]);
const isContactSelected = useCallback(
(contactId: number) => {
return selectedContacts.some(contact => contact.id === contactId);
},
[selectedContacts],
);
const addContactsToSelection = (contacts: Contact[]) => {
setSelectedContacts(prev => {
const existingIds = new Set(prev.map(contact => contact.id));
const additions = contacts.filter(
contact => !existingIds.has(contact.id),
);
if (additions.length === 0) return prev;
return [...prev, ...additions];
});
};
const removeContactsFromSelection = (contacts: Contact[]) => {
if (contacts.length === 0) return;
const removalIds = new Set(contacts.map(contact => contact.id));
setSelectedContacts(prev =>
prev.filter(contact => !removalIds.has(contact.id)),
);
};
const isCurrentPageFullySelected = useMemo(() => {
return (
paginatedContacts.length > 0 &&
paginatedContacts.every(contact => isContactSelected(contact.id))
);
}, [isContactSelected, paginatedContacts]);
const isAllContactsFullySelected = useMemo(() => {
return (
filteredContacts.length > 0 &&
filteredContacts.every(contact => isContactSelected(contact.id))
);
}, [filteredContacts, isContactSelected]);
const handleToggleCurrentPageSelection = () => {
if (isCurrentPageFullySelected) {
removeContactsFromSelection(paginatedContacts);
} else {
const currentSelectedCount = selectedContacts.length;
const remainingSlots = MAX_SELECT_COUNT - currentSelectedCount;
if (remainingSlots <= 0) {
message.warning(`最多只能选择${MAX_SELECT_COUNT}个联系人`);
return;
}
// 获取当前页未选中的联系人
const unselectedContacts = paginatedContacts.filter(
contact => !isContactSelected(contact.id),
);
if (unselectedContacts.length > remainingSlots) {
// 只选择前 remainingSlots 个未选中的联系人
const contactsToAdd = unselectedContacts.slice(0, remainingSlots);
addContactsToSelection(contactsToAdd);
message.warning(
`最多只能选择${MAX_SELECT_COUNT}个联系人,已选择前${remainingSlots}`,
);
} else {
addContactsToSelection(unselectedContacts);
}
}
};
const handleToggleAllContactsSelection = () => {
if (isAllContactsFullySelected) {
removeContactsFromSelection(filteredContacts);
} else {
const currentSelectedCount = selectedContacts.length;
const remainingSlots = MAX_SELECT_COUNT - currentSelectedCount;
if (remainingSlots <= 0) {
message.warning(`最多只能选择${MAX_SELECT_COUNT}个联系人`);
return;
}
if (filteredContacts.length > remainingSlots) {
// 只选择前 remainingSlots 个未选中的联系人
const unselectedContacts = filteredContacts.filter(
contact => !isContactSelected(contact.id),
);
const contactsToAdd = unselectedContacts.slice(0, remainingSlots);
addContactsToSelection(contactsToAdd);
message.warning(
`最多只能选择${MAX_SELECT_COUNT}个联系人,已选择前${remainingSlots}`,
);
} else {
addContactsToSelection(filteredContacts);
}
}
};
// 处理联系人选择
const handleContactSelect = (contact: Contact) => {
setSelectedContacts(prev => {
if (isContactSelected(contact.id)) {
return prev.filter(item => item.id !== contact.id);
}
// 检查是否超过50个限制
if (prev.length >= MAX_SELECT_COUNT) {
message.warning(`最多只能选择${MAX_SELECT_COUNT}个联系人`);
return prev;
}
return [...prev, contact];
});
};
@@ -108,11 +212,6 @@ const PopChatRoom: React.FC<PopChatRoomProps> = ({ visible, onCancel }) => {
);
};
// 检查联系人是否已选择
const isContactSelected = (contactId: number) => {
return selectedContacts.some(contact => contact.id === contactId);
};
// 处理取消
const handleCancel = () => {
setSearchValue("");
@@ -219,6 +318,31 @@ const PopChatRoom: React.FC<PopChatRoomProps> = ({ visible, onCancel }) => {
<div className={styles.contactList}>
<div className={styles.listHeader}>
<span> ({filteredContacts.length})</span>
<div className={styles.headerActions}>
<Button
size="small"
className={`${styles.actionButton} ${styles.currentPageButton} ${
isCurrentPageFullySelected ? styles.deselectState : ""
}`}
onClick={handleToggleCurrentPageSelection}
disabled={loading || paginatedContacts.length === 0}
>
{isCurrentPageFullySelected
? "取消全选当前页"
: "全选当前页"}
</Button>
<Button
size="small"
className={`${styles.actionButton} ${styles.allSelectButton} ${
isAllContactsFullySelected ? styles.deselectState : ""
}`}
onClick={handleToggleAllContactsSelection}
disabled={loading || filteredContacts.length === 0}
>
{isAllContactsFullySelected ? "取消全选所有" : "全选所有"}
</Button>
50
</div>
</div>
<div className={styles.listContent}>
{loading ? (

View File

@@ -18,7 +18,7 @@ export const getAllFriends = async () => {
let hasMore = true;
while (hasMore) {
const result = await getContactList({ page, limit });
const result = await getContactList({ page, limit }, { debounceGap: 0 });
const friendList = result?.list || [];
if (
@@ -56,7 +56,7 @@ export const getAllGroups = async () => {
let hasMore = true;
while (hasMore) {
const result = await getGroupList({ page, limit });
const result = await getGroupList({ page, limit }, { debounceGap: 0 });
const groupList = result?.list || [];
if (!groupList || !Array.isArray(groupList) || groupList.length === 0) {

View File

@@ -54,11 +54,7 @@ const CkboxPage: React.FC = () => {
</div>
) : (
<div className={styles.welcomeScreen}>
<div className={styles.welcomeContent}>
<MessageOutlined style={{ fontSize: 64, color: "#1890ff" }} />
<h2>使</h2>
<p></p>
</div>
<div className={styles.welcomeContent}></div>
</div>
)}
</Content>

View File

@@ -46,6 +46,8 @@ export interface WeChatState {
currentMessagesPageSize: number;
/** 是否还有更多历史消息 */
currentMessagesHasMore: boolean;
/** 当前消息请求ID用于防止跨联系人数据串联 */
currentMessagesRequestId: number;
/** 添加新消息 */
addMessage: (message: ChatRecord) => void;
/** 更新指定消息 */

View File

@@ -18,6 +18,7 @@ import {
getFriendInjectConfig,
} from "@/pages/pc/ckbox/api";
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
import { useWebSocketStore } from "@/store/module/websocket/websocket";
/**
* AI请求防抖管理
@@ -392,13 +393,73 @@ export const manualTriggerAi = async () => {
return false;
}
// 更新AI回复内容
state.updateQuoteMessageContent(messageContent?.content || "");
state.updateIsLoadingAiChat(false);
console.log(
`✅ 手动AI回复成功 [${generationId}]:`,
messageContent?.content,
);
// 获取当前接待类型
const aiType = (currentContract as any)?.aiType || 0; // 0=人工, 1=AI辅助, 2=AI接管
const aiResponseContent = messageContent?.content || "";
const isWechatGroup = !!(currentContract as any)?.chatroomId;
// 根据接待类型处理AI回复
if (aiType === 2 && aiResponseContent) {
// AI接管模式直接发送消息不经过MessageEnter组件
const messageId = +Date.now();
// 构造本地消息对象
const localMessage: ChatRecord = {
id: messageId,
wechatAccountId: currentContract.wechatAccountId,
wechatFriendId: isWechatGroup ? 0 : currentContract.id,
wechatChatroomId: isWechatGroup ? currentContract.id : 0,
tenantId: 0,
accountId: 0,
synergyAccountId: 0,
content: aiResponseContent,
msgType: 1,
msgSubType: 0,
msgSvrId: "",
isSend: true,
createTime: new Date().toISOString(),
isDeleted: false,
deleteTime: "",
sendStatus: 1,
wechatTime: Date.now(),
origin: 0,
msgId: 0,
recalled: false,
seq: messageId,
};
// 添加到消息列表
state.addMessage(localMessage);
// 直接发送消息
const { sendCommand } = useWebSocketStore.getState();
sendCommand("CmdSendMessage", {
wechatAccountId: currentContract.wechatAccountId,
wechatChatroomId: isWechatGroup ? currentContract.id : 0,
wechatFriendId: isWechatGroup ? 0 : currentContract.id,
msgSubType: 0,
msgType: 1,
content: aiResponseContent,
seq: messageId,
});
state.updateIsLoadingAiChat(false);
console.log(
`✅ 手动AI接管模式直接发送消息 [${generationId}]:`,
aiResponseContent,
);
} else if (aiType === 1) {
// AI辅助模式设置quoteMessageContent让MessageEnter组件填充输入框
state.updateQuoteMessageContent(aiResponseContent);
state.updateIsLoadingAiChat(false);
console.log(
`✅ 手动AI辅助模式填充输入框 [${generationId}]:`,
aiResponseContent,
);
} else {
// 其他情况
state.updateIsLoadingAiChat(false);
}
// 清除当前生成ID
currentAiGenerationId = null;
@@ -455,6 +516,7 @@ export const useWeChatStore = create<WeChatState>()(
currentMessagesPage: 1,
currentMessagesPageSize: DEFAULT_MESSAGE_PAGE_SIZE,
currentMessagesHasMore: true,
currentMessagesRequestId: 0,
// ==================== 聊天消息管理方法 ====================
/** 添加新消息到当前聊天 */
@@ -542,6 +604,7 @@ export const useWeChatStore = create<WeChatState>()(
currentMessagesPage: 1,
currentMessagesHasMore: true,
currentMessagesPageSize: DEFAULT_MESSAGE_PAGE_SIZE,
currentMessagesRequestId: 0,
});
},
/** 设置当前联系人并加载相关数据 */
@@ -555,6 +618,7 @@ export const useWeChatStore = create<WeChatState>()(
pendingMessages = [];
const state = useWeChatStore.getState();
const newRequestId = Date.now();
// 切换联系人时清空当前消息,等待重新加载
set({
currentMessages: [],
@@ -562,6 +626,7 @@ export const useWeChatStore = create<WeChatState>()(
currentMessagesHasMore: true,
currentMessagesPageSize: DEFAULT_MESSAGE_PAGE_SIZE,
isLoadingAiChat: false,
currentMessagesRequestId: newRequestId,
});
const params: any = {};
@@ -582,7 +647,10 @@ export const useWeChatStore = create<WeChatState>()(
set({ aiQuoteMessageContent: result });
});
// 注意会话列表的未读数清零在MessageList组件的onContactClick中处理
set({ currentContract: contract });
set({
currentContract: contract,
currentMessagesRequestId: newRequestId,
});
updateConfig({
id: contract.id,
config: { chat: true },
@@ -595,8 +663,10 @@ export const useWeChatStore = create<WeChatState>()(
loadChatMessages: async (Init: boolean, pageOverride?: number) => {
const state = useWeChatStore.getState();
const contact = state.currentContract;
const requestIdAtStart = state.currentMessagesRequestId;
const requestedContactId = contact?.id;
if (!contact) {
if (!contact || !requestedContactId) {
return;
}
@@ -655,22 +725,42 @@ export const useWeChatStore = create<WeChatState>()(
});
}
set(current => ({
currentMessages: Init
? sortedMessages
: [...sortedMessages, ...current.currentMessages],
currentGroupMembers:
Init && isGroup ? nextGroupMembers : current.currentGroupMembers,
currentMessagesPage: paginationMeta.page,
currentMessagesPageSize: paginationMeta.limit,
currentMessagesHasMore: paginationMeta.hasMore,
}));
set(current => {
if (
current.currentMessagesRequestId !== requestIdAtStart ||
!current.currentContract ||
current.currentContract.id !== requestedContactId
) {
return {};
}
return {
currentMessages: Init
? sortedMessages
: [...sortedMessages, ...current.currentMessages],
currentGroupMembers:
Init && isGroup
? nextGroupMembers
: current.currentGroupMembers,
currentMessagesPage: paginationMeta.page,
currentMessagesPageSize: paginationMeta.limit,
currentMessagesHasMore: paginationMeta.hasMore,
};
});
} catch (error) {
console.error("获取聊天消息失败:", error);
} finally {
set({
messagesLoading: false,
isLoadingData: false,
set(current => {
if (
current.currentMessagesRequestId !== requestIdAtStart ||
!current.currentContract ||
current.currentContract.id !== requestedContactId
) {
return {};
}
return {
messagesLoading: false,
isLoadingData: false,
};
});
}
},
@@ -755,9 +845,10 @@ export const useWeChatStore = create<WeChatState>()(
currentMessages: [...state.currentMessages, message],
}));
// 只有文字消息才触发AImsgType === 1
// 只有文字消息才触发AImsgType === 1且必须是对方发送的消息isSend !== true
if (
message.msgType === 1 &&
!message.isSend &&
[1, 2].includes((currentContract as any).aiType || 0)
) {
console.log("📨 收到新消息准备触发AI");
@@ -837,15 +928,85 @@ export const useWeChatStore = create<WeChatState>()(
return;
}
// 附加生成ID到回复内容
set(() => ({
quoteMessageContent: messageContent?.content || "",
isLoadingAiChat: false,
}));
console.log(
`✅ AI回复成功 [${generationId}]:`,
messageContent?.content,
);
// 获取当前接待类型
const aiType = (currentContract as any)?.aiType || 0; // 0=人工, 1=AI辅助, 2=AI接管
const aiResponseContent = messageContent?.content || "";
// 根据接待类型处理AI回复
if (aiType === 2 && aiResponseContent) {
// AI接管模式直接发送消息不经过MessageEnter组件
const messageId = +Date.now();
// 构造本地消息对象
const localMessage: ChatRecord = {
id: messageId,
wechatAccountId: currentContract.wechatAccountId,
wechatFriendId: isWechatGroup ? 0 : currentContract.id,
wechatChatroomId: isWechatGroup
? currentContract.id
: 0,
tenantId: 0,
accountId: 0,
synergyAccountId: 0,
content: aiResponseContent,
msgType: 1,
msgSubType: 0,
msgSvrId: "",
isSend: true,
createTime: new Date().toISOString(),
isDeleted: false,
deleteTime: "",
sendStatus: 1,
wechatTime: Date.now(),
origin: 0,
msgId: 0,
recalled: false,
seq: messageId,
};
// 添加到消息列表
set(state => ({
currentMessages: [
...state.currentMessages,
localMessage,
],
isLoadingAiChat: false,
}));
// 直接发送消息
const { sendCommand } = useWebSocketStore.getState();
sendCommand("CmdSendMessage", {
wechatAccountId: currentContract.wechatAccountId,
wechatChatroomId: isWechatGroup
? currentContract.id
: 0,
wechatFriendId: isWechatGroup ? 0 : currentContract.id,
msgSubType: 0,
msgType: 1,
content: aiResponseContent,
seq: messageId,
});
console.log(
`✅ AI接管模式直接发送消息 [${generationId}]:`,
aiResponseContent,
);
} else if (aiType === 1) {
// AI辅助模式设置quoteMessageContent让MessageEnter组件填充输入框
set(() => ({
quoteMessageContent: aiResponseContent,
isLoadingAiChat: false,
}));
console.log(
`✅ AI辅助模式填充输入框 [${generationId}]:`,
aiResponseContent,
);
} else {
// 其他情况
set(() => ({
isLoadingAiChat: false,
}));
}
// 清除当前生成ID
currentAiGenerationId = null;

View File

@@ -6,19 +6,26 @@ import { Messages } from "./msg.data";
import { db } from "@/utils/db";
import { Modal } from "antd";
import { useCustomerStore, updateCustomerList } from "../weChat/customer";
import { dataProcessing } from "@/api/ai";
// 消息处理器类型定义
type MessageHandler = (message: WebSocketMessage) => void;
const addMessage = useWeChatStore.getState().addMessage;
const recallMessage = useWeChatStore.getState().recallMessage;
const receivedMsg = useWeChatStore.getState().receivedMsg;
const findMessageBySeq = useWeChatStore.getState().findMessageBySeq;
const findMessageById = useWeChatStore.getState().findMessageById;
const updateMessage = useWeChatStore.getState().updateMessage;
const updateMomentCommonLoading =
useWeChatStore.getState().updateMomentCommonLoading;
const addMomentCommon = useWeChatStore.getState().addMomentCommon;
const setFileDownloadUrl = useWeChatStore.getState().setFileDownloadUrl;
const setFileDownloading = useWeChatStore.getState().setFileDownloading;
// 延迟获取 store 方法,避免循环依赖问题
const getWeChatStoreMethods = () => {
const state = useWeChatStore.getState();
return {
addMessage: state.addMessage,
recallMessage: state.recallMessage,
receivedMsg: state.receivedMsg,
findMessageBySeq: state.findMessageBySeq,
findMessageById: state.findMessageById,
updateMessage: state.updateMessage,
updateMomentCommonLoading: state.updateMomentCommonLoading,
addMomentCommon: state.addMomentCommon,
setFileDownloadUrl: state.setFileDownloadUrl,
setFileDownloading: state.setFileDownloading,
};
};
// 消息处理器映射
const messageHandlers: Record<string, MessageHandler> = {
// 微信账号存活状态响应
@@ -45,7 +52,9 @@ const messageHandlers: Record<string, MessageHandler> = {
updateCustomerList(updatedCustomerList);
},
// 发送消息响应
CmdSendMessageResp: message => {
CmdSendMessageResp: (message: Messages) => {
const { findMessageBySeq, updateMessage } = getWeChatStoreMethods();
const msg = findMessageBySeq(message.seq);
if (msg) {
updateMessage(message.seq, {
@@ -53,11 +62,23 @@ const messageHandlers: Record<string, MessageHandler> = {
id: message.friendMessage?.id || message.chatroomMessage?.id,
});
}
//异步传新消息给数据库
goAsyncServiceData(message);
},
CmdSendMessageResult: message => {
const { updateMessage } = getWeChatStoreMethods();
updateMessage(message.friendMessageId || message.chatroomMessageId, {
sendStatus: 0,
});
// 最终消息同步处理
dataProcessing({
chatroomMessageId: message.chatroomMessageId,
friendMessageId: message.friendMessageId,
sendStatus: message.sendStatus,
type: "CmdSendMessageResult",
wechatAccountId: 1,
wechatTime: message.wechatTime,
});
},
// 接收消息响应
CmdReceiveMessageResp: message => {
@@ -68,8 +89,10 @@ const messageHandlers: Record<string, MessageHandler> = {
//收到消息
CmdNewMessage: (message: Messages) => {
// 处理消息本身
const { receivedMsg } = getWeChatStoreMethods();
receivedMsg(message.friendMessage || message.chatroomMessage);
//异步传新消息给数据库
goAsyncServiceData(message);
// 触发会话列表更新事件
const msgData = message.friendMessage || message.chatroomMessage;
if (msgData) {
@@ -107,6 +130,7 @@ const messageHandlers: Record<string, MessageHandler> = {
// setVideoUrl(message.friendMessageId, message.url);
},
CmdDownloadFileResult: message => {
const { setFileDownloadUrl, setFileDownloading } = getWeChatStoreMethods();
const messageId = message.friendMessageId || message.chatroomMessageId;
if (!messageId) {
@@ -124,6 +148,8 @@ const messageHandlers: Record<string, MessageHandler> = {
},
CmdFetchMomentResult: message => {
const { addMomentCommon, updateMomentCommonLoading } =
getWeChatStoreMethods();
addMomentCommon(message.result);
updateMomentCommonLoading(false);
},
@@ -131,7 +157,7 @@ const messageHandlers: Record<string, MessageHandler> = {
CmdNotify: async (message: WebSocketMessage) => {
console.log("通知消息", message);
// 在这里添加具体的处理逻辑
if (message.notify == "Auth failed") {
if (["Auth failed", "Kicked out"].includes(message.notify)) {
// 避免重复弹窗
if ((window as any).__CKB_AUTH_FAILED_SHOWN__) {
return;
@@ -162,16 +188,18 @@ const messageHandlers: Record<string, MessageHandler> = {
//撤回消息
CmdMessageRecalled: message => {
const { recallMessage } = getWeChatStoreMethods();
const MessageId = message.friendMessageId || message.chatroomMessageId;
recallMessage(MessageId);
},
CmdVoiceToTextResult: message => {
const { findMessageById, updateMessage } = getWeChatStoreMethods();
const msg = findMessageById(
message.friendMessageId || message.chatroomMessageId,
);
const content = JSON.parse(msg.content);
if (msg) {
const content = JSON.parse(msg.content);
updateMessage(msg.id, {
content: JSON.stringify({
...content,
@@ -180,8 +208,21 @@ const messageHandlers: Record<string, MessageHandler> = {
});
}
},
// 可以继续添加更多处理器...
};
//消息异步同步
const goAsyncServiceData = (message: Messages) => {
const chatroomMessages = message.chatroomMessage
? [message.chatroomMessage]
: null;
const friendMessages = message.friendMessage ? [message.friendMessage] : null;
dataProcessing({
chatroomMessage: chatroomMessages,
friendMessage: friendMessages,
type: "CmdNewMessage",
wechatAccountId:
message.friendMessage?.wechatAccountId ||
message.chatroomMessage?.wechatAccountId,
});
};
// 默认处理器

View File

@@ -2,7 +2,6 @@ import { createPersistStore } from "@/store/createPersistStore";
import { useUserStore } from "../user";
import { useCkChatStore } from "@/store/module/ckchat/ckchat";
import { useCustomerStore } from "@/store/module/weChat/customer";
const { getAccountId } = useCkChatStore.getState();
import { msgManageCore } from "./msgManage";
// WebSocket消息类型
export interface WebSocketMessage {
@@ -141,6 +140,7 @@ export const useWebSocketStore = createPersistStore<WebSocketState>(
}
// 构建WebSocket URL
const { getAccountId } = useCkChatStore.getState();
const params = new URLSearchParams({
client: fullConfig.client.toString(),
accountId: getAccountId().toString(),
@@ -330,6 +330,7 @@ export const useWebSocketStore = createPersistStore<WebSocketState>(
// console.log("WebSocket连接成功");
const { token2 } = useUserStore.getState();
const { getAccountId } = useCkChatStore.getState();
// 发送登录命令
if (currentState.config) {
currentState.sendCommand("CmdSignIn", {
@@ -350,36 +351,6 @@ export const useWebSocketStore = createPersistStore<WebSocketState>(
_handleMessage: (event: MessageEvent) => {
try {
const data = JSON.parse(event.data);
// console.log("收到WebSocket消息:", data);
// 处理特定的通知消息
if (data.cmdType === "CmdNotify") {
// 处理Auth failed通知
if (data.notify === "Auth failed" || data.notify === "Kicked out") {
// console.error(`WebSocket ${data.notify},断开连接`);
// Toast.show({
// content: `WebSocket ${data.notify},断开连接`,
// position: "top",
// });
// 禁用自动重连
if (get().config) {
set({
config: {
...get().config!,
autoReconnect: false,
},
});
}
// 停止客服状态查询定时器
get()._stopAliveStatusTimer();
// 断开连接
get().disconnect();
return;
}
}
const currentState = get();
const newMessage: WebSocketMessage = {

View File

@@ -40,6 +40,7 @@ export class ContactManager {
/**
* 搜索联系人
* 支持搜索昵称、备注名、微信号
*/
static async searchContacts(
userId: number,
@@ -52,8 +53,11 @@ export class ContactManager {
return contacts.filter(contact => {
const nickname = (contact.nickname || "").toLowerCase();
const conRemark = (contact.conRemark || "").toLowerCase();
const wechatId = (contact.wechatId || "").toLowerCase();
return (
nickname.includes(lowerKeyword) || conRemark.includes(lowerKeyword)
nickname.includes(lowerKeyword) ||
conRemark.includes(lowerKeyword) ||
wechatId.includes(lowerKeyword)
);
});
} catch (error) {

View File

@@ -231,6 +231,8 @@ export class MessageManager {
"phone",
"region",
"extendFields",
"wechatId", // 添加wechatId比较
"alias", // 添加alias比较
];
for (const field of fieldsToCompare) {
@@ -257,6 +259,8 @@ export class MessageManager {
* 增量同步会话数据
* @param userId 用户ID
* @param serverData 服务器数据
* @param options 同步选项
* @param options.skipDelete 是否跳过删除检查(用于分页增量同步)
* @returns 同步结果统计
*/
static async syncSessions(
@@ -265,6 +269,9 @@ export class MessageManager {
friends?: ContractData[];
groups?: weChatGroup[];
},
options?: {
skipDelete?: boolean; // 是否跳过删除检查(用于分页增量同步)
},
): Promise<{
added: number;
updated: number;
@@ -321,10 +328,12 @@ export class MessageManager {
}
}
// 检查删除
for (const localSession of localSessions) {
if (!serverSessionMap.has(localSession.serverId)) {
toDelete.push(localSession.serverId);
// 检查删除(仅在非增量同步模式下执行)
if (!options?.skipDelete) {
for (const localSession of localSessions) {
if (!serverSessionMap.has(localSession.serverId)) {
toDelete.push(localSession.serverId);
}
}
}
@@ -650,7 +659,7 @@ export class MessageManager {
updatedSession.sortKey = this.generateSortKey(updatedSession);
await chatSessionService.update(serverId, updatedSession);
console.log(`会话时间已更新: ${serverId} -> ${newTime}`);
await this.triggerCallbacks(userId);
}
} catch (error) {
console.error("更新会话时间失败:", error);
@@ -821,7 +830,7 @@ export class MessageManager {
};
await chatSessionService.create(sessionWithSortKey);
console.log(`创建新会话: ${session.nickname || session.wechatId}`);
await this.triggerCallbacks(userId);
} catch (error) {
console.error("创建会话失败:", error);
throw error;