From 2b5737c67ab0c83172f259cabe3d6b7532bde6b4 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Thu, 3 Sep 2020 19:42:55 +0800 Subject: [PATCH] =?UTF-8?q?schemas=20=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/components/Play.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/components/Play.jsx b/examples/components/Play.jsx index 82c85b320..f540603ca 100644 --- a/examples/components/Play.jsx +++ b/examples/components/Play.jsx @@ -227,8 +227,15 @@ export default class PlayGround extends React.Component { '$1' ); // 去掉注释 + let host = `${window.location.protocol}//${window.location.host}`; + + // 如果在 gh-pages 里面 + if (/^\/amis/.test(window.location.pathname)) { + host = '/amis'; + } + const json = { - $schema: `${window.location.protocol}//${window.location.host}/schemas/page.json#`, + $schema: `${host}/schemas/page.json#`, ...JSON.parse(schemaContent) };