From dc18814fb5eb28c1b198eed43e00c7004b3c5b3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=A4=9A=E7=9B=8A?= Date: Tue, 21 Mar 2023 19:27:34 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E5=A4=8D=20office=20viewer?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=E5=9C=A8=20ghpages=20=E9=87=8C=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=AE=BF=E9=97=AE=20(#6435)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + docs/zh-CN/components/office-viewer.md | 10 +++++----- examples/app/index.html | 6 +++++- examples/components/Example.jsx | 8 ++++++++ examples/components/OfficeViewer.jsx | 22 ++++++++++++++++++++++ examples/components/Play.jsx | 9 +++++++++ examples/mobile.html | 1 - examples/static/simple.docx | Bin 29716 -> 29717 bytes 8 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 examples/components/OfficeViewer.jsx diff --git a/.gitattributes b/.gitattributes index a513c7508..7d96a6d3d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,3 +8,4 @@ *.svg binary *.ttf binary *.woff binary +*.docx binary diff --git a/docs/zh-CN/components/office-viewer.md b/docs/zh-CN/components/office-viewer.md index ebe69484d..4503457a1 100644 --- a/docs/zh-CN/components/office-viewer.md +++ b/docs/zh-CN/components/office-viewer.md @@ -32,7 +32,7 @@ order: 23 ```schema: scope="body" { "type": "office-viewer", - "src": "https://suda.cdn.bcebos.com/docx/simple.docx", + "src": "/examples/static/simple.docx", "wordOptions": { "padding": "8px" } @@ -116,7 +116,7 @@ order: 23 { "type": "office-viewer", "id": "office-viewer", - "src": "https://suda.cdn.bcebos.com/docx/info.docx", + "src": "/examples/static/info.docx", "wordOptions": { "enableVar": true, "padding": "8px" @@ -132,7 +132,7 @@ order: 23 { "type": "office-viewer", "id": "office-viewer", - "src": "https://suda.cdn.bcebos.com/docx/info.docx", + "src": "/examples/static/info.docx", "wordOptions": { "padding": "8px" } @@ -173,7 +173,7 @@ order: 23 "type": "office-viewer", "id": "office-viewer-download", "display": false, - "src": "https://suda.cdn.bcebos.com/docx/simple.docx" + "src": "/examples/static/simple.docx" } ] ``` @@ -202,7 +202,7 @@ order: 23 "type": "office-viewer", "id": "office-viewer-print", "display": false, - "src": "https://suda.cdn.bcebos.com/docx/simple.docx" + "src": "/examples/static/simple.docx" } ] ``` diff --git a/examples/app/index.html b/examples/app/index.html index ffb904fec..67178ec6d 100644 --- a/examples/app/index.html +++ b/examples/app/index.html @@ -4,7 +4,11 @@ amis app 模式 - + { let {url, method, data, responseType, config, headers} = api; config = config || {}; + // 如果在 gh-pages 里面 + if ( + /^\/amis/.test(window.location.pathname) && + typeof url === 'string' && + url.startsWith('/examples/static/') + ) { + url = url.replace('/examples/static/', '/amis/static/'); + } + config.url = url; responseType && (config.responseType = responseType); diff --git a/examples/mobile.html b/examples/mobile.html index 88a10e628..875e0f87b 100644 --- a/examples/mobile.html +++ b/examples/mobile.html @@ -4,7 +4,6 @@ MobileView - 06C`yIsgCw delta 14 WcmbRGf^o_V#tm9Bo3&+Lg#!RFbp|Z}