fix(frontend): bundle tdesign-icons sprite locally for offline deploys
The <t-icon> component from tdesign-vue-next lazily loads its SVG sprite from https://tdesign.gtimg.com/icon/<ver>/fonts/index.js at runtime. In air-gapped or intranet deployments this request fails and the whole UI loses its icons (agent cards, knowledge-base breadcrumbs/cards, upload buttons, etc.). Ship the sprite (tdesign-icons-vue-next@0.4.1) as a static asset under frontend/public/tdesign-icons/0.4.1/fonts/index.js and preload it from index.html so every <t-icon name="..."> resolves against local symbols. An offline guard injects stub <script>/<link> nodes that match tdesign's dedup selectors, so checkScriptAndLoad / checkLinkAndLoad short-circuit without ever hitting the CDN (covers both the 0.4.0 and 0.4.1 hardcoded URLs for forward-compat). Closes #867 Closes #897
This commit is contained in:
@@ -57,6 +57,12 @@
|
||||
})();
|
||||
</script>
|
||||
<script src="/config.js"></script>
|
||||
<!--
|
||||
离线部署兼容:提前本地加载 tdesign-icons SVG sprite,避免 tdesign-vue-next 的
|
||||
<t-icon> 运行时向 https://tdesign.gtimg.com 发起请求(见 issue #867 / #897)。
|
||||
升级 tdesign-icons-vue-next 时需同步更新 public/tdesign-icons/<version>/fonts/index.js。
|
||||
-->
|
||||
<script src="/tdesign-icons/0.4.1/fonts/index.js"></script>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
(function(){
|
||||
|
||||
Reference in New Issue
Block a user