refactor: standardize import paths and clean up unused code

Migrate legacy relative API imports to consistent absolute @/api paths across all components
Remove unnecessary .js file extensions from ES module imports
Add new StreamManager utility and base client configuration constants file
Clean up unused imports and dynamic config calls in ChatGuide and ChatInputArea components
Update the index.html page title to "nianxx"
Replace dynamic OSS URL and local text imports in ChatGuide with hardcoded static values
This commit is contained in:
duanshuwen
2026-05-27 07:35:28 +08:00
parent 1a5a2ae6a9
commit dd36ccc118
13 changed files with 138 additions and 27 deletions

59
src/constants/base.ts Normal file
View File

@@ -0,0 +1,59 @@
/**
* 客户端配置管理模块
*
* 功能说明:
* 所有配置从根目录的 client-configs.json 文件中读取
*/
// 获取当前用户端配置
export const getCurrentConfig = () => {
return {
clientId: "6",
appId: "wx5e79df5996572539",
name: "小七",
theme: {
"theme-color-800": "#0B7034",
"theme-color-700": "#0B5C2D",
"theme-color-500": "#0CCD58",
"theme-color-100": "#E8FFF1",
"theme-color-50": "#F0F8F3",
},
};
};
export const clientId = getCurrentConfig().clientId;
export const appId = getCurrentConfig().appId;
/// 客户端类型
export const ClientType = {
// 智念
ZHINIAN: "ZHINIAN",
// 小七
XIAOQI: "XIAOQI",
// 朵花
DUOHUA: "DUOHUA",
// 天沐
TIANMU: "TIANMU",
// 念念助手
NIANHELPER: "NIANHELPER",
};
/// 获取当前客户端类型
export const currentClientType = () => {
switch (getCurrentConfig().name) {
case "念念":
return ClientType.ZHINIAN;
case "小七":
return ClientType.XIAOQI;
case "朵朵":
return ClientType.DUOHUA;
case "沐沐":
return ClientType.TIANMU;
case "念念助手":
return ClientType.NIANHELPER;
default:
return ClientType.ZHINIAN;
}
};
// 环境配置 - 智念客户端使用测试环境,其他客户端使用生产环境
export const isZhiNian = true;