feat: 增加智念助手端
This commit is contained in:
@@ -24,6 +24,31 @@
|
|||||||
"theme-color-50": "#F0F8F3"
|
"theme-color-50": "#F0F8F3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nianhelper": {
|
||||||
|
"clientId": "11",
|
||||||
|
"appId": "wx6fcf7b3db3deee6c",
|
||||||
|
"name": "念念",
|
||||||
|
"placeholder": "快告诉念念您在想什么~",
|
||||||
|
"loginDesc": "您好,欢迎来到智念科技",
|
||||||
|
"logo": "https://oss.nianxx.cn/mp/static/version_101/login/dh_logo.png",
|
||||||
|
"ipLargeImage": "https://oss.nianxx.cn/mp/static/version_101/zn/zn_large.png",
|
||||||
|
"ipLargeImageWidth": 395,
|
||||||
|
"ipLargeImageHeight": 335,
|
||||||
|
"ipLargeTotalFrames": 71,
|
||||||
|
"ipLargeColumns": 1,
|
||||||
|
"ipSmallImage": "https://oss.nianxx.cn/mp/static/version_101/dh/dh_small.png",
|
||||||
|
"ipSmallImageWidth": 128,
|
||||||
|
"ipSmallImageHeight": 128,
|
||||||
|
"ipSmallTotalFrames": 117,
|
||||||
|
"ipSmallColumns": 1,
|
||||||
|
"theme": {
|
||||||
|
"theme-color-800": "#0B7034",
|
||||||
|
"theme-color-700": "#0B5C2D",
|
||||||
|
"theme-color-500": "#0CCD58",
|
||||||
|
"theme-color-100": "#E8FFF1",
|
||||||
|
"theme-color-50": "#F0F8F3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"duohua": {
|
"duohua": {
|
||||||
"clientId": "2",
|
"clientId": "2",
|
||||||
"appId": "wx23f86d809ae80259",
|
"appId": "wx23f86d809ae80259",
|
||||||
@@ -74,4 +99,4 @@
|
|||||||
"theme-color-50": "#EEF8FF"
|
"theme-color-50": "#EEF8FF"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,12 @@
|
|||||||
|
|
||||||
## 支持的客户端
|
## 支持的客户端
|
||||||
|
|
||||||
| 客户端名称 | 显示名称 | AppID |
|
| 客户端名称 | 显示名称 | AppID |
|
||||||
| ---------- | -------- | ------------------ |
|
| ------------ | -------- | ------------------ |
|
||||||
| `zhinian` | 智念 | wx5e79df5996572539 |
|
| `zhinian` | 智念 | wx5e79df5996572539 |
|
||||||
| `duohua` | 朵花 | wx23f86d809ae80259 |
|
| `duohua` | 朵花 | wx23f86d809ae80259 |
|
||||||
| `tianmu` | 天沐 | wx0be424e1d22065a9 |
|
| `tianmu` | 天沐 | wx0be424e1d22065a9 |
|
||||||
|
| `nianhelper` | 念念 | wx6fcf7b3db3deee6c |
|
||||||
|
|
||||||
## 使用方法
|
## 使用方法
|
||||||
|
|
||||||
@@ -58,6 +59,9 @@
|
|||||||
# 切换到智念客户端
|
# 切换到智念客户端
|
||||||
npm run switch-client zhinian
|
npm run switch-client zhinian
|
||||||
|
|
||||||
|
# 切换到念念助手客户端
|
||||||
|
npm run switch-client nianhelper
|
||||||
|
|
||||||
# 切换到朵花客户端
|
# 切换到朵花客户端
|
||||||
npm run switch-client duohua
|
npm run switch-client duohua
|
||||||
|
|
||||||
@@ -85,17 +89,14 @@ node scripts/update-appid.js tianmu
|
|||||||
## 更新的文件
|
## 更新的文件
|
||||||
|
|
||||||
1. **src/manifest.json**
|
1. **src/manifest.json**
|
||||||
|
|
||||||
- 更新 `mp-weixin.appid` 字段
|
- 更新 `mp-weixin.appid` 字段
|
||||||
- 保持文件中的注释不变
|
- 保持文件中的注释不变
|
||||||
|
|
||||||
2. **project.config.json**
|
2. **project.config.json**
|
||||||
|
|
||||||
- 更新根级别的 `appid` 字段
|
- 更新根级别的 `appid` 字段
|
||||||
- 保持 JSON 格式化
|
- 保持 JSON 格式化
|
||||||
|
|
||||||
3. **src/constant/base.js**
|
3. **src/constant/base.js**
|
||||||
|
|
||||||
- 更新 `getCurrentConfig()` 函数返回的客户端配置
|
- 更新 `getCurrentConfig()` 函数返回的客户端配置
|
||||||
|
|
||||||
4. **client-configs.json**
|
4. **client-configs.json**
|
||||||
|
|||||||
@@ -1,22 +1,21 @@
|
|||||||
/**
|
/**
|
||||||
* 客户端配置管理模块
|
* 客户端配置管理模块
|
||||||
*
|
*
|
||||||
* 功能说明:
|
* 功能说明:
|
||||||
* 所有配置从根目录的 client-configs.json 文件中读取
|
* 所有配置从根目录的 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 CLIENT_CONFIGS = rawConfigs;
|
||||||
|
|
||||||
// 获取当前用户端配置
|
// 获取当前用户端配置
|
||||||
export const getCurrentConfig = () => CLIENT_CONFIGS.zhinian;
|
export const getCurrentConfig = () => CLIENT_CONFIGS.nianhelper;
|
||||||
export const clientId = getCurrentConfig().clientId;
|
export const clientId = getCurrentConfig().clientId;
|
||||||
export const appId = getCurrentConfig().appId;
|
export const appId = getCurrentConfig().appId;
|
||||||
|
|
||||||
|
|
||||||
/// 客户端类型
|
/// 客户端类型
|
||||||
export const ClientType = {
|
export const ClientType = {
|
||||||
// 智念
|
// 智念
|
||||||
@@ -25,17 +24,21 @@ export const ClientType = {
|
|||||||
DUOHUA: "DUOHUA",
|
DUOHUA: "DUOHUA",
|
||||||
// 天沐
|
// 天沐
|
||||||
TIANMU: "TIANMU",
|
TIANMU: "TIANMU",
|
||||||
|
// 念念助手
|
||||||
|
NIANHELPER: "NIANHELPER",
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 获取当前客户端类型
|
/// 获取当前客户端类型
|
||||||
export const currentClientType = () => {
|
export const currentClientType = () => {
|
||||||
switch (getCurrentConfig().name) {
|
switch (getCurrentConfig().name) {
|
||||||
case '智念':
|
case "智念":
|
||||||
return ClientType.ZHINIAN;
|
return ClientType.ZHINIAN;
|
||||||
case '朵朵':
|
case "朵朵":
|
||||||
return ClientType.DUOHUA;
|
return ClientType.DUOHUA;
|
||||||
case '沐沐':
|
case "沐沐":
|
||||||
return ClientType.TIANMU;
|
return ClientType.TIANMU;
|
||||||
|
case "念念":
|
||||||
|
return ClientType.NIANHELPER;
|
||||||
default:
|
default:
|
||||||
return ClientType.ZHINIAN;
|
return ClientType.ZHINIAN;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user