|
| 1 | +# TinyEngine2.10版本发布 |
| 2 | + |
| 3 | +## 前言 |
| 4 | + |
| 5 | +TinyEngine低代码引擎使开发者能够定制低代码平台。它是低代码平台的底座,提供可视化搭建页面等基础能力,既可以通过线上搭配组合,也可以通过cli创建个人工程进行二次开发,实时定制出自己的低代码平台。适用于多场景的低代码平台开发,如:资源编排、服务端渲染、模型驱动、移动端、大屏端、页面编排等。 |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +近期,我们正式推出TinyEngine v2.10 |
| 10 | +版本,希望能够给大家带来更好的使用体验,能够深度定制化的同时可以更简洁便利地配置。 |
| 11 | + |
| 12 | +- 源码:https://github.com/opentiny/tiny-engine(欢迎 Star ⭐) |
| 13 | + |
| 14 | +- 官网:https://opentiny.design/tiny-engine#/home |
| 15 | + |
| 16 | +这次版本特性开发和问题修复已经有更多的开发者朋友参与进来,我们在此诚挚感谢 [@timtiam](https://github.com/timtian) [@0x7A7A6572](https://github.com/0x7A7A6572) [@QxQstar](https://github.com/QxQstar) [@LLDLLY](https://github.com/LLDLLY) 积极参加 |
| 17 | +TinyEngine 的开源共建,同时也邀请大家一起加入开源社区的建设,让 |
| 18 | +TinyEngine 成长的更加优秀和茁壮。 |
| 19 | + |
| 20 | +## v2.10.0 变更特性概览 |
| 21 | + |
| 22 | +- 【模型驱动】添加模型组件/模型管理插件/模型使用配置器 |
| 23 | + |
| 24 | +- 【添加工作区】添加应用中心和模板中心 |
| 25 | + |
| 26 | +- 注册登录 |
| 27 | + |
| 28 | +- 出码支持查看代码 |
| 29 | + |
| 30 | +- 协议css字段调整 |
| 31 | + |
| 32 | +- 增加图标类组件,图表组件属性设置优化(平铺展开) |
| 33 | + |
| 34 | +- 支持添加自定义 MCP 服务器 |
| 35 | + |
| 36 | +- 【其他】功能细节优化&bug修复 |
| 37 | + |
| 38 | +## TinyEngine v2.10.0 新特性解读 |
| 39 | + |
| 40 | +### 1.【模型驱动】添加模型组件/模型管理插件/模型使用配置器 |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +### 2.【添加工作区】添加应用中心和模板中心 |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | +### 3. 代码补全 |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | +### 4. 注册登录 |
| 53 | + |
| 54 | +**一、界面操作** |
| 55 | + |
| 56 | +1 登录界面:包含登录、注册、忘记密码、注册成功 |
| 57 | + |
| 58 | +2 用户配置插件 |
| 59 | + |
| 60 | +3 应用中心和模板中心的用户组织切换 |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +**二、核心模块功能** |
| 65 | + |
| 66 | +1 HTTP 拦截器模块 |
| 67 | + |
| 68 | +- 位置:packages/common/composable/http/index.ts |
| 69 | + |
| 70 | +- 作用:拦截所有 API 请求,进行认证检查和 Token 管理 |
| 71 | + |
| 72 | +- 关键特性: |
| 73 | + |
| 74 | + 1. 请求前检查登录状态 |
| 75 | + |
| 76 | + 2. 自动为认证请求添加 Authorization 头部 |
| 77 | + |
| 78 | + 3. 统一处理认证错误 |
| 79 | + |
| 80 | + 4. 支持请求取消机制 |
| 81 | + |
| 82 | + 5. 环境适配(开发/生产环境行为不同) |
| 83 | + |
| 84 | +2 全局状态管理模块 |
| 85 | + |
| 86 | +- 位置:packages/common/composable/defaultGlobalService.ts |
| 87 | + |
| 88 | +- 作用:管理用户登录状态、用户信息和租户上下文 |
| 89 | + |
| 90 | +- 关键 API: |
| 91 | + |
| 92 | + 1. getLoginStatus():获取当前登录状态 |
| 93 | + |
| 94 | + 2. setNeedToLogin():设置登录需求状态 |
| 95 | + |
| 96 | + 3. getUserInfo()/setUserInfo():用户信息管理 |
| 97 | + |
| 98 | + 4. fetchUserInfo():从 API 获取用户信息 |
| 99 | + |
| 100 | + 5. setTenantInfo():设置租户上下文 |
| 101 | + |
| 102 | +3 登录组件模块 |
| 103 | + |
| 104 | +- 位置:packages/design-core/src/login/ |
| 105 | + |
| 106 | +- 组件结构: |
| 107 | + |
| 108 | + 1. Index.vue:登录页面容器 |
| 109 | + |
| 110 | + 2. Login.vue:登录表单 |
| 111 | + |
| 112 | + 3. Register.vue:注册表单 |
| 113 | + |
| 114 | + 4. ForgotPassword.vue:密码找回 |
| 115 | + |
| 116 | + 5. RegisterSuccess.vue:注册成功提示 |
| 117 | + |
| 118 | + 6. useLogin.ts:共享状态和逻辑 |
| 119 | + |
| 120 | +4 用户工具栏模块 |
| 121 | + |
| 122 | +- 位置:packages/toolbars/user/ |
| 123 | + |
| 124 | +- 功能:显示用户信息、组织管理和退出登录 |
| 125 | + |
| 126 | +- 特性: |
| 127 | + |
| 128 | + 1. 显示当前用户和头像 |
| 129 | + |
| 130 | + 2. 组织列表和切换功能 |
| 131 | + |
| 132 | + 3. 创建新组织 |
| 133 | + |
| 134 | + 4. 退出登录操作 |
| 135 | + |
| 136 | +**三、关键技术特性** |
| 137 | + |
| 138 | +1 请求取消机制:使用 AbortController 实现请求取消,确保未登录状态下不会发出不必要的 |
| 139 | +API 请求。当检测到用户未登录时,自动取消所有非白名单请求.白名单接口(无需认证): |
| 140 | + |
| 141 | +``` |
| 142 | +// 登录相关接口 |
| 143 | +'platform-center/api/user/login' |
| 144 | +'platform-center/api/user/register' |
| 145 | +'platform-center/api/user/forgot-password' |
| 146 | +'platform-center/api/user/me' |
| 147 | +'platform-center/api/user/tenant' |
| 148 | +// AI 相关接口 |
| 149 | +'app-center/api/chat/completions' |
| 150 | +'app-center/api/ai/chat' |
| 151 | +'app-center/api/ai/search' |
| 152 | +``` |
| 153 | + |
| 154 | +2 密码验证策略:密码必须同时满足以下所有条件: |
| 155 | + |
| 156 | +- 密码长度:8-20 个字符 |
| 157 | + |
| 158 | +- 必须包含大写字母(A-Z) |
| 159 | + |
| 160 | +- 必须包含小写字母(a-z) |
| 161 | + |
| 162 | +- 必须包含数字(0-9) |
| 163 | + |
| 164 | +- 必须包含特殊字符:!@#\$%\^&\*()\_+-=[]{};\":\|,.'<\?。 |
| 165 | + |
| 166 | +- 不能有 3 个及以上连续相同字符 |
| 167 | + |
| 168 | +3 环境配置系统: |
| 169 | + |
| 170 | +- 开发环境(MODE=dev): |
| 171 | + |
| 172 | + 1. 启动项目是通过 **pnpm dev:withAuth** 命令开启登录,**pnpm |
| 173 | + dev** 命令默认不开启 |
| 174 | + |
| 175 | + 2. 在 packages/design-core/registry.js 配置 |
| 176 | +```js |
| 177 | +const isDevelopEnv = import.meta.env.MODE?.includes('dev')const useAuth = import.meta.env.VITE_AUTH === 'true' |
| 178 | +// 通过设置enableLogin为true启动登录enableLogin: useAuth \|\| !isDevelopEnv |
| 179 | +``` |
| 180 | +- 生产环境:启用完成登录认证 |
| 181 | + |
| 182 | +4 多租户支持: |
| 183 | + |
| 184 | +- 用户可属于多个组织 |
| 185 | + |
| 186 | +- 动态切换组织上下文 |
| 187 | + |
| 188 | +- 组织间数据隔离 |
| 189 | + |
| 190 | +- URL 参数标识当前应用,当 URL 没有应用 id,会跳转到应用中心 |
| 191 | + |
| 192 | +### 5. 出码支持查看代码 |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | +### 6. 协议css字段调整 |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | +### 7. 增加图标类组件,图表组件属性设置优化(平铺展开) |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | +### 8. 支持添加自定义 MCP 服务器 |
| 207 | + |
| 208 | +之前版本中,TinyEngine已经提供内置MCP |
| 209 | +服务,可以通过MCP工具让AI调用平台提供的各种能力。 |
| 210 | + |
| 211 | +本次特性是在TinyEngine 中支持添加自定义 MCP (Model Context Protocol) |
| 212 | +服务器,可以通过配置轻松集成第三方 MCP 服务,扩展 AI |
| 213 | +开发助手的工具能力。 |
| 214 | + |
| 215 | + |
| 216 | + |
| 217 | +#### 功能特性 |
| 218 | + |
| 219 | +- 灵活配置:通过注册表简单的配置即可添加自定义服务器 |
| 220 | + |
| 221 | +- 协议支持:支持 SSE 和 StreamableHttp 两种传输协议 |
| 222 | + |
| 223 | +- 服务管理:在 AI 插件的配置界面即可管理 MCP 服务器的开关状态 |
| 224 | + |
| 225 | +- 工具控制:可查看并切换各个工具的启用状态 |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | +#### 使用步骤 |
| 230 | + |
| 231 | +1 准备您的 MCP 服务器(需符合 [MCP |
| 232 | +协议规范](https://modelcontextprotocol.io/)) |
| 233 | + |
| 234 | +2 在项目的 `registry.js` 中添加配置 |
| 235 | + |
| 236 | +3 刷新编辑器,在 AI 插件 MCP 管理面板中即可看到新添加的服务器 |
| 237 | + |
| 238 | + |
| 239 | + |
| 240 | +4 启用服务器,选择需要的工具,即可在AI助手开始使用! |
| 241 | + |
| 242 | + |
| 243 | + |
| 244 | +#### 场景示例 |
| 245 | + |
| 246 | +您可以通过该功能集成企业内部、社区MCP服务、第三方MCP工具 |
| 247 | +等MCP服务,以扩展 AI |
| 248 | +助手的业务能力,下面是一个添加图片搜索MCP服务后使用AI生成带图片页面的场景示例: |
| 249 | + |
| 250 | + |
| 251 | + |
| 252 | +### |
| 253 | + |
| 254 | +### 9. 【其他】功能细节优化&bug修复 |
| 255 | + |
| 256 | +- 区块管理/页面管理预览失败 |
| 257 | + [@xuanlid](https://github.com/xuanlid) [#1754](https://github.com/opentiny/tiny-engine/pull/1754) |
| 258 | + |
| 259 | +- iframe嵌套设计器,打开设计器窗口的方式。[@xuanlid](https://github.com/xuanlid) |
| 260 | + [#1753](https://github.com/opentiny/tiny-engine/pull/1753) |
| 261 | + |
| 262 | +- 修复预览没有token的问题。 [@lichunn](https://github.com/lichunn) [#1751](https://github.com/opentiny/tiny-engine/pull/1751) |
| 263 | + |
| 264 | +- 插件栏资源管理/模型管理图标替换。[@xuanlid](https://github.com/xuanlid) |
| 265 | + [#1740](https://github.com/opentiny/tiny-engine/pull/1740) |
| 266 | + |
| 267 | +- 登录页最小高度适配。[@lichunn](https://github.com/lichunn) |
| 268 | + [#1742](https://github.com/opentiny/tiny-engine/pull/1742) |
| 269 | + |
| 270 | +- 个人信息查询接口请求头去掉x-lowcode-org。[@xuanlid](https://github.com/xuanlid) |
| 271 | + [#1739](https://github.com/opentiny/tiny-engine/pull/1739) |
| 272 | + |
| 273 | +- 登录去掉调用设置租户接口。[@xuanlid](https://github.com/xuanlid) |
| 274 | + [#1737](https://github.com/opentiny/tiny-engine/pull/1737) |
| 275 | + |
| 276 | +- 创建应用添加framework字段。[@xuanlid](https://github.com/xuanlid) |
| 277 | + [#1735](https://github.com/opentiny/tiny-engine/pull/1735) |
| 278 | + |
| 279 | +- 应用中心添加选择组织/用户信息。[@xuanlid](https://github.com/xuanlid) |
| 280 | + [#1734](https://github.com/opentiny/tiny-engine/pull/1734) |
| 281 | + |
| 282 | +- 应用中心/模板中心交互优化,UI修改。[@xuanlid](https://github.com/xuanlid) |
| 283 | + [#1733](https://github.com/opentiny/tiny-engine/pull/1733) |
| 284 | + |
| 285 | +- 调整AI搭建功能请求逻辑和交互。[@lichunn](https://github.com/lichunn) |
| 286 | + [#1658](https://github.com/opentiny/tiny-engine/pull/1658) |
| 287 | + |
| 288 | +- 模型组件预览报错,找不到组件。[@betterdancing](https://github.com/betterdancing) |
| 289 | + [#1646](https://github.com/opentiny/tiny-engine/pull/1646) |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | +以上是此次更新问题修复的主要内容 |
| 294 | + |
| 295 | +如需了解更多可以查看:v2.10.0 所有 changelog (TODO: 添加链接) |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | +## 结语 |
| 300 | + |
| 301 | +TinyEngine 2.10 |
| 302 | +版本更新不仅有全新的模型驱动、登录注册、代码补全、出码支持查看代码功能,还支持添加自定义 |
| 303 | +MCP 服务器 ,对图表组件属性设置等功能进行优化 |
| 304 | +。每一步前行都值得铭记,感谢有您陪伴我们一起迭代成长,同时也欢迎大家加入社区讨论,参与社区共建! |
0 commit comments