chore: 悦码v1增加环境配置
This commit is contained in:
@@ -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({
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user