chore: 悦码v1增加环境配置

This commit is contained in:
wangxuefeng
2025-03-06 10:28:14 +08:00
parent eecc2b1893
commit 9b2c728d4c
27 changed files with 540 additions and 689 deletions

View File

@@ -1,7 +1,6 @@
import axios from 'axios';
const apiBase = import.meta.env.VITE_BASE_API_URL;
console.log('apiBase', apiBase);
// 创建独立实例
const instance = axios.create({

View File

@@ -16,28 +16,45 @@ onMounted(async () => {
url: ''
};
const handshake = new Postmate.Model({});
await handshake.then((parent) => {
parent.emit('sync-context', 'Hello, World!');
Object.assign(model, parent.model);
console.log('model', model);
const engine = new Engine({
container,
service,
project: {
id: model.applicationId,
name: model.name
}
});
widgetManager.set('Previewer', {
props: {
path: (block: any) => {
const pathname = location.pathname;
return `${pathname}#/preview/${block.id}`;
}
}
});
const engine = new Engine({
container,
service,
project: {
id: 4,
name: 'test'
}
});
widgetManager.set('Previewer', {
props: {
path: (block: any) => {
const pathname = location.pathname;
return `${pathname}#/preview/${block.id}`;
}
}
});
// const handshake = new Postmate.Model({});
// await handshake.then((parent) => {
// parent.emit('sync-context', 'Hello, World!');
// Object.assign(model, parent.model);
// console.log('model', model);
// const engine = new Engine({
// container,
// service,
// project: {
// id: model.applicationId,
// name: model.name
// }
// });
// widgetManager.set('Previewer', {
// props: {
// path: (block: any) => {
// const pathname = location.pathname;
// return `${pathname}#/preview/${block.id}`;
// }
// }
// });
// });
});
</script>