mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-19 08:28:41 +00:00
解析发送过来的数据异常主动报错
This commit is contained in:
parent
91e7f271f6
commit
a079de4241
@ -68,7 +68,7 @@ export default defineComponent({
|
||||
setup(props, ctx) {
|
||||
appStore().init();
|
||||
const { config } = storeToRefs(appStore());
|
||||
const treeItemData = ref<NodeInfoData | null>({ uuid: "", group: [] });
|
||||
const treeItemData = ref<NodeInfoData | null>(null);
|
||||
const isShowDebug = ref<boolean>(false);
|
||||
const frameID = ref<number>(0);
|
||||
const iframes = ref<Array<FrameInfo>>([]);
|
||||
@ -204,7 +204,13 @@ export default defineComponent({
|
||||
};
|
||||
msgFunctionMap[Msg.NodeInfo] = (eventData: NodeInfoData) => {
|
||||
isShowDebug.value = true;
|
||||
treeItemData.value = eventData;
|
||||
try {
|
||||
const nodeInfo = new NodeInfoData(eventData.uuid, eventData.group).parse(eventData);
|
||||
treeItemData.value = nodeInfo;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
ccui.footbar.showError(error, { title: "parse property error" });
|
||||
}
|
||||
};
|
||||
msgFunctionMap[Msg.MemoryInfo] = (eventData: any) => {
|
||||
memory.value = eventData;
|
||||
|
@ -129,10 +129,7 @@ export class TestServer {
|
||||
let g = new Group("scene").buildProperty("scene id", new StringData(id));
|
||||
group.push(g);
|
||||
}
|
||||
const ret: NodeInfoData = {
|
||||
uuid: id,
|
||||
group: group
|
||||
};
|
||||
const ret: NodeInfoData = new NodeInfoData(id, group);
|
||||
const event = new PluginEvent(Page.Background, Page.Devtools, Msg.NodeInfo, ret);
|
||||
this.send(event);
|
||||
break;
|
||||
@ -158,6 +155,8 @@ export class TestServer {
|
||||
}
|
||||
const event = new PluginEvent(Page.Inject, Page.Devtools, Msg.GetObjectItemData, ret);
|
||||
this.send(event)
|
||||
} else {
|
||||
console.warn("not found data: ", objData.id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user