@microi.net/cli 4.9.6 → 4.9.7
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/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/assets/build-meta.json +6 -5
- package/package.json +1 -1
- package/scripts/mcp-server.js +83 -83
- package/scripts/microi-cli.js +55 -85
- package/scripts/microi-codex-broker.js +418 -0
- package/scripts/microi-codex-router.js +129 -65
- package/scripts/microi-skills.meta.json +310 -151
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +3566 -0
- package/skills/ai-platform-governance/SKILL.md +21 -166
- package/skills/ai-platform-governance/references/progressive-01-/345/212/237/350/203/275/345/274/200/345/205/263.md +190 -0
- package/skills/microi-client-frontend/SKILL.md +17 -434
- package/skills/microi-client-frontend/references/progressive-01-3-/345/212/250/346/200/201/346/214/211/351/222/256/347/263/273/347/273/237.md +144 -0
- package/skills/microi-client-frontend/references/progressive-02-8-/350/277/220/350/241/214/346/227/266/351/253/230/351/242/221/345/235/221/345/244/215/347/233/230.md +178 -0
- package/skills/microi-client-frontend/references/progressive-03-vue3-/345/211/215/347/253/257/345/276/256/346/234/215/345/212/241/345/256/277/344/270/273/350/247/204/345/210/231.md +144 -0
- package/skills/microi-db-schema/SKILL.md +3 -3
- package/skills/microi-db-schema/references/schema-overview.md +1 -1
- package/skills/microi-db-schema/references/schema.md +1 -1
- package/skills/microi-db-schema/references/table-catalog.md +1 -1
- package/skills/microi-form-engine/SKILL.md +1 -1
- package/skills/microi-form-layout/SKILL.md +19 -225
- package/skills/microi-form-layout/references/progressive-01-3-/344/270/211/347/247/215/345/210/206/347/273/204/347/232/204/345/255/230/345/202/250/344/270/216/351/205/215/347/275/256.md +235 -0
- package/skills/microi-frontend-sdk/SKILL.md +17 -151
- package/skills/microi-frontend-sdk/references/progressive-01-token-/345/275/223/345/211/215/347/231/273/345/275/225/347/224/250/346/210/267/344/270/216/345/275/223/345/211/215/347/273/210/347/253/257/347/231/273/345/275/225/345/215/217/350/256/256.md +171 -0
- package/skills/microi-mobile-app-quality/SKILL.md +22 -288
- package/skills/microi-mobile-app-quality/references/progressive-01-4-/351/207/215/350/246/201/346/214/211/351/222/256/345/277/205/351/241/273/345/270/246/345/233/276/346/240/207.md +209 -0
- package/skills/microi-mobile-app-quality/references/progressive-02-9-/344/270/273/351/242/230/345/210/207/346/215/242/345/277/205/351/241/273/347/234/237/345/256/236/344/270/224/345/205/250/345/261/200/347/224/237/346/225/210.md +117 -0
- package/skills/microi-system-delivery/SKILL.md +16 -380
- package/skills/microi-system-delivery/references/progressive-01-/346/240/207/345/207/206/345/267/245/344/275/234/346/265/201.md +186 -0
- package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +210 -0
- package/skills/microi-ui/SKILL.md +19 -169
- package/skills/microi-ui/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/234/272/346/231/257/350/223/235/345/233/276.md +183 -0
- package/skills/microi-uniapp-frontend/SKILL.md +26 -335
- package/skills/microi-uniapp-frontend/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/210/206/347/261/273-/345/217/214/346/240/217/345/210/227/350/241/250/347/213/254/347/253/213/346/273/232/345/212/250.md +225 -0
- package/skills/microi-uniapp-frontend/references/progressive-02-/345/205/263/351/224/256/344/270/232/345/212/241/350/265/204/344/272/247/344/270/215/345/276/227/351/273/230/350/256/244/351/200/211/344/270/255.md +154 -0
- package/skills/page-engine/SKILL.md +23 -271
- package/skills/page-engine/references/progressive-01-/346/211/200/346/234/211/347/273/204/344/273/266/347/261/273/345/236/213.md +234 -0
- package/skills/page-engine/references/progressive-02-/347/211/210/346/234/254/345/216/206/345/217/262-/345/271/266/345/217/221/344/277/235/345/255/230/344/270/216/345/233/236/346/273/232.md +60 -0
- package/skills/playwright-e2e/SKILL.md +24 -590
- package/skills/playwright-e2e/references/progressive-01-/345/205/250/350/207/252/345/212/250/347/231/273/345/275/225-/345/205/215/351/252/214/350/257/201/347/240/201-/344/275/206/344/270/215/345/205/215/345/257/206/347/240/201-/345/277/205/350/257/273.md +173 -0
- package/skills/playwright-e2e/references/progressive-02-/346/226/207/345/255/227/345/257/271/346/257/224/345/272/246/344/270/216/345/217/257/350/257/273/346/200/247/350/207/252/345/212/250/345/214/226/346/243/200/346/237/245-/345/277/205/345/201/232.md +183 -0
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +221 -0
- package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +69 -0
- package/skills/scripts/optimize-progressive-disclosure.mjs +204 -0
- package/skills/scripts/refresh-progressive-disclosure.mjs +64 -0
- package/skills/scripts/validate-progressive-disclosure.mjs +52 -0
- package/skills/ui-design/SKILL.md +26 -1461
- package/skills/ui-design/references/progressive-01-/351/242/234/350/211/262/344/275/223/347/263/273-css-variables-/346/224/257/346/214/201/344/270/273/351/242/230/345/210/207/346/215/242.md +218 -0
- package/skills/ui-design/references/progressive-02-/345/255/227/344/275/223.md +155 -0
- package/skills/ui-design/references/progressive-03-/345/212/250/346/225/210/350/247/204/350/214/203-/344/270/260/345/257/214/344/275/206/344/270/215/345/215/241.md +235 -0
- package/skills/ui-design/references/progressive-04-/347/273/204/344/273/266/351/243/216/346/240/274/351/200/237/346/237/245.md +152 -0
- package/skills/ui-design/references/progressive-05-/347/247/273/345/212/250/347/253/257/344/270/223/347/224/250/350/247/204/350/214/203.md +238 -0
- package/skills/ui-design/references/progressive-06-/344/270/273/351/242/230/345/210/207/346/215/242/345/256/236/347/216/260.md +194 -0
- package/skills/ui-design/references/progressive-07-/351/200/237/346/237/245-/344/273/216/345/244/264/346/220/255/345/273/272/344/270/200/344/270/252/347/247/273/345/212/250/347/253/257/351/241/265/351/235/242.md +207 -0
- package/skills/ui-design/references/progressive-08-/350/241/250/345/215/225/345/210/206/347/273/204/350/247/204/350/214/203-tabs-vs-collapsegroup-/345/274/272/345/210/266.md +142 -0
- package/skills/v8-crud-api/SKILL.md +20 -245
- package/skills/v8-crud-api/references/progressive-01-/346/237/245/350/257/242/345/210/227/350/241/250-/345/210/206/351/241/265.md +226 -0
- package/skills/v8-crud-api/references/progressive-02-where-/346/235/241/344/273/266/350/257/255/346/263/225/351/200/237/346/237/245.md +49 -0
- package/skills/v8-export-import/SKILL.md +15 -425
- package/skills/v8-export-import/references/progressive-01-excellayout-/351/253/230/347/272/247/350/207/252/347/224/261/345/270/203/345/261/200.md +211 -0
- package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +202 -0
- package/skills/v8-export-import/references/progressive-03-/345/256/211/345/205/250-/346/200/247/350/203/275/346/263/250/346/204/217.md +42 -0
- package/skills/v8-file-upload/SKILL.md +16 -354
- package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +227 -0
- package/skills/v8-file-upload/references/progressive-02-office-/346/226/207/344/273/266/345/234/250/347/272/277/347/274/226/350/276/221/347/211/210/346/234/254/345/217/267/350/247/204/345/210/231.md +149 -0
- package/skills/v8-frontend-events/SKILL.md +19 -205
- package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +219 -0
- package/skills/v8-http-integration/SKILL.md +14 -236
- package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +220 -0
- package/skills/v8-http-integration/references/progressive-02-/351/224/231/350/257/257/345/244/204/347/220/206/346/250/241/345/274/217.md +44 -0
- package/skills/v8-menu-buttons/SKILL.md +15 -511
- package/skills/v8-menu-buttons/references/progressive-01-2-/346/214/211/351/222/256/345/257/271/350/261/241-schema.md +221 -0
- package/skills/v8-menu-buttons/references/progressive-02-8-/346/250/241/345/274/217-f-/345/220/216/345/217/260/344/273/273/345/212/241/346/214/211/351/222/256-/351/225/277/344/273/273/345/212/241.md +224 -0
- package/skills/v8-menu-buttons/references/progressive-03-10-/345/217/215/346/250/241/345/274/217-/351/201/277/345/205/215.md +104 -0
- package/skills/v8-mq-mqtt/SKILL.md +11 -175
- package/skills/v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-/347/211/251/350/201/224/347/275/221.md +181 -0
- package/skills/v8-security/SKILL.md +16 -329
- package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +199 -0
- package/skills/v8-security/references/progressive-02-7-/346/227/245/345/277/227/350/256/260/345/275/225.md +158 -0
- package/skills/v8-table-event/SKILL.md +16 -236
- package/skills/v8-table-event/references/progressive-01-informv8-js-/350/241/250/345/215/225/346/211/223/345/274/200/344/272/213/344/273/266.md +216 -0
- package/skills/v8-table-event/references/progressive-02-/345/211/215/347/253/257/344/272/213/344/273/266/345/220/215-v8-eventname-/345/217/257/350/203/275/347/232/204/345/200/274.md +46 -0
- package/skills/v8-workflow/SKILL.md +19 -160
- package/skills/v8-workflow/references/progressive-01-/350/212/202/347/202/271/345/274/200/345/247/213-v8-/344/272/213/344/273/266.md +180 -0
- package/skills/workspace-conventions/SKILL.md +29 -361
- package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +208 -0
- package/skills/workspace-conventions/references/progressive-02-microi-net-api-/346/234/254/345/234/260/345/220/257/345/212/250/347/272/246/345/256/232.md +196 -0
- package/skills/workspace-conventions/references/progressive-03-cli-/344/270/216-ide-/346/217/222/344/273/266/351/224/231/347/211/210/345/205/261/345/255/230/347/272/246/345/256/232.md +27 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# v8-frontend-events 详细参考 1
|
|
2
|
+
|
|
3
|
+
> 按需读取;本文件由 SKILL.md 的原章节无损拆分。
|
|
4
|
+
|
|
5
|
+
<!-- microi-progressive:chunk id=v8-frontend-events-006 sha256=f9b273e42b9bf94893ecef53797876a373ad92d46f421c90c603c52259bbd2d2 -->
|
|
6
|
+
## 列表事件
|
|
7
|
+
|
|
8
|
+
### TableRowClick — 行点击
|
|
9
|
+
|
|
10
|
+
```javascript
|
|
11
|
+
// V8.Form === 被点击的行
|
|
12
|
+
console.log('点击行:', V8.Form.Id);
|
|
13
|
+
// 自定义跳转
|
|
14
|
+
V8.OpenAnyForm({ TableName: 'OrderDetail', Id: V8.Form.Id, FormMode: 'View' });
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### OpenTableBefore — 打开列表前(拦截/初始化筛选)
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// 固定弹出表格的可选数据范围;搜索、高级筛选、分页不会移除此条件
|
|
21
|
+
V8.OpenTableSetWhere(V8.Field.CustomerId, [
|
|
22
|
+
['OwnerId', '=', V8.CurrentUser.Id]
|
|
23
|
+
]);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### OpenTableSubmit — 列表查询提交前(追加条件)
|
|
27
|
+
|
|
28
|
+
```javascript
|
|
29
|
+
// V8.Param 是即将发起查询的参数
|
|
30
|
+
V8.Param._Where = V8.Param._Where || [];
|
|
31
|
+
V8.Param._Where.push(['DeptId', '=', V8.CurrentUser.DeptId]);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### PageTab — 页签切换
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
// PageTab:"待办"
|
|
38
|
+
V8.SearchSet({ Status: '待办' });
|
|
39
|
+
V8.RefreshTable({ _PageIndex: 1 });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
<!-- /microi-progressive:chunk -->
|
|
43
|
+
<!-- microi-progressive:chunk id=v8-frontend-events-007 sha256=3a8ad420eed127357a6b5e799792325bc5c152ff8607722a7dc96c252fae0da2 -->
|
|
44
|
+
## 常用前端 API
|
|
45
|
+
|
|
46
|
+
| API | 说明 |
|
|
47
|
+
|-----|------|
|
|
48
|
+
| `V8.Tips(msg, ok?)` | 浮层提示。`ok=true` 绿色 |
|
|
49
|
+
| `V8.ConfirmTips(msg, cb)` | 回调式确认弹窗;内容按 HTML 渲染,只能传可信/已转义文本 |
|
|
50
|
+
| `V8.FormSet(field, value)` | 普通表单会触发目标字段 V8;列表上下文只更新当前行/模板 |
|
|
51
|
+
| `V8.FieldSet(field, prop, value)` | 设置字段属性;跨上下文只依赖顶层 Visible/Required/Readonly/Data |
|
|
52
|
+
| `V8.FormSubmit({CloseForm:true})` | 提交当前表单 |
|
|
53
|
+
| `V8.RefreshTable({_PageIndex:1})` | 刷新表格(-1 保持当前页) |
|
|
54
|
+
| `V8.SearchSet({field: value})` | 设置筛选条件 |
|
|
55
|
+
| `V8.OpenAnyForm({...})` | 打开任意表单(弹窗/抽屉) |
|
|
56
|
+
| `V8.OpenAnyTable({...})` | 打开任意列表 |
|
|
57
|
+
| `V8.OpenDialog({...})` | 打开自定义弹窗 |
|
|
58
|
+
| `V8.OpenAppDialog({...})` | 按 AppKey 打开已发布在线微服务页面,支持 Dialog/Drawer 与结果回调 |
|
|
59
|
+
| `V8.ApiEngine.Run({ApiEngineKey, ...})` | 调接口引擎(前端,参数对象格式) |
|
|
60
|
+
| `V8.FormEngine.GetTableData(name, params, cb)` | 前端查列表(参数对象、回调或 await) |
|
|
61
|
+
| `V8.Post(url, data, cb, errCb, headers, contentType)` | 通用 POST |
|
|
62
|
+
| `V8.Method.ScanCode({...})` | 调用当前终端支持的扫码能力 |
|
|
63
|
+
| `V8.Print.isConnected()` | 检查当前 BLE 写特征或 Android SPP Socket 是否仍可用 |
|
|
64
|
+
| `V8.Print.OpenBluetoothPage()` | 在用户手势中打开蓝牙连接页,返回 Promise |
|
|
65
|
+
| `V8.Print.reconnect()` | 使用已记住的设备授权或设备 ID 尝试重连 |
|
|
66
|
+
| `V8.Print.getConnectionState()` | 获取连接、设备、传输、型号、指令、记忆和错误状态快照 |
|
|
67
|
+
| `V8.Print.subscribeConnection(listener)` | 订阅应用级共享连接状态,返回取消订阅函数 |
|
|
68
|
+
| `V8.Print.getPrinterProfile()` | 查看自动识别或手工选择后的型号配置 |
|
|
69
|
+
| `V8.Print.setPrinterProfile(mode)` | 广播名无法识别时选 `zicox-cc4` 等型号;旧业务通常不调用 |
|
|
70
|
+
| `V8.Print.prepareSend(bytes)` | 按型号适配后串行分包发送 TSPL、CPCL 或 ESC/POS,必须 `await` |
|
|
71
|
+
|
|
72
|
+
`V8.OpenAnyForm` 只发起打开动作,不返回“用户关闭后的 Promise”。需要替换
|
|
73
|
+
子表单保存时,通过 `EventReplace.Submit(v8, param, callback)` 注册提交替换;
|
|
74
|
+
其中小写 `v8` 是子表单上下文,外层 `V8` 仍是父上下文。自定义提交结束后
|
|
75
|
+
必须调用 `callback(DosResult)`,否则子表单会一直等待。
|
|
76
|
+
|
|
77
|
+
### 蓝牙打印最小安全流程
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
if (!V8.Print) {
|
|
81
|
+
V8.Tips('当前客户端未加载蓝牙打印能力', false);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (!V8.Print.isConnected()) {
|
|
86
|
+
var connected = await V8.Print.OpenBluetoothPage();
|
|
87
|
+
if (!connected || !V8.Print.isConnected()) return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var command = V8.Print.createNew(); // 同一 TSC 调用:GP-M322 原 TSPL,CC4 自动转 CPCL
|
|
91
|
+
command.setSize(60, 40);
|
|
92
|
+
command.setGap(2);
|
|
93
|
+
command.setCls();
|
|
94
|
+
command.setText(20, 20, 'TSS24.BF2', 1, 1, '测试标签');
|
|
95
|
+
command.setPagePrint();
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
await V8.Print.prepareSend(command.getData());
|
|
99
|
+
V8.Tips('打印数据已发送', true);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
V8.Tips('发送失败:' + (error.message || error), false);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
PC/平板顶部导航与移动端【我的】页共用同一个应用级 `V8.Print` 实例,用户可先在全局入口连接,再进入任意模块打印。佳博 GP-M322 路径必须保持原 TSPL 字节不变;ZICOX CC4 只转换有明确 CPCL 等价语义的高层 TSC 调用,不支持的命令必须在首包写入前失败,禁止盲目透传乱码。Android 5+App 的 CC4 可在 BLE 失败时使用已配对 SPP,Web 端不能使用经典蓝牙。
|
|
106
|
+
|
|
107
|
+
`prepareSend` 内部会把不同 V8 上下文排入同一发送队列;成功只证明字节已经写入 BLE 特征或 SPP 输出流,不代表打印机已走纸、无缺纸或无硬件故障。批量打印仍应逐条 `await`,不得用固定 `setTimeout` 猜测完成时间,也不要用 `Promise.all` 表达同一设备的并行打印。完整挂载范围、双型号连接、协议映射、批量恢复、安全与硬件验收见 `references/bluetooth-print.md`;源码级 TSC/ESC/CPCL 方法表见 `references/bluetooth-print-api.md`。
|
|
108
|
+
|
|
109
|
+
### 常用上下文差异
|
|
110
|
+
|
|
111
|
+
| 变量 | 可用范围 |
|
|
112
|
+
|------|----------|
|
|
113
|
+
| `V8.OldForm` | 普通表单已加载旧数据后可用;服务端提交前/后事件也可用 |
|
|
114
|
+
| `V8.OldValue` | 仅表格行内字段值变更可靠提供 |
|
|
115
|
+
| `V8.Event` | 插槽按钮等显式传原生事件的场景;键盘事件使用 `V8.KeyCode` |
|
|
116
|
+
| `V8.Row/Rows/RowIndex` | 表格行事件 |
|
|
117
|
+
| `V8.TableRowSelected/SelectedData` | 列表批量按钮,互为兼容别名 |
|
|
118
|
+
| `V8.SearchParam` | 列表 `{Keyword, Where}` 搜索快照 |
|
|
119
|
+
| `V8.SysMenuModel` | 列表/菜单按钮 |
|
|
120
|
+
| `V8.DataAppend` | 打开表单、列表、弹窗时传入的附加数据 |
|
|
121
|
+
|
|
122
|
+
### 在线微服务弹窗 V8.OpenAppDialog
|
|
123
|
+
|
|
124
|
+
复杂定制页面使用 `V8.OpenAppDialog`,不要在 V8 事件中内嵌大量 HTML/CSS:
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
V8.OpenAppDialog({
|
|
128
|
+
AppKey: 'customer_profile_editor', // 必传:sys_microiservice.MsKey
|
|
129
|
+
RoutePath: '/edit', // 可选,默认 /
|
|
130
|
+
Version: '', // 可选,空值自动使用当前 BuildVersion
|
|
131
|
+
Title: '编辑客户资料',
|
|
132
|
+
TitleIcon: 'fas fa-user-edit',
|
|
133
|
+
Width: 'min(920px, calc(100vw - 32px))',
|
|
134
|
+
OpenType: 'Dialog', // Dialog / Drawer
|
|
135
|
+
Data: { id: V8.Form.Id }, // 子应用 dialogData,只放普通数据
|
|
136
|
+
OnSuccess: function (data) {
|
|
137
|
+
V8.RefreshTable({ _PageIndex: -1 });
|
|
138
|
+
},
|
|
139
|
+
OnCancel: function (data) {},
|
|
140
|
+
OnError: function (error) {
|
|
141
|
+
V8.Tips(error.message || '加载失败', false);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
子应用用 `window.microApp.getData()` 获取自动下发的 `apiBase`、`osClient`、`token`、`appKey`、`version`、`microRoute`、`dialog` 和 `dialogData`;用 `window.microApp.dispatch({type:'app-dialog:success', data:{...}})` 返回成功结果。完整参数表和结果协议见 `v8-menu-buttons/SKILL.md`。
|
|
147
|
+
|
|
148
|
+
### ConfirmTips 的 HTML 安全边界
|
|
149
|
+
|
|
150
|
+
`V8.ConfirmTips` 当前是 callback API,且内容使用 HTML 模式渲染。只传固定文案或经过 HTML 转义的简单展示;严禁直接拼接用户输入、接口消息、数据库富文本和不可信 URL。三个以上字段、上传、表格、Tab、步骤条、代码编辑器或需要复用的页面必须使用 `V8.OpenAppDialog`。
|
|
151
|
+
|
|
152
|
+
<!-- /microi-progressive:chunk -->
|
|
153
|
+
<!-- microi-progressive:chunk id=v8-frontend-events-008 sha256=eebeb0230087c0deb368baac02bd39bb4b5aa054ed19d9aa43be9447f8ef1d6d -->
|
|
154
|
+
## 前端 FormEngine 菜单上下文与兼容授权
|
|
155
|
+
|
|
156
|
+
前端 V8 不需要为每个历史项目手工补 `_SysMenuId`。新版 PC 表单引擎通过作用域 FormEngine facade 透明处理菜单上下文:
|
|
157
|
+
|
|
158
|
+
- V8 调用的目标表就是当前菜单绑定表时,facade 自动注入真实 `_SysMenuId`;如果业务代码已经显式传入 `_SysMenuId` 或兼容的 `ModuleEngineKey`,平台保留显式值,由后端做严格精确校验。
|
|
159
|
+
- V8 查询其它表时,不得把当前主表菜单 Id 带给目标表。facade 保持无菜单,由后端根据当前登录用户有效角色可访问的 `sys_menu` 缓存推断该目标表及当前操作权限。
|
|
160
|
+
- 历史 V8 的对象参数、`表名 + 参数`、Promise、回调、批量参数等调用形式继续兼容。业务代码不得自行伪造角色、菜单或 `_TrustedServerInvocation`。
|
|
161
|
+
- 平台敏感表仍对普通客户端硬拒绝;Import/Export 仍必须携带目标模块的真实菜单上下文及专项权限,不能依赖无菜单推断。
|
|
162
|
+
- 菜单配置的 `SqlWhere`、`SqlJoin` / `JoinTables` 由后端追加到真实查询。前端追加 `_Where` 只能进一步缩小结果,不能扩大或覆盖服务端数据范围。
|
|
163
|
+
- 标准 `TableChild` 自动携带内部 `_TableChildAuth` 关系提示。服务端仍会重载父/子表、菜单和字段配置,校验父记录范围并强制子表外键;业务 V8 禁止构造、缓存、跨父记录复用该对象。
|
|
164
|
+
|
|
165
|
+
```javascript
|
|
166
|
+
// 假设当前菜单绑定 Customer:平台 facade 自动注入真实菜单,无需历史 V8 手工改造
|
|
167
|
+
var current = await V8.FormEngine.GetFormData('Customer', { Id: V8.Form.Id });
|
|
168
|
+
|
|
169
|
+
// 跨表:不要传当前表的菜单 Id;后端按用户对 Product 的菜单授权推断
|
|
170
|
+
var products = await V8.FormEngine.GetTableData('Product', {
|
|
171
|
+
_Where: [['Status', '=', 1]],
|
|
172
|
+
_PageSize: 20
|
|
173
|
+
});
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
后端接口引擎和后端表单 V8 不是浏览器调用链:平台只在服务端内部构造参数时写入 `_TrustedServerInvocation`,所以它们调用 `V8.FormEngine` 不要求 `_SysMenuId`。该标记不能从浏览器 JSON、URL 或表单参数获得,前端 V8 也不得尝试设置。
|
|
177
|
+
|
|
178
|
+
### 前端 FormEngine 方法矩阵
|
|
179
|
+
|
|
180
|
+
前端 facade 当前公开 `GetFormData`、`GetFormDataAnonymous`、`GetTableData`、`GetTableTree`、`AddFormData`、`AddFormDataBatch`、`UptFormData`、`UptFormDataBatch`、`UptFormDataByWhere`、`DelFormData`、`DelFormDataBatch`、`DelFormDataByWhere`。全部返回 Promise,并兼容可选 callback。
|
|
181
|
+
|
|
182
|
+
前端没有 `GetTableDataCount`、`GetTableDataTree`(前端名称是 `GetTableTree`)、`AddTableData`、`UptTableData`、`DelTableData`、`AddField`。Import/Export 是独立端点与专项菜单权限,也不是 facade 方法。
|
|
183
|
+
|
|
184
|
+
<!-- /microi-progressive:chunk -->
|
|
185
|
+
<!-- microi-progressive:chunk id=v8-frontend-events-009 sha256=5e83f07a0fbcebf1eb02f3af5aa58936b3d1c3d19b0a6a0b1a0f14c66fcd6177 -->
|
|
186
|
+
## 异步写法(async/await vs 回调)
|
|
187
|
+
|
|
188
|
+
```javascript
|
|
189
|
+
// ✅ 推荐 async/await
|
|
190
|
+
var r = await V8.FormEngine.GetTableData('Product', { _PageSize: 10 });
|
|
191
|
+
if (r.Code === 1) { /* ... */ }
|
|
192
|
+
|
|
193
|
+
// ✅ 也可回调式
|
|
194
|
+
V8.FormEngine.GetTableData('Product', { _PageSize: 10 }, function(r) {
|
|
195
|
+
if (r.Code === 1) { /* ... */ }
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
<!-- /microi-progressive:chunk -->
|
|
200
|
+
<!-- microi-progressive:chunk id=v8-frontend-events-010 sha256=3ca077a857ffc9f58c7290e26c7e106c0e882897b1b9b669c66b4fe7615c3821 -->
|
|
201
|
+
## 死循环陷阱
|
|
202
|
+
|
|
203
|
+
❌ **禁止** 在 `SubmitFormV8.js` 里调用 `V8.FormSubmit()` —— 会无限递归
|
|
204
|
+
⚠️ **避免** 在 `FieldValueChange` 里 `V8.FormSet(同字段)` —— 前端会阻止同步直接重入,但异步回写或多字段互相赋值仍可能形成循环;需要静默赋值时使用 `V8.Form.字段名 = value`
|
|
205
|
+
❌ **禁止** 在 `InFormV8.js` 里写大量同步 `V8.FormEngine.Get*` —— 阻塞渲染
|
|
206
|
+
|
|
207
|
+
### 下拉框对象赋值
|
|
208
|
+
|
|
209
|
+
```javascript
|
|
210
|
+
// 会更新下拉选项并触发 SelectUser 的值变更 V8。
|
|
211
|
+
// 对象至少包含 SelectSaveField、SelectLabel 对应的属性;字段事件需要的其它属性也要传入。
|
|
212
|
+
V8.FormSet('SelectUser', { Id: 'u1', Name: '张三', DeptId: 'd1' });
|
|
213
|
+
|
|
214
|
+
// 响应式静默赋值:界面会更新,但不触发目标字段 V8,
|
|
215
|
+
// 也不会执行 FormSet 的修改字段记录、模板通知等处理。
|
|
216
|
+
V8.Form.SelectUser = { Id: 'u1', Name: '张三', DeptId: 'd1' };
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
<!-- /microi-progressive:chunk -->
|
|
@@ -11,6 +11,8 @@ description: Microi V8 HTTP 集成指南。用于通过 V8.Http.Get/Post/Patch
|
|
|
11
11
|
|
|
12
12
|
文档维护时,前端用法更新现有 `microi.doc/docs/doc/v8-engine/v8-client.md`,后端用法更新现有 `microi.doc/docs/doc/v8-engine/v8-server.md`;不要新建重复的 V8.Http 文档页面或路由。只维护中文 `docs/doc/`,英文 `docs/en/` 由官网统一翻译生成。
|
|
13
13
|
|
|
14
|
+
<!-- microi-progressive:begin -->
|
|
15
|
+
<!-- microi-progressive:chunk id=v8-http-integration-000 sha256=c5600510764ba7a160557ef9acd34719d1ab8c65acf635f3d4183ed5ab2e2e1f -->
|
|
14
16
|
## V8.Http API
|
|
15
17
|
|
|
16
18
|
| 方法 | 说明 | 返回值 |
|
|
@@ -66,6 +68,8 @@ if (resp.StatusCode < 200 || resp.StatusCode >= 300) {
|
|
|
66
68
|
|
|
67
69
|
`GetResponse/PostResponse/PatchResponse` 返回 `Content`、`Headers`、`RawBytes`、`StatusCode`、`ErrorMessage`。后端 `RawBytes` 是 `.NET byte[]`,前端是 `Uint8Array`。
|
|
68
70
|
|
|
71
|
+
<!-- /microi-progressive:chunk -->
|
|
72
|
+
<!-- microi-progressive:chunk id=v8-http-integration-001 sha256=4cbbdd385e24d19413b7534665333c07f2516067e9f34aa40e6adabe9e0506f4 -->
|
|
69
73
|
## V8.AI 与底层 HTTP
|
|
70
74
|
|
|
71
75
|
- 前端 V8 的平台 AI 普通调用优先 `await V8.AI.Chat(...)`。它自动使用当前 ApiBase 和平台登录头、接收响应 Token 轮换,并清除调用参数中的租户、身份、Endpoint、ApiKey 和认证头覆盖;只有确认问题适合进入 URL 日志时才用 `V8.AI.ChatGet(...)`。
|
|
@@ -87,6 +91,8 @@ else V8.Result = result.Data;
|
|
|
87
91
|
|
|
88
92
|
完整授权矩阵、SSE、后端安全边界与 MCP 示例维护在官网现有 `system-engine/ai-engine.md`,不要新建重复文档。
|
|
89
93
|
|
|
94
|
+
<!-- /microi-progressive:chunk -->
|
|
95
|
+
<!-- microi-progressive:chunk id=v8-http-integration-002 sha256=14439c586d3379c6976513df7b3c0b2f9d586ceb4d845d6f6a1abdcb1d58705a -->
|
|
90
96
|
## POST 请求(对象参数格式)
|
|
91
97
|
|
|
92
98
|
> V8 接口引擎中必须使用对象参数格式。尤其禁止 `V8.Http.Get(url)`:当前 .NET 同名重载包含 `Task<string> Get(string)`,Jint 可能把字符串调用解析为异步重载,脚本最终拿到 `[object Promise]`。GET 必须写成 `V8.Http.Get({ Url: url })`;第三方登录、微信 `jscode2session`、AccessToken 等链路保存后必须用无效 code 烟测,确认返回的是第三方明确错误而不是 Promise。
|
|
@@ -105,6 +111,8 @@ var result = V8.Http.Post({
|
|
|
105
111
|
var data = JSON.parse(result);
|
|
106
112
|
```
|
|
107
113
|
|
|
114
|
+
<!-- /microi-progressive:chunk -->
|
|
115
|
+
<!-- microi-progressive:chunk id=v8-http-integration-003 sha256=4c7c1346ea1e17b2c2ff096f1cc9b6502ae95b73087f62bc6b3531d01297eddf -->
|
|
108
116
|
## PATCH 请求
|
|
109
117
|
|
|
110
118
|
PATCH 与 POST 的参数完全对称,只需把请求体参数改为 `PatchParam` / `PatchParamString`:
|
|
@@ -162,241 +170,11 @@ var result = V8.Http.Post({
|
|
|
162
170
|
});
|
|
163
171
|
```
|
|
164
172
|
|
|
165
|
-
|
|
173
|
+
<!-- /microi-progressive:chunk -->
|
|
174
|
+
## 详细参考路由(渐进披露)
|
|
166
175
|
|
|
167
|
-
|
|
168
|
-
// 对象参数格式
|
|
169
|
-
var result = V8.Http.Get({
|
|
170
|
-
Url: 'https://api.example.com/users',
|
|
171
|
-
GetParam: { page: 1, size: 20 }, // URL 查询参数
|
|
172
|
-
Timeout: 10,
|
|
173
|
-
Headers: { Authorization: 'Bearer ' + token }
|
|
174
|
-
});
|
|
175
|
-
var data = JSON.parse(result);
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## 获取完整响应(含状态码和响应头)
|
|
179
|
-
|
|
180
|
-
```javascript
|
|
181
|
-
var resp = V8.Http.PostResponse({
|
|
182
|
-
Url: 'https://api.example.com/submit',
|
|
183
|
-
PostParamString: JSON.stringify({ orderId: V8.Param.orderId }),
|
|
184
|
-
ParamType: 'json'
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
if (resp.StatusCode !== 200) {
|
|
188
|
-
return { Code: 0, Msg: '第三方接口返回 ' + resp.StatusCode };
|
|
189
|
-
}
|
|
190
|
-
// resp.Content — 响应内容(字符串)
|
|
191
|
-
// resp.Headers — 响应头数组 [{ Name: '', Value: '' }]
|
|
192
|
-
// resp.StatusCode — HTTP 状态码
|
|
193
|
-
|
|
194
|
-
var data = JSON.parse(resp.Content);
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
PATCH 完整响应写法相同:
|
|
198
|
-
|
|
199
|
-
```javascript
|
|
200
|
-
var resp = V8.Http.PatchResponse({
|
|
201
|
-
Url: 'https://api.example.com/users/123',
|
|
202
|
-
PatchParam: { status: 'enabled' },
|
|
203
|
-
ParamType: 'json'
|
|
204
|
-
});
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
前端调用时写为 `await V8.Http.PostResponse(...)` 或 `await V8.Http.PatchResponse(...)`。
|
|
208
|
-
|
|
209
|
-
### 后端 SSRF 与重定向边界
|
|
210
|
-
|
|
211
|
-
- 严格 SSRF 防护默认关闭;未配置时完全保留历史行为,不限制协议、URL 内嵌凭据、回环、私网、链路本地或云元数据地址,并继续自动处理重定向。
|
|
212
|
-
- 只有在 SaaS 引擎主租户启用 `SsrfProtectionEnabled` 后,后端才只允许 HTTP(S),拒绝 URL 内嵌凭据、回环、私网、链路本地、云元数据和其它特殊地址,并禁止自动跟随 3xx。
|
|
213
|
-
- 严格模式需要跳转时读取完整响应的 `StatusCode` / `Headers`,经业务判断后显式发起下一次调用,使每一跳重新校验。
|
|
214
|
-
- 严格模式的 SaaS 字段 `SsrfAllowedHosts` 只能加入受控且固定的精确主机,不接受用户输入,不要配置通配。
|
|
215
|
-
- DNS 校验不能代替网络层出站 ACL。生产环境还应在容器、主机或网关阻断云元数据和非必要私网段。
|
|
216
|
-
|
|
217
|
-
## 前端 V8 行为与兼容性
|
|
218
|
-
|
|
219
|
-
- 前端新代码应优先使用 `await V8.Http.Get/Post/Patch`,参数与后端一致;不要再把 `V8.Post/Get` 作为新功能首选。旧 `V8.Post/Get` 仅作为兼容 API 保留,其回调和 Promise 写法保持不变。
|
|
220
|
-
- 相对地址或当前 `ApiBase` 地址会沿用吾码登录头,并接收响应中的新 `authorization`;第三方绝对地址不会自动携带吾码 Token,避免凭据泄漏。
|
|
221
|
-
- 浏览器请求第三方地址受 CORS 限制;这是浏览器安全策略,后端 `V8.Http` 不受浏览器 CORS 限制。
|
|
222
|
-
- 前端字符串方法同后端一样返回原始响应文本,不会自动 `JSON.parse`;需要对象时显式解析。
|
|
223
|
-
- 浏览器端不支持后端的 `FilesStream`,可使用 `FilesByteBase64`、`FilesByteString` 或 `FilesByte`。
|
|
224
|
-
|
|
225
|
-
## 下载远程文件(图片、PDF 等二进制)
|
|
226
|
-
|
|
227
|
-
```javascript
|
|
228
|
-
var resp = V8.Http.GetResponse({
|
|
229
|
-
Url: 'https://example.com/file.png',
|
|
230
|
-
Timeout: 30
|
|
231
|
-
});
|
|
232
|
-
if (resp.StatusCode !== 200) return { Code: 0, Msg: '下载失败' };
|
|
233
|
-
|
|
234
|
-
var bytes = resp.RawBytes; // .NET byte[]
|
|
235
|
-
var base64 = System.Convert.ToBase64String(bytes);
|
|
236
|
-
|
|
237
|
-
// 转存到 HDFS
|
|
238
|
-
var up = V8.Method.Upload({
|
|
239
|
-
FilesByteBase64: { 'remote.png': base64 },
|
|
240
|
-
Limit: false, Path: '/imported', OsClient: V8.OsClient
|
|
241
|
-
});
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
> 文件上传/下载完整模式见 `v8-file-upload/SKILL.md`
|
|
245
|
-
|
|
246
|
-
## 第三方密钥不要硬编码
|
|
247
|
-
|
|
248
|
-
```javascript
|
|
249
|
-
// ❌ 危险:密钥写死在代码
|
|
250
|
-
var apiKey = 'sk-xxxxxxxx';
|
|
251
|
-
|
|
252
|
-
// ✅ 正确:放在 SaaS 引擎的 OsClientModel
|
|
253
|
-
var apiKey = V8.OsClientModel.OpenAIKey;
|
|
254
|
-
var secret = V8.OsClientModel.WxPaySecret;
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
详见 `v8-saas-multi-tenant/SKILL.md`
|
|
258
|
-
```javascript
|
|
259
|
-
// GET 完整响应
|
|
260
|
-
var resp = V8.Http.GetResponse({
|
|
261
|
-
Url: 'https://api.example.com/data',
|
|
262
|
-
GetParam: { id: '123' }
|
|
263
|
-
});
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
## 实战模式
|
|
267
|
-
|
|
268
|
-
### 微信小程序 access_token
|
|
269
|
-
|
|
270
|
-
```javascript
|
|
271
|
-
var cacheKey = 'Microi:' + V8.OsClient + ':wx_access_token';
|
|
272
|
-
var token = V8.Cache.Get(cacheKey);
|
|
273
|
-
|
|
274
|
-
if (!token) {
|
|
275
|
-
var appId = V8.OsClientModel.WxAppId; // 敏感配置存在 SaaS 引擎中
|
|
276
|
-
var secret = V8.OsClientModel.WxAppSecret;
|
|
277
|
-
var result = V8.Http.Get({
|
|
278
|
-
Url: 'https://api.weixin.qq.com/cgi-bin/token',
|
|
279
|
-
GetParam: { grant_type: 'client_credential', appid: appId, secret: secret }
|
|
280
|
-
});
|
|
281
|
-
var data = JSON.parse(result);
|
|
282
|
-
|
|
283
|
-
if (data.access_token) {
|
|
284
|
-
token = data.access_token;
|
|
285
|
-
V8.Cache.Set(cacheKey, token, '0.01:56:00'); // 缓存 1 小时 56 分钟
|
|
286
|
-
} else {
|
|
287
|
-
return { Code: 0, Msg: '获取 access_token 失败: ' + (data.errmsg || '') };
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return { Code: 1, Data: { access_token: token } };
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
### 签名验证(HmacSHA256)
|
|
295
|
-
|
|
296
|
-
```javascript
|
|
297
|
-
var timestamp = V8.Action.GetTimestamp().toString();
|
|
298
|
-
var nonce = System.Guid.NewGuid().ToString().replace(/-/g, '').substring(0, 16);
|
|
299
|
-
var body = JSON.stringify({ orderId: V8.Param.orderId });
|
|
300
|
-
var signStr = timestamp + '\n' + nonce + '\n' + body + '\n';
|
|
301
|
-
var signature = V8.EncryptHelper.HmacSha256(apiSecret, signStr);
|
|
302
|
-
|
|
303
|
-
var result = V8.Http.Post({
|
|
304
|
-
Url: 'https://api.example.com/pay',
|
|
305
|
-
PostParamString: body,
|
|
306
|
-
ParamType: 'json',
|
|
307
|
-
Headers: {
|
|
308
|
-
'X-Timestamp': timestamp,
|
|
309
|
-
'X-Nonce': nonce,
|
|
310
|
-
'X-Signature': signature
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
### 调用其他 Microi 接口引擎
|
|
316
|
-
|
|
317
|
-
```javascript
|
|
318
|
-
// 不需要 HTTP,直接内部调用(可共享事务)
|
|
319
|
-
var result = V8.ApiEngine.Run('calculate-price', {
|
|
320
|
-
productId: V8.Param.productId,
|
|
321
|
-
quantity: V8.Param.quantity
|
|
322
|
-
}, V8.DbTrans);
|
|
323
|
-
|
|
324
|
-
if (result.Code !== 1) {
|
|
325
|
-
return { Code: 0, Msg: '价格计算失败: ' + result.Msg };
|
|
326
|
-
}
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### Webhook 回调处理
|
|
330
|
-
|
|
331
|
-
```javascript
|
|
332
|
-
// 接收外部 Webhook(将此引擎作为 Webhook URL)
|
|
333
|
-
var payload = V8.Param;
|
|
334
|
-
|
|
335
|
-
V8.Method.AddSysLog({
|
|
336
|
-
Title: 'Webhook',
|
|
337
|
-
Content: JSON.stringify(payload),
|
|
338
|
-
Type: 'third-party'
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
if (payload.event === 'payment.success') {
|
|
342
|
-
V8.FormEngine.UptFormDataByWhere('OrderHeader', {
|
|
343
|
-
_Where: [['OrderNo', '=', payload.order_no]],
|
|
344
|
-
PayStatus: 'paid',
|
|
345
|
-
PayTime: DateNow('yyyy-MM-dd HH:mm:ss')
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return { Code: 1, Msg: 'ok' };
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
## V8.Office.SendEmail — 发送邮件
|
|
353
|
-
|
|
354
|
-
```javascript
|
|
355
|
-
V8.Office.SendEmail({
|
|
356
|
-
SmtpServer: 'smtp.qq.com',
|
|
357
|
-
SmtpPort: 587,
|
|
358
|
-
EnableSSL: true,
|
|
359
|
-
SystemEmail: 'admin@itdos.com',
|
|
360
|
-
SystemEmailPwd: 'password',
|
|
361
|
-
EmailSubject: '邮件标题',
|
|
362
|
-
EmailBody: '<b>HTML内容</b>',
|
|
363
|
-
Receivers: ['123@qq.com', '456@qq.com']
|
|
364
|
-
});
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
## 错误处理模式
|
|
368
|
-
|
|
369
|
-
```javascript
|
|
370
|
-
try {
|
|
371
|
-
var response = V8.Http.Post({
|
|
372
|
-
Url: url,
|
|
373
|
-
PostParamString: body,
|
|
374
|
-
ParamType: 'json',
|
|
375
|
-
Timeout: 10
|
|
376
|
-
});
|
|
377
|
-
var result = JSON.parse(response);
|
|
378
|
-
|
|
379
|
-
if (result.code !== 0) {
|
|
380
|
-
console.error('Third-party API error: ' + response);
|
|
381
|
-
return { Code: 0, Msg: '第三方接口错误: ' + (result.message || result.msg || '') };
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
return { Code: 1, Data: result.data };
|
|
385
|
-
} catch (ex) {
|
|
386
|
-
console.error('HTTP request failed: ' + ex.message);
|
|
387
|
-
return { Code: 0, Msg: '请求第三方接口失败,请稍后重试' };
|
|
388
|
-
}
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
## 注意事项
|
|
176
|
+
仅在当前任务涉及对应主题时读取;下列文件合计保留了原 SKILL.md 的全部详细知识。
|
|
392
177
|
|
|
393
|
-
-
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
- 前端 `V8.Http` 必须使用 `await`;后端接口引擎无需 `await`
|
|
397
|
-
- 旧版前端 `V8.Post/Get` 是兼容 API,不能删除;但新代码必须优先使用 `V8.Http`
|
|
398
|
-
- 第三方 API 密钥建议存在 `V8.OsClientModel`(SaaS 引擎)中,不要硬编码
|
|
399
|
-
- 调用外部接口应加 try-catch,第三方服务不可控
|
|
400
|
-
- 对于需要缓存的 token(如微信 access_token),使用 `V8.Cache` 避免频繁请求
|
|
401
|
-
- 缓存过期时间格式为 `d.HH:mm:ss`,如 `0.01:00:00` 表示 1 小时
|
|
402
|
-
- 内部接口引擎之间的调用用 `V8.ApiEngine.Run()`,不需要 HTTP
|
|
178
|
+
- [references/progressive-01-get-请求.md](references/progressive-01-get-请求.md):GET 请求;获取完整响应(含状态码和响应头);前端 V8 行为与兼容性;下载远程文件(图片、PDF 等二进制);第三方密钥不要硬编码;实战模式;V8.Office.SendEmail — 发送邮件
|
|
179
|
+
- [references/progressive-02-错误处理模式.md](references/progressive-02-错误处理模式.md):错误处理模式;注意事项
|
|
180
|
+
<!-- microi-progressive:end -->
|