@qmuse/qmuse-cli 1.0.5-dev.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +12 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -66,6 +66,17 @@ const str = (f, k) => {
|
|
|
66
66
|
const v = f[k];
|
|
67
67
|
return typeof v === 'string' ? v : undefined;
|
|
68
68
|
};
|
|
69
|
+
/** 封网期间为已知租户提供稳定的产品展示名,服务端配置恢复后仍可兼容其返回值。 */
|
|
70
|
+
const TENANT_DISPLAY_NAMES = new Map([
|
|
71
|
+
['A_BAO_PC', '智能体涌现奖大赛账号'],
|
|
72
|
+
['A_BAO', '阿宝'],
|
|
73
|
+
]);
|
|
74
|
+
function tenantDisplayName(tenantCode, tenantName) {
|
|
75
|
+
const code = tenantCode?.trim();
|
|
76
|
+
return (code ? TENANT_DISPLAY_NAMES.get(code) : undefined) ||
|
|
77
|
+
tenantName?.trim() ||
|
|
78
|
+
(code ? '企业专属版' : 'QMuse');
|
|
79
|
+
}
|
|
69
80
|
const num = (f, key, def) => {
|
|
70
81
|
const v = str(f, key);
|
|
71
82
|
const n = v === undefined ? def : Number(v);
|
|
@@ -655,8 +666,7 @@ async function cmdWhoami(flags) {
|
|
|
655
666
|
fail(`查询当前用户失败: ${result.errorMessage ?? result.errorCode ?? `HTTP ${result.status}`}`);
|
|
656
667
|
}
|
|
657
668
|
const currentUser = result.data;
|
|
658
|
-
const tenantName = currentUser.tenantName
|
|
659
|
-
(currentUser.tenantCode ? '企业专属版' : 'QMuse');
|
|
669
|
+
const tenantName = tenantDisplayName(currentUser.tenantCode, currentUser.tenantName);
|
|
660
670
|
if (flags['--json'] === true) {
|
|
661
671
|
output({
|
|
662
672
|
apiBaseUrl,
|