feat: 增加小七端配置
This commit is contained in:
@@ -76,7 +76,7 @@ yarn switch-client zhinian
|
||||
|
||||
## 多客户端配置
|
||||
|
||||
根目录 `client-configs.json` 保存多客户端配置:`zhinian`、`nianhelper`、`duohua`、`tianmu`。当前 `src/constant/base.js` 的 `getCurrentConfig()` 返回 `CLIENT_CONFIGS.zhinian`。
|
||||
根目录 `client-configs.json` 保存多客户端配置:`zhinian`、`nianhelper`、`xiaoqi`、`duohua`、`tianmu`。当前 `src/constant/base.js` 的 `getCurrentConfig()` 返回 `CLIENT_CONFIGS.zhinian`。
|
||||
|
||||
切换客户配置请使用:
|
||||
|
||||
|
||||
@@ -25,6 +25,19 @@
|
||||
"theme-color-50": "#EEF8FF"
|
||||
}
|
||||
},
|
||||
"xiaoqi": {
|
||||
"clientId": "6",
|
||||
"appId": "wx5e79df5996572539",
|
||||
"name": "小七",
|
||||
"logo": "https://one-feel-config-images-bucket.oss-cn-chengdu.aliyuncs.com/20260526103118_416_809.png",
|
||||
"theme": {
|
||||
"theme-color-800": "#0B7034",
|
||||
"theme-color-700": "#0B5C2D",
|
||||
"theme-color-500": "#0CCD58",
|
||||
"theme-color-100": "#E8FFF1",
|
||||
"theme-color-50": "#F0F8F3"
|
||||
}
|
||||
},
|
||||
"duohua": {
|
||||
"clientId": "2",
|
||||
"appId": "wx23f86d809ae80259",
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
"name": "念念",
|
||||
"logo": "https://oss.nianxx.cn/mp/static/version_101/login/dh_logo.png"
|
||||
},
|
||||
"xiaoqi": {
|
||||
"clientId": "6",
|
||||
"appId": "wx5e79df5996572539",
|
||||
"name": "小七",
|
||||
"logo": "https://one-feel-config-images-bucket.oss-cn-chengdu.aliyuncs.com/20260526103118_416_809.png"
|
||||
},
|
||||
"duohua": {
|
||||
"clientId": "2",
|
||||
"appId": "wx23f86d809ae80259",
|
||||
@@ -41,6 +47,7 @@
|
||||
| 客户端名称 | 显示名称 | AppID |
|
||||
| ------------ | -------- | ------------------ |
|
||||
| `zhinian` | 智念 | wx5e79df5996572539 |
|
||||
| `xiaoqi` | 小七 | wx5e79df5996572539 |
|
||||
| `duohua` | 朵花 | wx23f86d809ae80259 |
|
||||
| `tianmu` | 天沐 | wx0be424e1d22065a9 |
|
||||
| `nianhelper` | 念念 | wx6fcf7b3db3deee6c |
|
||||
@@ -56,6 +63,9 @@ npm run switch-client zhinian
|
||||
# 切换到念念助手客户端
|
||||
npm run switch-client nianhelper
|
||||
|
||||
# 切换到小七客户端
|
||||
npm run switch-client xiaoqi
|
||||
|
||||
# 切换到朵花客户端
|
||||
npm run switch-client duohua
|
||||
|
||||
@@ -142,7 +152,7 @@ node scripts/update-appid.js tianmu
|
||||
A: 请确保在项目根目录执行脚本,并检查文件路径是否正确。
|
||||
|
||||
**Q: 脚本提示不支持的客户端名称怎么办?**
|
||||
A: 请检查输入的客户端名称是否正确,支持的客户端名称有:zhinian、duohua、tianmu。
|
||||
A: 请检查输入的客户端名称是否正确,支持的客户端名称会从 `client-configs.json` 自动读取。
|
||||
|
||||
**Q: 如何恢复到之前的配置?**
|
||||
A: 可以使用版本控制系统恢复,或者再次运行脚本切换到其他客户端配置。
|
||||
|
||||
@@ -12,7 +12,7 @@ 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.xiaoqi;
|
||||
export const clientId = getCurrentConfig().clientId;
|
||||
export const appId = getCurrentConfig().appId;
|
||||
|
||||
@@ -20,6 +20,8 @@ export const appId = getCurrentConfig().appId;
|
||||
export const ClientType = {
|
||||
// 智念
|
||||
ZHINIAN: "ZHINIAN",
|
||||
// 小七
|
||||
XIAOQI: "XIAOQI",
|
||||
// 朵花
|
||||
DUOHUA: "DUOHUA",
|
||||
// 天沐
|
||||
@@ -33,6 +35,8 @@ export const currentClientType = () => {
|
||||
switch (getCurrentConfig().name) {
|
||||
case "念念":
|
||||
return ClientType.ZHINIAN;
|
||||
case "小七":
|
||||
return ClientType.XIAOQI;
|
||||
case "朵朵":
|
||||
return ClientType.DUOHUA;
|
||||
case "沐沐":
|
||||
|
||||
10
src/uni.scss
10
src/uni.scss
@@ -13,11 +13,11 @@
|
||||
*/
|
||||
|
||||
/* 主题颜色(由 switch-client 命令自动更新) */
|
||||
$theme-color-800: #174BB6;
|
||||
$theme-color-700: #145EE1;
|
||||
$theme-color-500: #2D91FF;
|
||||
$theme-color-100: #D9EEFF;
|
||||
$theme-color-50: #EEF8FF;
|
||||
$theme-color-800: #0B7034;
|
||||
$theme-color-700: #0B5C2D;
|
||||
$theme-color-500: #0CCD58;
|
||||
$theme-color-100: #E8FFF1;
|
||||
$theme-color-50: #F0F8F3;
|
||||
|
||||
// text 颜色
|
||||
$text-color-900: #181B25;
|
||||
|
||||
Reference in New Issue
Block a user