cloudcc-cli 2.2.2 → 2.2.3

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.
@@ -0,0 +1,256 @@
1
+ /**
2
+ * CloudCC 开发环境搭建知识库
3
+ *
4
+ * 自动生成的文件,请勿手动修改
5
+ * 生成时间: 2025-12-04T11:10:21.433Z
6
+ * 来源: https://dev-help.cloudcc.cn/devlearn01/huan-jing-da-jian/
7
+ */
8
+
9
+ const metadata = {
10
+ "title": "CloudCC 开发环境搭建指南",
11
+ "description": "详细的开发环境配置教程,涵盖 Node.js、npm、VS Code 等必要工具的安装与配置",
12
+ "sourceUrl": "https://dev-help.cloudcc.cn/devlearn01/huan-jing-da-jian/",
13
+ "generatedAt": "2025-12-04T11:10:21.433Z",
14
+ "version": "1.0.0"
15
+ };
16
+
17
+ const steps = [
18
+ {
19
+ "number": 1,
20
+ "title": "安装node",
21
+ "description": "版本检查,打开控制台,输入以下命令:",
22
+ "content": "<pre><code>下载地址 https://nodejs.org/download/release/v20.19.5/\n\n推荐使用:nvm node多版本管理工具</code></pre>\n<p>版本检查,打开控制台,输入以下命令:</p>\n<pre><code>node -v</code></pre>",
23
+ "keywords": [
24
+ "node"
25
+ ],
26
+ "commands": [
27
+ {
28
+ "command": "下载地址 https://nodejs.org/download/release/v20.19.5/\n\n推荐使用:nvm node多版本管理工具",
29
+ "platform": "all",
30
+ "description": "执行命令"
31
+ },
32
+ {
33
+ "command": "node -v",
34
+ "platform": "all",
35
+ "description": "检查 Node.js 版本"
36
+ }
37
+ ],
38
+ "references": [],
39
+ "difficulty": "medium",
40
+ "estimatedTime": 10
41
+ },
42
+ {
43
+ "number": 2,
44
+ "title": "切换npm源",
45
+ "description": "为了加速安装依赖,将npm源地址切换为阿里源,打开控制台,输入以下命令: 检查是否设置成功,在控制台中输入以下命令:",
46
+ "content": "<p>为了加速安装依赖,将npm源地址切换为阿里源,打开控制台,输入以下命令:</p>\n<pre><code>npm config set registry https://registry.npmmirror.com</code></pre>\n<p>检查是否设置成功,在控制台中输入以下命令:</p>\n<pre><code>npm config get registry</code></pre>",
47
+ "keywords": [
48
+ "npm",
49
+ "registry"
50
+ ],
51
+ "commands": [
52
+ {
53
+ "command": "npm config set registry https://registry.npmmirror.com",
54
+ "platform": "all",
55
+ "description": "设置 npm 源地址"
56
+ },
57
+ {
58
+ "command": "npm config get registry",
59
+ "platform": "all",
60
+ "description": "验证 npm 源设置"
61
+ }
62
+ ],
63
+ "references": [],
64
+ "difficulty": "easy",
65
+ "estimatedTime": 5
66
+ },
67
+ {
68
+ "number": 3,
69
+ "title": "安装全局依赖",
70
+ "description": "检查是否安装成功,控制台输入以下命令: 检查是否安装成功,控制台输入以下命令:",
71
+ "content": "<pre><code>npm install -g cloudcc-cli</code></pre>\n<p>检查是否安装成功,控制台输入以下命令:</p>\n<pre><code>npm ls -g --depth=0</code></pre>\n<pre><code>sudo npm install -g cloudcc-cli</code></pre>\n<p>检查是否安装成功,控制台输入以下命令:</p>\n<pre><code>sudo npm ls -g --depth=0</code></pre>",
72
+ "keywords": [
73
+ "dependencies"
74
+ ],
75
+ "commands": [
76
+ {
77
+ "command": "npm install -g cloudcc-cli",
78
+ "platform": "all",
79
+ "description": "安装全局依赖包"
80
+ },
81
+ {
82
+ "command": "npm ls -g --depth=0",
83
+ "platform": "all",
84
+ "description": "检查全局安装的包"
85
+ },
86
+ {
87
+ "command": "sudo npm install -g cloudcc-cli",
88
+ "platform": "macos",
89
+ "description": "安装全局依赖包"
90
+ },
91
+ {
92
+ "command": "sudo npm ls -g --depth=0",
93
+ "platform": "macos",
94
+ "description": "检查全局安装的包"
95
+ }
96
+ ],
97
+ "references": [],
98
+ "difficulty": "medium",
99
+ "estimatedTime": 15,
100
+ "subSteps": [
101
+ {
102
+ "title": "3.1 window用户:打开控制台输入以下命令",
103
+ "description": "",
104
+ "commands": [],
105
+ "notes": []
106
+ },
107
+ {
108
+ "title": "3.2 MacOS用户:打开控制台输入以下命令",
109
+ "description": "",
110
+ "commands": [],
111
+ "notes": []
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ "number": 4,
117
+ "title": "安装vs-code",
118
+ "description": "安装vs-code",
119
+ "content": "<pre><code>下载地址:https://code.visualstudio.com/download</code></pre>",
120
+ "keywords": [
121
+ "vscode"
122
+ ],
123
+ "commands": [
124
+ {
125
+ "command": "下载地址:https://code.visualstudio.com/download",
126
+ "platform": "all",
127
+ "description": "执行命令"
128
+ }
129
+ ],
130
+ "references": [],
131
+ "difficulty": "medium",
132
+ "estimatedTime": 5
133
+ },
134
+ {
135
+ "number": 5,
136
+ "title": "安装vs-code插件:CloudCC",
137
+ "description": "安装vs-code插件:CloudCC",
138
+ "content": "<ul><li>打开安装完成的vs code,点击扩展图标</li></ul>\n<ul><li>输入CloudCC,选择安装</li></ul>",
139
+ "keywords": [
140
+ "vscode",
141
+ "plugin"
142
+ ],
143
+ "commands": [],
144
+ "references": [],
145
+ "difficulty": "easy",
146
+ "estimatedTime": 5
147
+ },
148
+ {
149
+ "number": 6,
150
+ "title": "创建模版项目",
151
+ "description": "打开控制台,进入您的开发目录,比如Docments,运行创建项目命令: 浏览器访问:http://localhost:8080/,可以看到以下页面",
152
+ "content": "<p>打开控制台,进入您的开发目录,比如Docments,运行创建项目命令:</p>\n<pre><code>cc create project demo1</code></pre>\n<ul><li>使用vs code打开项目</li></ul>\n<ul><li>选择菜单里中的:终端——新建终端</li></ul>\n<ul><li>安装依赖:在打开的终端里输入以下命令:</li></ul>\n<pre><code>npm i</code></pre>\n<ul><li>安装完成后,运行项目,在终端中执行命令</li></ul>\n<pre><code>npm run serve</code></pre>\n<p>浏览器访问:http://localhost:8080/,可以看到以下页面</p>",
153
+ "keywords": [],
154
+ "commands": [
155
+ {
156
+ "command": "cc create project demo1",
157
+ "platform": "all",
158
+ "description": "执行命令"
159
+ },
160
+ {
161
+ "command": "npm i",
162
+ "platform": "all",
163
+ "description": "执行命令"
164
+ },
165
+ {
166
+ "command": "npm run serve",
167
+ "platform": "all",
168
+ "description": "执行命令"
169
+ }
170
+ ],
171
+ "references": [],
172
+ "difficulty": "medium",
173
+ "estimatedTime": 5
174
+ }
175
+ ];
176
+
177
+ const guide = {
178
+ ...metadata,
179
+ steps,
180
+ };
181
+
182
+ /**
183
+ * 按关键词搜索步骤
184
+ */
185
+ function searchSteps(keyword) {
186
+ const lower = keyword.toLowerCase();
187
+ return guide.steps.filter(step =>
188
+ step.title.toLowerCase().includes(lower) ||
189
+ step.description.toLowerCase().includes(lower) ||
190
+ step.keywords.some(k => k.toLowerCase().includes(lower))
191
+ );
192
+ }
193
+
194
+ /**
195
+ * 按平台获取命令
196
+ */
197
+ function getCommandsByPlatform(platform) {
198
+ const commands = [];
199
+ guide.steps.forEach(step => {
200
+ step.commands.forEach(cmd => {
201
+ if (cmd.platform === 'all' || cmd.platform === platform) {
202
+ commands.push(cmd);
203
+ }
204
+ });
205
+ });
206
+ return commands;
207
+ }
208
+
209
+ /**
210
+ * 按步骤号获取步骤详情
211
+ */
212
+ function getStep(stepNumber) {
213
+ return guide.steps.find(s => s.number === stepNumber);
214
+ }
215
+
216
+ /**
217
+ * 获取所有步骤
218
+ */
219
+ function getAllSteps() {
220
+ return guide.steps;
221
+ }
222
+
223
+ /**
224
+ * 获取指定难度的步骤
225
+ */
226
+ function getStepsByDifficulty(difficulty) {
227
+ return guide.steps.filter(s => s.difficulty === difficulty);
228
+ }
229
+
230
+ /**
231
+ * 获取所有参考链接
232
+ */
233
+ function getAllReferences() {
234
+ const refs = [];
235
+ guide.steps.forEach(step => {
236
+ refs.push(...step.references);
237
+ });
238
+ return refs;
239
+ }
240
+
241
+ /**
242
+ * 按分类获取参考链接
243
+ */
244
+ function getReferencesByCategory(category) {
245
+ return getAllReferences().filter(r => r.category === category);
246
+ }
247
+
248
+ // 导出所有函数和对象
249
+ module.exports = guide;
250
+ module.exports.searchSteps = searchSteps;
251
+ module.exports.getCommandsByPlatform = getCommandsByPlatform;
252
+ module.exports.getStep = getStep;
253
+ module.exports.getAllSteps = getAllSteps;
254
+ module.exports.getStepsByDifficulty = getStepsByDifficulty;
255
+ module.exports.getAllReferences = getAllReferences;
256
+ module.exports.getReferencesByCategory = getReferencesByCategory;
@@ -0,0 +1,278 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * CloudCC 安全标记知识库爬取脚本
5
+ * 功能:从官方文档网页爬取安全标记使用指南,生成结构化 JavaScript 知识库
6
+ *
7
+ * 特性:
8
+ * - 自动网页爬取和 HTML 解析
9
+ * - 安全标记分类和详细说明
10
+ * - 错误重试和容错机制
11
+ * - 元数据管理(版本、更新时间、来源)
12
+ */
13
+
14
+ const https = require('https');
15
+ const http = require('http');
16
+ const cheerio = require('cheerio');
17
+ const fs = require('fs').promises;
18
+ const path = require('path');
19
+
20
+ // ======================== 配置 ========================
21
+ const CONFIG = {
22
+ SOURCE_URL: 'https://dev-help.cloudcc.cn/devlearn01/huo-qu-an-quan-biao-ji/',
23
+ OUTPUT_FILE: path.join(__dirname, './prompt.js'),
24
+ TIMEOUT: 10000,
25
+ MAX_RETRIES: 3,
26
+ CACHE_DURATION: 7 * 24 * 60 * 60 * 1000, // 7 天
27
+ };
28
+
29
+ // HTML 转义工具
30
+ function escapeHtml(text) {
31
+ return String(text)
32
+ .replace(/&/g, '&amp;')
33
+ .replace(/</g, '&lt;')
34
+ .replace(/>/g, '&gt;')
35
+ .replace(/"/g, '&quot;')
36
+ .replace(/'/g, '&#039;');
37
+ }
38
+
39
+ // ======================== 日志工具 ========================
40
+ const logger = {
41
+ log: (msg) => console.log(`ℹ️ ${msg}`),
42
+ success: (msg) => console.log(`✅ ${msg}`),
43
+ error: (msg) => console.error(`❌ ${msg}`),
44
+ warn: (msg) => console.warn(`⚠️ ${msg}`),
45
+ info: (msg) => console.log(`📝 ${msg}`),
46
+ };
47
+
48
+ // ======================== HTTP 请求 ========================
49
+ async function fetchPage(url, retries = 0) {
50
+ return new Promise((resolve, reject) => {
51
+ try {
52
+ logger.log(`正在获取 ${url}...`);
53
+
54
+ const urlObj = new URL(url);
55
+ const protocol = urlObj.protocol === 'https:' ? https : http;
56
+
57
+ const options = {
58
+ hostname: urlObj.hostname,
59
+ port: urlObj.port,
60
+ path: urlObj.pathname + urlObj.search,
61
+ method: 'GET',
62
+ headers: {
63
+ 'User-Agent': 'Mozilla/5.0 (Node.js MCP Bot) CloudCC-Key-Guide/1.0',
64
+ },
65
+ timeout: CONFIG.TIMEOUT,
66
+ };
67
+
68
+ const req = protocol.request(options, (res) => {
69
+ // 处理重定向
70
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
71
+ const redirectUrl = new URL(res.headers.location, url).href;
72
+ logger.info(`重定向到: ${redirectUrl}`);
73
+ return fetchPage(redirectUrl, retries).then(resolve).catch(reject);
74
+ }
75
+
76
+ if (res.statusCode !== 200) {
77
+ return reject(new Error(`HTTP ${res.statusCode}: ${res.statusMessage}`));
78
+ }
79
+
80
+ let html = '';
81
+ res.setEncoding('utf8');
82
+ res.on('data', (chunk) => {
83
+ html += chunk;
84
+ });
85
+ res.on('end', () => {
86
+ logger.success(`网页获取成功 (${html.length} 字节)`);
87
+ resolve(html);
88
+ });
89
+ });
90
+
91
+ req.on('error', (error) => {
92
+ reject(error);
93
+ });
94
+
95
+ req.on('timeout', () => {
96
+ req.destroy();
97
+ reject(new Error('请求超时'));
98
+ });
99
+
100
+ req.end();
101
+ } catch (error) {
102
+ reject(error);
103
+ }
104
+ }).catch(async (error) => {
105
+ if (retries < CONFIG.MAX_RETRIES) {
106
+ logger.warn(`请求失败: ${error.message},${retries + 1}/${CONFIG.MAX_RETRIES} 重试...`);
107
+ await new Promise(r => setTimeout(r, 1000 * (retries + 1)));
108
+ return fetchPage(url, retries + 1);
109
+ }
110
+ throw new Error(`获取网页失败(已重试 ${CONFIG.MAX_RETRIES} 次): ${error.message}`);
111
+ });
112
+ }
113
+
114
+ // ======================== HTML 解析 ========================
115
+ function parseKeyGuideContent(html) {
116
+ const $ = cheerio.load(html);
117
+ const guides = [];
118
+
119
+ logger.log('开始解析 HTML...');
120
+
121
+ // 提取所有主要内容块(h2 为标题)
122
+ const h2Elements = $('h2').toArray();
123
+
124
+ h2Elements.forEach((elem, idx) => {
125
+ const title = $(elem).text().trim();
126
+
127
+ if (!title) return;
128
+
129
+ let content = '';
130
+ let description = '';
131
+ const examples = [];
132
+ const tags = [];
133
+ const references = [];
134
+
135
+ let currentElem = $(elem).next();
136
+ const nextH2Idx = h2Elements.findIndex((e, i) => i > idx);
137
+ const nextH2 = nextH2Idx >= 0 ? h2Elements[nextH2Idx] : null;
138
+
139
+ while (currentElem.length && (!nextH2 || !currentElem.is(nextH2))) {
140
+ const tag = currentElem[0]?.name;
141
+
142
+ // 处理段落(描述文本)
143
+ if (tag === 'p') {
144
+ const text = currentElem.text().trim();
145
+ if (description.length < 300) {
146
+ description += (description ? ' ' : '') + text;
147
+ }
148
+ content += `<p>${$(currentElem).html()}</p>\n`;
149
+ }
150
+
151
+ // 处理代码块/示例
152
+ if (tag === 'pre' || tag === 'code') {
153
+ const codeText = currentElem.text().trim();
154
+ if (codeText) {
155
+ content += `<pre><code>${escapeHtml(codeText)}</code></pre>\n`;
156
+ }
157
+ }
158
+
159
+ // 处理列表
160
+ if (tag === 'ul' || tag === 'ol') {
161
+ content += `<${tag}>${$(currentElem).html()}</${tag}>\n`;
162
+ }
163
+
164
+ // 处理强调文本
165
+ if (tag === 'strong' || tag === 'em') {
166
+ content += currentElem.html();
167
+ }
168
+
169
+ currentElem = currentElem.next();
170
+ }
171
+
172
+ // 清理描述文本
173
+ description = description
174
+ .replace(/[💡⚠️✅❌📝ℹ️📥📊🎯]/g, '')
175
+ .trim()
176
+ .substring(0, 300);
177
+
178
+ // 构建指南对象(简化版)
179
+ const guide = {
180
+ title: title,
181
+ description: description || title,
182
+ content: content.trim(),
183
+ };
184
+
185
+ guides.push(guide);
186
+ logger.info(`✓ 指南: ${title}`);
187
+ });
188
+
189
+ return guides;
190
+ }
191
+
192
+ // ======================== 辅助函数 ========================
193
+ // 已移除,简化解析逻辑
194
+
195
+ // ======================== JavaScript 代码生成 ========================
196
+
197
+ function generateJavaScriptCode(guides) {
198
+ const now = new Date().toISOString();
199
+ const metadata = {
200
+ title: 'CloudCC 安全标记知识库',
201
+ description: '详细的安全标记使用指南,涵盖开发者密钥、安全标记配置等安全相关主题',
202
+ sourceUrl: CONFIG.SOURCE_URL,
203
+ generatedAt: now,
204
+ version: '1.0.0',
205
+ };
206
+
207
+ const guidesJson = JSON.stringify(guides, null, 2);
208
+ const metadataJson = JSON.stringify(metadata, null, 2);
209
+
210
+ const code = `/**
211
+ * CloudCC 安全标记知识库
212
+ *
213
+ * 自动生成的文件,请勿手动修改
214
+ * 生成时间: ${now}
215
+ * 来源: ${CONFIG.SOURCE_URL}
216
+ */
217
+
218
+ const metadata = ${metadataJson};
219
+
220
+ const guides = ${guidesJson};
221
+
222
+ const knowledge = {
223
+ ...metadata,
224
+ guides,
225
+ };
226
+
227
+ // 导出知识库
228
+ module.exports = knowledge;
229
+ `;
230
+
231
+ return code;
232
+ }
233
+
234
+ // ======================== 主函数 ========================
235
+
236
+ async function main() {
237
+ try {
238
+ logger.log('🚀 CloudCC 安全标记知识库爬取脚本启动');
239
+ logger.info(`源 URL: ${CONFIG.SOURCE_URL}`);
240
+ logger.info(`输出文件: ${CONFIG.OUTPUT_FILE}`);
241
+
242
+ // 1. 获取网页
243
+ const html = await fetchPage(CONFIG.SOURCE_URL);
244
+
245
+ // 2. 解析网页
246
+ const guides = parseKeyGuideContent(html);
247
+
248
+ if (guides.length === 0) {
249
+ throw new Error('未能解析到任何指南,请检查网页结构');
250
+ }
251
+
252
+ logger.success(`成功解析 ${guides.length} 个指南`);
253
+
254
+ // 3. 生成 JavaScript 代码
255
+ const jsCode = generateJavaScriptCode(guides);
256
+
257
+ // 4. 写入文件
258
+ await fs.writeFile(CONFIG.OUTPUT_FILE, jsCode, 'utf-8');
259
+ logger.success(`成功生成 ${CONFIG.OUTPUT_FILE}`);
260
+
261
+ // 5. 统计信息
262
+ const totalContent = guides.reduce((sum, g) => sum + g.content.length, 0);
263
+
264
+ logger.log('📊 爬取统计:');
265
+ console.log(` - 指南数: ${guides.length}`);
266
+ console.log(` - 总内容大小: ${(totalContent / 1024).toFixed(2)} KB`);
267
+ console.log(` - 文件大小: ${(jsCode.length / 1024).toFixed(2)} KB`);
268
+
269
+ logger.success('✨ 爬取完成!');
270
+
271
+ } catch (error) {
272
+ logger.error(error.message);
273
+ process.exit(1);
274
+ }
275
+ }
276
+
277
+ // 执行
278
+ main();
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Key Guide Handler
3
+ * 处理安全标记知识库相关的查询
4
+ * 通过关键词匹配返回所有相关内容
5
+ */
6
+
7
+ const knowledge = require('./prompt.js');
8
+
9
+ /**
10
+ * 获取安全标记知识库的完整指南
11
+ * @returns {Object}
12
+ */
13
+ function getKeyGuide() {
14
+ // 格式化输出所有指南
15
+ let output = `# ${knowledge.title}\n\n`;
16
+ output += `${knowledge.description}\n\n`;
17
+ output += `**来源**: ${knowledge.sourceUrl}\n`;
18
+ output += `**更新时间**: ${knowledge.generatedAt}\n\n`;
19
+ output += `---\n\n`;
20
+
21
+ // 输出每个指南
22
+ knowledge.guides.forEach((guide, index) => {
23
+ if (guide.title && guide.content) {
24
+ output += `## ${index + 1}. ${guide.title}\n\n`;
25
+ if (guide.description && guide.description !== guide.title) {
26
+ output += `${guide.description}\n\n`;
27
+ }
28
+ output += `${guide.content}\n\n`;
29
+ output += `---\n\n`;
30
+ }
31
+ });
32
+
33
+ return {
34
+ content: [{
35
+ type: 'text',
36
+ text: output
37
+ }]
38
+ };
39
+ }
40
+
41
+ module.exports = {
42
+ getKeyGuide
43
+ };
@@ -0,0 +1,71 @@
1
+ /**
2
+ * CloudCC 安全标记知识库
3
+ *
4
+ * 自动生成的文件,请勿手动修改
5
+ * 生成时间: 2025-12-04T12:06:58.620Z
6
+ * 来源: https://dev-help.cloudcc.cn/devlearn01/huo-qu-an-quan-biao-ji/
7
+ */
8
+
9
+ const metadata = {
10
+ "title": "CloudCC 安全标记知识库",
11
+ "description": "详细的安全标记使用指南,涵盖开发者密钥、安全标记配置等安全相关主题",
12
+ "sourceUrl": "https://dev-help.cloudcc.cn/devlearn01/huo-qu-an-quan-biao-ji/",
13
+ "generatedAt": "2025-12-04T12:06:58.620Z",
14
+ "version": "1.0.0"
15
+ };
16
+
17
+ const guides = [
18
+ {
19
+ "title": "获取开发者密钥",
20
+ "description": "获取开发者密钥",
21
+ "content": ""
22
+ },
23
+ {
24
+ "title": "创建开发者账号",
25
+ "description": "1:访问CRM登录地址,使用系统管理账号登录到CRM系统,点击右上角齿轮,进入后台设置 2:选择菜单中的:用户管理——新建 3:重点:新建用户时,要分配具有开发者权限的简档 4:访问路径:管理用户——>简档——>对应的简档——>普通用户权限——>代码管理。确认此权限已经开启。",
26
+ "content": "<p>1:访问CRM登录地址,使用系统管理账号登录到CRM系统,点击右上角齿轮,进入后台设置</p>\n<p>2:选择菜单中的:用户管理——新建</p>\n<p>3:重点:新建用户时,要分配具有开发者权限的简档</p>\n<p>4:访问路径:管理用户——&gt;简档——&gt;对应的简档——&gt;普通用户权限——&gt;代码管理。确认此权限已经开启。</p>"
27
+ },
28
+ {
29
+ "title": "获取密钥",
30
+ "description": "1:访问CRM登录地址,使用开发者账号登录CRM系统,点击右上角齿轮,访问后台设置 2:选择用户及控制——安全性控制——连接的应用程序——新建 3:按要求填写:连接的应用程序名称,API名称,联系人电子邮件 4:创建好之后,进入详情页,点击CloudCC Dev后面的复制按钮,保留备用。",
31
+ "content": "<p>1:访问CRM登录地址,使用开发者账号登录CRM系统,点击右上角齿轮,访问后台设置</p>\n<p>2:选择用户及控制——安全性控制——连接的应用程序——新建</p>\n<p>3:按要求填写:连接的应用程序名称,API名称,联系人电子邮件</p>\n<p>4:创建好之后,进入详情页,点击CloudCC Dev后面的复制按钮,保留备用。</p>"
32
+ },
33
+ {
34
+ "title": "获取安全标记",
35
+ "description": "1:访问CRM登录地址,使用开发者账号,登录CRM,访问后台设置 2:访问 常规 → 个人设置 → 重置我的安全标记。点击后,安全标记将发送到个人信息中所配置的邮箱。。",
36
+ "content": "<p>1:访问CRM登录地址,使用开发者账号,登录CRM,访问后台设置</p>\n<p>2:访问 <strong>常规 → 个人设置 → 重置我的安全标记</strong>。点击后,安全标记将发送到个人信息中所配置的邮箱。。</p>"
37
+ },
38
+ {
39
+ "title": "配置密钥",
40
+ "description": "1:打开模版项目,打开根目录中的cloudcc-cli.config.js文件,将刚刚获取的2个密钥配置到对应的变量上。",
41
+ "content": "<p>1:打开模版项目,打开根目录中的cloudcc-cli.config.js文件,将刚刚获取的2个密钥配置到对应的变量上。</p>\n<pre><code>module.exports =\n{ // 使用dev环境\n &quot;use&quot;: &quot;dev&quot;,\n // dev环境密钥\n &quot;dev&quot;: {\n &quot;safetyMark&quot;: &quot;安全标记&quot;,\n &quot;CloudCCDev&quot;: &quot;开发者密钥&quot;\n },\n // prod环境密钥\n &quot;prod&quot;: {\n &quot;safetyMark&quot;: &quot;安全标记&quot;,\n &quot;CloudCCDev&quot;: &quot;开发者密钥&quot;\n },\n}</code></pre>"
42
+ },
43
+ {
44
+ "title": "私有云特殊配置",
45
+ "description": "私有云特殊配置",
46
+ "content": "<ul><li>私有云除了以上2个配置还需要加入一个配置,用户标记为私有云环境</li></ul>\n<pre><code>module.exports =\n{ // 使用dev环境\n &quot;use&quot;: &quot;dev&quot;,\n // dev环境密钥\n &quot;dev&quot;: {\n &quot;safetyMark&quot;: &quot;安全标记&quot;,\n &quot;CloudCCDev&quot;: &quot;开发者密钥&quot;,\n &quot;version&quot;:&quot;private&quot;\n },\n // prod环境密钥\n &quot;prod&quot;: {\n &quot;safetyMark&quot;: &quot;安全标记&quot;,\n &quot;CloudCCDev&quot;: &quot;开发者密钥&quot;,\n &quot;version&quot;:&quot;private&quot;\n },\n}</code></pre>"
47
+ },
48
+ {
49
+ "title": "特殊配置",
50
+ "description": "特殊配置",
51
+ "content": "<pre><code>&quot;dev&quot;: {\n // 服务访问地址:\n // 国内默认:https://developer.apis.cloudcc.cn\n // 海外默认:https://developer.apis.cloudcc.com\n // 私有云:登录CRM系统,页面鼠标右键,选择检查,选择控制台,输入以下代码获取:$CCDK.CCConfig.getBaseUrl()\n &quot;baseUrl&quot;: &quot;http://xxx&quot;,\n // 组件进入后台,销毁时间,设置10分钟销毁10*60*1000\n &quot;destroyTimeout&quot;: 600000,\n // 开发者平台在网关配置的前缀名,注意url不要以/结尾\n &quot;devSvcDispatch&quot;:&quot;/devconsole&quot;,\n // api-service-svc访问网关前缀地址,注意url不要以/结尾\n &quot;apiSvcPrefix&quot;:&quot;/xxx&quot;,\n // setup-svc访问网关前缀地址,注意url不要以/结尾\n &quot;setupSvcPrefix&quot;:&quot;/xxx&quot;\n},</code></pre>"
52
+ },
53
+ {
54
+ "title": "多环境配置",
55
+ "description": "cloudcc-cli.config.js支持配置多个环境信息,use用于区分使用哪个环境。",
56
+ "content": "<p>cloudcc-cli.config.js支持配置多个环境信息,use用于区分使用哪个环境。</p>\n<pre><code>module.exports = { \n // 使用dev环境密钥,与dev连接\n &quot;use&quot;: &quot;dev&quot;, \n // dev环境密钥\n &quot;dev&quot;: { &quot;safetyMark&quot;: &quot;xxx&quot;, &quot;CloudCCDev&quot;: &quot;xxx&quot; }, \n // prod环境密钥\n &quot;prod&quot;: { &quot;safetyMark&quot;: &quot;xxx&quot;, &quot;CloudCCDev&quot;: &quot;xxx&quot; } \n}</code></pre>"
57
+ },
58
+ {
59
+ "title": "On this page",
60
+ "description": "On this page",
61
+ "content": ""
62
+ }
63
+ ];
64
+
65
+ const knowledge = {
66
+ ...metadata,
67
+ guides,
68
+ };
69
+
70
+ // 导出知识库
71
+ module.exports = knowledge;