cloudcc-cli 2.4.1 → 2.4.2
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/README.md +42 -0
- package/bin/index.js +5 -0
- package/cloudcc-dev-skill/SKILL.md +6 -12
- package/cloudcc-dev-skill/config.json +2 -2
- package/package.json +2 -2
- package/src/classes/create.js +1 -1
- package/src/config/use.js +20 -5
- package/src/dupeCatcher/create.js +76 -0
- package/src/dupeCatcher/delete.js +69 -0
- package/src/dupeCatcher/detail.js +57 -0
- package/src/dupeCatcher/doc.js +11 -0
- package/src/dupeCatcher/docs/devguide.md +125 -0
- package/src/dupeCatcher/docs/introduction.md +21 -0
- package/src/dupeCatcher/get.js +88 -0
- package/src/dupeCatcher/index.js +14 -0
- package/src/html/doc.js +35 -0
- package/src/html/docs/devguide.md +67 -0
- package/src/html/docs/introduction.md +4 -0
- package/src/html/index.js +11 -0
- package/src/openapi/cloudcc-openapi-sdk.js +1085 -0
- package/src/openapi/doc.js +30 -0
- package/src/openapi/docs/devguide.md +65 -0
- package/src/openapi/docs/introduction.md +43 -0
- package/src/openapi/get.js +45 -0
- package/src/openapi/index.js +12 -0
- package/src/plugin/publish1.js +1 -1
- package/src/plugin/pull.js +2 -2
- package/src/sharingRule/doc.js +46 -0
- package/src/sharingRule/docs/devguide.md +28 -0
- package/src/sharingRule/docs/introduction.md +7 -0
- package/src/sharingRule/get.js +48 -0
- package/src/sharingRule/index.js +9 -0
- package/src/site/doc.js +35 -0
- package/src/site/docs/devguide.md +209 -0
- package/src/site/docs/introduction.md +4 -0
- package/src/site/index.js +11 -0
- package/src/triggers/docs/devguide.md +1 -2
- package/src/triggers/get.js +1 -2
- package/src/version/doctor.js +11 -4
- package/src/version/listModuleCommands.js +20 -0
- package/template/index.js +2 -2
- package/utils/config.js +129 -21
- package/cloudcc-dev-skill/cloudcc-dev-html.md +0 -42
- package/template/cloudcc-cli.configjs +0 -7
package/src/version/doctor.js
CHANGED
|
@@ -11,12 +11,19 @@ function doctor() {
|
|
|
11
11
|
console.error(chalk.green("✓") + " cloudcc-cli v" + pkg.version)
|
|
12
12
|
|
|
13
13
|
const cwd = process.cwd()
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const jsonPath = path.join(cwd, "cloudcc-cli.config.json")
|
|
15
|
+
const jsPath = path.join(cwd, "cloudcc-cli.config.js")
|
|
16
|
+
const hasJson = fs.existsSync(jsonPath)
|
|
17
|
+
const hasJs = fs.existsSync(jsPath)
|
|
18
|
+
if (hasJson || hasJs) {
|
|
19
|
+
const parts = []
|
|
20
|
+
if (hasJson) parts.push("cloudcc-cli.config.json")
|
|
21
|
+
if (hasJs) parts.push("cloudcc-cli.config.js")
|
|
22
|
+
console.error(chalk.green("✓") + " 当前目录存在 " + parts.join("、"))
|
|
17
23
|
} else {
|
|
18
24
|
console.error(
|
|
19
|
-
chalk.yellow("○") +
|
|
25
|
+
chalk.yellow("○") +
|
|
26
|
+
" 当前目录未找到 cloudcc-cli.config.json / cloudcc-cli.config.js(若在本目录开发 CloudCC 项目,请先初始化或放入配置)"
|
|
20
27
|
)
|
|
21
28
|
}
|
|
22
29
|
console.error()
|
|
@@ -18,6 +18,8 @@ const MODULE_KEYS_ORDER = [
|
|
|
18
18
|
"triggers",
|
|
19
19
|
"timer",
|
|
20
20
|
"script",
|
|
21
|
+
"html",
|
|
22
|
+
"site",
|
|
21
23
|
"jsp",
|
|
22
24
|
"token",
|
|
23
25
|
"object",
|
|
@@ -36,7 +38,10 @@ const MODULE_KEYS_ORDER = [
|
|
|
36
38
|
"singleSignOn",
|
|
37
39
|
"pagelayout",
|
|
38
40
|
"validationRule",
|
|
41
|
+
"dupeCatcher",
|
|
42
|
+
"sharingRule",
|
|
39
43
|
"permission",
|
|
44
|
+
"openapi",
|
|
40
45
|
]
|
|
41
46
|
|
|
42
47
|
/**
|
|
@@ -54,6 +59,8 @@ const MODULE_HINT = {
|
|
|
54
59
|
schedule: "定时类(Scheduled Class):与平台同步 Java 与配置(resource 亦可用 timer)。",
|
|
55
60
|
triggers: "触发器:本地 Java 与平台同步。",
|
|
56
61
|
script: "客户端脚本:创建、发布、拉取等。",
|
|
62
|
+
html: "自定义 HTML 组件文档。",
|
|
63
|
+
site: "Site 开发规范文档。",
|
|
57
64
|
jsp: "JSP 迁移:规则查看、分析与拆分生成。",
|
|
58
65
|
token: "访问令牌/凭证。",
|
|
59
66
|
object: "标准对象与自定义对象。",
|
|
@@ -72,7 +79,10 @@ const MODULE_HINT = {
|
|
|
72
79
|
singleSignOn: "单点登录(SSO)配置。",
|
|
73
80
|
pagelayout: "页面布局。",
|
|
74
81
|
validationRule: "验证规则。",
|
|
82
|
+
dupeCatcher: "查重过滤器(Dupe Catcher):过滤器与规则管理。",
|
|
83
|
+
sharingRule: "共享规则:按对象查询规则。",
|
|
75
84
|
permission: "权限:分配、查询、增删等。",
|
|
85
|
+
openapi: "OpenAPI 浏览器端 SDK:复制到站点并按文档集成调用。",
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
const MODULE_FOLDER = {
|
|
@@ -88,6 +98,8 @@ const MODULE_FOLDER = {
|
|
|
88
98
|
triggers: "triggers",
|
|
89
99
|
timer: "timer",
|
|
90
100
|
script: "script",
|
|
101
|
+
html: "html",
|
|
102
|
+
site: "site",
|
|
91
103
|
jsp: "jsp",
|
|
92
104
|
token: "token",
|
|
93
105
|
object: "object",
|
|
@@ -106,7 +118,10 @@ const MODULE_FOLDER = {
|
|
|
106
118
|
singleSignOn: "singleSignOn",
|
|
107
119
|
pagelayout: "pagelayout",
|
|
108
120
|
validationRule: "validationRule",
|
|
121
|
+
dupeCatcher: "dupeCatcher",
|
|
122
|
+
sharingRule: "sharingRule",
|
|
109
123
|
permission: "permission",
|
|
124
|
+
openapi: "openapi",
|
|
110
125
|
}
|
|
111
126
|
|
|
112
127
|
function extractActions(indexFilePath) {
|
|
@@ -163,6 +178,8 @@ const RESOURCE_CN = {
|
|
|
163
178
|
timer: "定时类",
|
|
164
179
|
triggers: "触发器",
|
|
165
180
|
script: "客户端脚本",
|
|
181
|
+
html: "自定义 HTML 组件",
|
|
182
|
+
site: "Site",
|
|
166
183
|
jsp: "JSP 迁移",
|
|
167
184
|
token: "访问令牌",
|
|
168
185
|
object: "对象",
|
|
@@ -181,7 +198,10 @@ const RESOURCE_CN = {
|
|
|
181
198
|
singleSignOn: "单点登录",
|
|
182
199
|
pagelayout: "页面布局",
|
|
183
200
|
validationRule: "验证规则",
|
|
201
|
+
dupeCatcher: "查重过滤器",
|
|
202
|
+
sharingRule: "共享规则",
|
|
184
203
|
permission: "权限",
|
|
204
|
+
openapi: "OpenAPI SDK",
|
|
185
205
|
}
|
|
186
206
|
|
|
187
207
|
/**
|
package/template/index.js
CHANGED
|
@@ -57,7 +57,7 @@ module.exports = function (creator, options, callback) {
|
|
|
57
57
|
console.error(`${chalk.grey(`Copy lib folder to ${displayPath}`)} ${chalk.green('✔ ')}`);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
creator.copyTpl('cloudcc-cli.
|
|
60
|
+
creator.copyTpl('cloudcc-cli.config.json', path.join(projectPath, "cloudcc-cli.config.json"))
|
|
61
61
|
|
|
62
62
|
creator.copyTpl('gitignore', path.join(projectPath, ".gitignore"))
|
|
63
63
|
|
|
@@ -96,7 +96,7 @@ module.exports = function (creator, options, callback) {
|
|
|
96
96
|
console.error(`${chalk.grey(`Create file: ${prefix}babel.config.js`)} ${chalk.green('✔ ')}`);
|
|
97
97
|
console.error(`${chalk.grey(`Create file: ${prefix}package.json`)} ${chalk.green('✔ ')}`);
|
|
98
98
|
console.error(`${chalk.grey(`Create file: ${prefix}vue.config.js`)} ${chalk.green('✔ ')}`);
|
|
99
|
-
console.error(`${chalk.grey(`Create file: ${prefix}cloudcc-cli.config.
|
|
99
|
+
console.error(`${chalk.grey(`Create file: ${prefix}cloudcc-cli.config.json`)} ${chalk.green('✔ ')}`);
|
|
100
100
|
callback();
|
|
101
101
|
});
|
|
102
102
|
}
|
package/utils/config.js
CHANGED
|
@@ -3,21 +3,72 @@ const path = require("path");
|
|
|
3
3
|
const chalk = require("chalk");
|
|
4
4
|
// 引入解密函数
|
|
5
5
|
const { getDevConsoleConfig, decryptCloudCCDevInfo } = require("./utils");
|
|
6
|
-
const { readCache } = require("./cache")
|
|
6
|
+
const { readCache } = require("./cache");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 优先读取 JSON(与 package.json 的 "type":"module" 兼容),否则读取 JS。
|
|
10
|
+
* @param {string} projectPath
|
|
11
|
+
* @returns {object|null} 根配置(含 use 与各环境块)
|
|
12
|
+
*/
|
|
13
|
+
function loadCloudccConfigRootSync(projectPath = process.cwd()) {
|
|
14
|
+
const jsonPath = path.resolve(projectPath, "cloudcc-cli.config.json");
|
|
15
|
+
const jsPath = path.resolve(projectPath, "cloudcc-cli.config.js");
|
|
16
|
+
if (fs.existsSync(jsonPath)) {
|
|
17
|
+
try {
|
|
18
|
+
return JSON.parse(fs.readFileSync(jsonPath, "utf8"));
|
|
19
|
+
} catch (_err) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (fs.existsSync(jsPath)) {
|
|
24
|
+
try {
|
|
25
|
+
return require(jsPath);
|
|
26
|
+
} catch (_err) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 解析项目根目录下实际使用的配置文件路径(JSON 优先于 JS)。
|
|
35
|
+
* @param {string} projectPath
|
|
36
|
+
* @returns {{ kind: "json"|"js", filePath: string }|null}
|
|
37
|
+
*/
|
|
38
|
+
function resolveCloudccConfigFile(projectPath = process.cwd()) {
|
|
39
|
+
const jsonPath = path.resolve(projectPath, "cloudcc-cli.config.json");
|
|
40
|
+
const jsPath = path.resolve(projectPath, "cloudcc-cli.config.js");
|
|
41
|
+
if (fs.existsSync(jsonPath)) {
|
|
42
|
+
return { kind: "json", filePath: jsonPath };
|
|
43
|
+
}
|
|
44
|
+
if (fs.existsSync(jsPath)) {
|
|
45
|
+
return { kind: "js", filePath: jsPath };
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
|
|
7
50
|
/**
|
|
8
51
|
* 1.0版本的配置文件
|
|
9
52
|
* @param {string} projectPath baseUrl
|
|
10
|
-
* @returns
|
|
53
|
+
* @returns
|
|
11
54
|
*/
|
|
12
55
|
function getPackageJson_old(projectPath = process.cwd()) {
|
|
13
|
-
const
|
|
14
|
-
|
|
56
|
+
const packageJsonPath = path.join(projectPath, "package.json");
|
|
57
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
62
|
+
return packageJson.devConsoleConfig || null;
|
|
63
|
+
} catch (err) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
15
66
|
}
|
|
16
67
|
/**
|
|
17
68
|
* 2.0版本的配置文件
|
|
18
69
|
* 配置参数移入cloudcc-cli.config.js,最多需要配置9个参数
|
|
19
70
|
* @param {string} projectPath baseUrl
|
|
20
|
-
* @returns
|
|
71
|
+
* @returns
|
|
21
72
|
*/
|
|
22
73
|
async function getPackageJson2(projectPath = process.cwd()) {
|
|
23
74
|
let config;
|
|
@@ -26,16 +77,16 @@ async function getPackageJson2(projectPath = process.cwd()) {
|
|
|
26
77
|
} catch (err) {
|
|
27
78
|
return null;
|
|
28
79
|
}
|
|
29
|
-
config = config[config.use]
|
|
80
|
+
config = config[config.use];
|
|
30
81
|
config.CloudCCDev = "";
|
|
31
|
-
config = await getDevConsoleConfig(projectPath, config)
|
|
32
|
-
return config
|
|
82
|
+
config = await getDevConsoleConfig(projectPath, config);
|
|
83
|
+
return config;
|
|
33
84
|
}
|
|
34
85
|
/**
|
|
35
86
|
* 3.0版本的配置文件
|
|
36
87
|
* 将多个参数压缩到一个参数重,方便配置
|
|
37
88
|
* @param {string} projectPath baseUrl
|
|
38
|
-
* @returns
|
|
89
|
+
* @returns
|
|
39
90
|
*/
|
|
40
91
|
async function getPackageJson3(projectPath = process.cwd()) {
|
|
41
92
|
let config;
|
|
@@ -44,17 +95,17 @@ async function getPackageJson3(projectPath = process.cwd()) {
|
|
|
44
95
|
} catch (err) {
|
|
45
96
|
return null;
|
|
46
97
|
}
|
|
47
|
-
config = config[config.use]
|
|
98
|
+
config = config[config.use];
|
|
48
99
|
// 检查并解密CloudCCDev信息
|
|
49
100
|
if (config && config.CloudCCDev) {
|
|
50
101
|
const decryptedInfo = decryptCloudCCDevInfo(config.CloudCCDev);
|
|
51
102
|
if (decryptedInfo) {
|
|
52
103
|
if (decryptedInfo.baseUrl && !decryptedInfo.baseUrl.includes("ccdomaingateway")) {
|
|
53
|
-
decryptedInfo.baseUrl = decryptedInfo.baseUrl + "/ccdomaingateway"
|
|
104
|
+
decryptedInfo.baseUrl = decryptedInfo.baseUrl + "/ccdomaingateway";
|
|
54
105
|
}
|
|
55
|
-
config = { ...decryptedInfo, ...config }
|
|
106
|
+
config = { ...decryptedInfo, ...config };
|
|
56
107
|
config.CloudCCDev = "";
|
|
57
|
-
config = await getDevConsoleConfig(projectPath, config)
|
|
108
|
+
config = await getDevConsoleConfig(projectPath, config);
|
|
58
109
|
} else {
|
|
59
110
|
console.error(
|
|
60
111
|
chalk.yellow(
|
|
@@ -70,19 +121,68 @@ async function getPackageJson3(projectPath = process.cwd()) {
|
|
|
70
121
|
return config;
|
|
71
122
|
}
|
|
72
123
|
|
|
124
|
+
/**
|
|
125
|
+
* 4.0:cloudcc-cli.config.json(纯 JSON,不受 package.json "type":"module" 影响)
|
|
126
|
+
* 支持 CloudCCDev 解密分支与显式字段(等同 v3 + v2)在同一文件内解析。
|
|
127
|
+
* @param {string} projectPath
|
|
128
|
+
* @returns {Promise<object|null>}
|
|
129
|
+
*/
|
|
130
|
+
async function getPackageJson4(projectPath = process.cwd()) {
|
|
131
|
+
const jsonPath = path.resolve(projectPath, "cloudcc-cli.config.json");
|
|
132
|
+
if (!fs.existsSync(jsonPath)) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
let root;
|
|
136
|
+
try {
|
|
137
|
+
root = JSON.parse(fs.readFileSync(jsonPath, "utf8"));
|
|
138
|
+
} catch (_err) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (!root || typeof root !== "object" || typeof root.use !== "string") {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
let config = root[root.use];
|
|
145
|
+
if (!config || typeof config !== "object") {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (config.CloudCCDev) {
|
|
150
|
+
const decryptedInfo = decryptCloudCCDevInfo(config.CloudCCDev);
|
|
151
|
+
if (decryptedInfo) {
|
|
152
|
+
if (decryptedInfo.baseUrl && !decryptedInfo.baseUrl.includes("ccdomaingateway")) {
|
|
153
|
+
decryptedInfo.baseUrl = decryptedInfo.baseUrl + "/ccdomaingateway";
|
|
154
|
+
}
|
|
155
|
+
config = { ...decryptedInfo, ...config };
|
|
156
|
+
config.CloudCCDev = "";
|
|
157
|
+
return await getDevConsoleConfig(projectPath, config);
|
|
158
|
+
}
|
|
159
|
+
console.error(
|
|
160
|
+
chalk.yellow(
|
|
161
|
+
"cloudcc-cli: CloudCCDev could not be decrypted or is empty (invalid base64/JSON). " +
|
|
162
|
+
"Fix cloudcc-cli.config.json or use explicit fields / v2-style config; falling back to other config sources."
|
|
163
|
+
)
|
|
164
|
+
);
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
config = { ...config, CloudCCDev: "" };
|
|
169
|
+
return await getDevConsoleConfig(projectPath, config);
|
|
170
|
+
}
|
|
73
171
|
|
|
74
172
|
/**
|
|
75
173
|
* 从缓存读取
|
|
76
174
|
* @returns 配置参数
|
|
77
175
|
*/
|
|
78
176
|
async function getPackageJsonCache(projectPath = process.cwd()) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
177
|
+
const configRoot = loadCloudccConfigRootSync(projectPath);
|
|
178
|
+
if (!configRoot || typeof configRoot.use !== "string") {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
const active = configRoot[configRoot.use];
|
|
182
|
+
if (!active || typeof active !== "object") {
|
|
83
183
|
return null;
|
|
84
184
|
}
|
|
85
|
-
const cacheData = readCache(projectPath)[
|
|
185
|
+
const cacheData = readCache(projectPath)[active.safetyMark || active.secretKey];
|
|
86
186
|
if (cacheData && cacheData.timestamp) {
|
|
87
187
|
const oneHour = 60 * 60 * 1000; // 1小时的毫秒数
|
|
88
188
|
const currentTime = Date.now();
|
|
@@ -94,10 +194,18 @@ async function getPackageJsonCache(projectPath = process.cwd()) {
|
|
|
94
194
|
}
|
|
95
195
|
|
|
96
196
|
async function getPackageJson(projectPath = process.cwd()) {
|
|
97
|
-
return
|
|
197
|
+
return (
|
|
198
|
+
getPackageJson_old(projectPath) ||
|
|
199
|
+
(await getPackageJsonCache(projectPath)) ||
|
|
200
|
+
(await getPackageJson4(projectPath)) ||
|
|
201
|
+
(await getPackageJson3(projectPath)) ||
|
|
202
|
+
(await getPackageJson2(projectPath))
|
|
203
|
+
);
|
|
98
204
|
}
|
|
99
205
|
|
|
100
|
-
|
|
101
206
|
module.exports = {
|
|
102
207
|
getPackageJson,
|
|
103
|
-
|
|
208
|
+
getPackageJson4,
|
|
209
|
+
resolveCloudccConfigFile,
|
|
210
|
+
loadCloudccConfigRootSync,
|
|
211
|
+
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cloudcc-dev-html
|
|
3
|
-
description: 指导在 CloudCC 相关仓库中编写单个 HTML 入口页:推荐 Tailwind(tailwindcss-browser)、Alpine.js、ECharts(BootCDN)、可使用 window.$CCDK。用户提到单页 HTML、html/index、BootCDN、Tailwind、Alpine、ECharts、CCDK、$CCDK 时使用。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# CloudCC 单 HTML 页面开发规范
|
|
7
|
-
|
|
8
|
-
版本信息见同目录 [config.json](config.json)。
|
|
9
|
-
|
|
10
|
-
## 1. 技能用途:创建单个 HTML 页面
|
|
11
|
-
|
|
12
|
-
- 本技能用于在项目中编写**单个 HTML 入口文件**(通常为 **`html/index.html`**),在 CloudCC 内嵌或单独打开,与 `plugins/` 等业务源码区分存放。
|
|
13
|
-
- 静态依赖(样式、脚本、字体等)**优先使用线上绝对地址**(`https://...`)引入;**公有云**推荐 [BootCDN](https://www.bootcdn.cn/) 等中国大陆可稳定访问的源;**私有云 / 内网**可将所需文件下载后上传到组织静态资源,再改为静态资源 URL。
|
|
14
|
-
- 平台业务接口与模块说明以 **cloudcc-dev-skill**(`cloudcc doc <module>`)为准;本技能不替代平台开发指南。
|
|
15
|
-
|
|
16
|
-
## 2. 页面推荐的样式与交互库
|
|
17
|
-
|
|
18
|
-
以下为独立页**推荐**组合(通过 BootCDN 固定版本,升级时改 URL 中版本号;私有云按上一节改链)。
|
|
19
|
-
|
|
20
|
-
**样式:Tailwind CSS(tailwindcss-browser,浏览器端编译)**
|
|
21
|
-
|
|
22
|
-
```html
|
|
23
|
-
<script src="https://cdn.bootcdn.net/ajax/libs/tailwindcss-browser/4.1.13/index.global.min.js"></script>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**交互:Alpine.js v3(CDN 构建,使用 `defer`,放在 `head`;与 Tailwind 同页时 Tailwind 在前、Alpine 在后)**
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
<script defer src="https://cdn.bootcdn.net/ajax/libs/alpinejs/3.15.0/cdn.min.js"></script>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**图表:ECharts(按需引入;与 Tailwind、Alpine 同页时,建议放在二者之后,在初始化图表的脚本之前加载)**
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<script src="https://cdn.bootcdn.net/ajax/libs/echarts/6.0.0/echarts.min.js"></script>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## 3. 页面可使用 CCDK
|
|
39
|
-
|
|
40
|
-
- 在 CloudCC 运行环境(自定义页面、内嵌 HTML 等)中,可通过 **`window.$CCDK`** 使用平台提供的 **CCDK** 能力;脚本应通过该入口调用,不依赖未文档化的其它全局名。
|
|
41
|
-
- 在浏览器中直接打开本地文件时通常**没有** `$CCDK`,须做存在性判断或区分环境,避免报错。
|
|
42
|
-
- CCDK 具体 API 以平台文档及 **cloudcc-dev-skill** 中相关说明为准。
|