schemas 路径

This commit is contained in:
2betop 2020-09-03 19:42:55 +08:00
parent d905276e50
commit 2b5737c67a

View File

@ -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)
};