Commit e746081c authored by rockyl's avatar rockyl

修改数据中心获取空数据的问题

修改自定义常量可以通过表达式获取
修改oss密钥
parent a757d535
{"id":"engine","url":"engine.90b8f75c7c269eab8a9476fee14257118c0828a9.js"} {"id":"engine","url":"engine.fe1c152c762e3bad43fe201bc9d9704676e8b275.js"}
\ No newline at end of file \ No newline at end of file
module.exports = { module.exports = {
region: 'oss-cn-hangzhou', region: 'oss-cn-hangzhou',
id: 'LTAIqO2wblIxQvwc', id: 'LTAI4Fw25WcfcGv7FvcHoiHK',
secret: '4brsaSRbRpjxw3oDIxJi6bNMcndIR6', secret: 'NZk1NtT9J5HFaAolNbtQdzTzLLvLYm',
bucket: 'duiba', bucket: 'duiba',
output: '/editor/zeroing/libs' output: '/editor/zeroing/libs'
}; };
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* 过程 * 过程
*/ */
import {VM} from "./VM"; import {VM} from "./VM";
import {getDataByPath, linkedFlag, linkScheme, nodeScheme, objClone} from "../utils"; import {getDataByPath, linkScheme, nodeScheme, objClone} from "../utils/index";
import {dataCenter} from "../game-warpper/data-center"; import {dataCenter} from "../game-warpper/data-center";
import {env} from "../game-warpper/enviroment"; import {env} from "../game-warpper/enviroment";
import {getLogSwitch, Logs} from "../log-switch"; import {getLogSwitch, Logs} from "../log-switch";
...@@ -241,7 +241,7 @@ export class Process { ...@@ -241,7 +241,7 @@ export class Process {
props[key] = nameValue !== undefined ? nameValue : dataCenter.getDataByPath(name); props[key] = nameValue !== undefined ? nameValue : dataCenter.getDataByPath(name);
break; break;
case 'env': case 'env':
props[key] = env[name]; props[key] = getDataByPath(env, name);
break; break;
case 'map': case 'map':
this.updateProps(props[key] = {}, args, name, name); this.updateProps(props[key] = {}, args, name, name);
......
...@@ -84,7 +84,7 @@ export class DataCenter extends EventDispatcher { ...@@ -84,7 +84,7 @@ export class DataCenter extends EventDispatcher {
let name = args[0]; let name = args[0];
let dataMapping = this.getDataMapping(name); let dataMapping = this.getDataMapping(name);
try { try {
let data: any = this.getDataByPath(dataMapping.path, undefined, true); let data: any = this.getDataByPath(dataMapping.path, undefined, false);
if (args[1] !== undefined) { if (args[1] !== undefined) {
data = data[args[1]]; data = data[args[1]];
} }
......
...@@ -199,6 +199,7 @@ export const commands: { [name: string]: Command } = { ...@@ -199,6 +199,7 @@ export const commands: { [name: string]: Command } = {
parent.addChild(newNode); parent.addChild(newNode);
// 生成子域 // 生成子域
let newScope: any = Object.create(forScope); let newScope: any = Object.create(forScope);
// 这里一定要用defineProperty将目标定义在当前节点上,否则会影响forScope // 这里一定要用defineProperty将目标定义在当前节点上,否则会影响forScope
Object.defineProperty(newScope, "$index", { Object.defineProperty(newScope, "$index", {
configurable: true, configurable: true,
...@@ -236,6 +237,13 @@ export const commands: { [name: string]: Command } = { ...@@ -236,6 +237,13 @@ export const commands: { [name: string]: Command } = {
value: (isArray ? curList[curIndex] : curList[curIndex].value), value: (isArray ? curList[curIndex] : curList[curIndex].value),
writable: false writable: false
}); });
// 把单项数据注入到显示对象上
Object.defineProperty(newNode, "$data", {
configurable: true,
enumerable: false,
value: (isArray ? curList[curIndex] : curList[curIndex].value),
writable: false
});
// 开始编译新节点 // 开始编译新节点
context.compiler.compile(newNode, newScope); context.compiler.compile(newNode, newScope);
// 赋值上一个节点 // 赋值上一个节点
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment