feat: 增加智念助手端

This commit is contained in:
2026-04-19 10:18:15 +08:00
parent 8ea6546f04
commit d49bf738f8
3 changed files with 45 additions and 16 deletions

View File

@@ -1,22 +1,21 @@
/**
* 客户端配置管理模块
*
*
* 功能说明:
* 所有配置从根目录的 client-configs.json 文件中读取
*/
// 直接导入配置文件
import rawConfigs from '../../client-configs.json' with { type: 'json' };
import rawConfigs from "../../client-configs.json" with { type: "json" };
// 所有用户端的配置 - 处理后的配置
export const CLIENT_CONFIGS = rawConfigs;
// 获取当前用户端配置
export const getCurrentConfig = () => CLIENT_CONFIGS.zhinian;
export const getCurrentConfig = () => CLIENT_CONFIGS.nianhelper;
export const clientId = getCurrentConfig().clientId;
export const appId = getCurrentConfig().appId;
/// 客户端类型
export const ClientType = {
// 智念
@@ -25,17 +24,21 @@ export const ClientType = {
DUOHUA: "DUOHUA",
// 天沐
TIANMU: "TIANMU",
// 念念助手
NIANHELPER: "NIANHELPER",
};
/// 获取当前客户端类型
export const currentClientType = () => {
switch (getCurrentConfig().name) {
case '智念':
case "智念":
return ClientType.ZHINIAN;
case '朵朵':
case "朵朵":
return ClientType.DUOHUA;
case '沐沐':
case "沐沐":
return ClientType.TIANMU;
case "念念":
return ClientType.NIANHELPER;
default:
return ClientType.ZHINIAN;
}