Commit 63d5d00f authored by 范雪寒's avatar 范雪寒

fix: bugs

parent 3979605c
...@@ -43,9 +43,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -43,9 +43,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.item.contentObj = {}; this.item.contentObj = {};
const getData = (<any>window).courseware.getData; const getData = (<any>window).courseware.getData;
getData((data) => { getData((data) => {
// console.log("读取数据", data) console.log("读取数据", JSON.stringify(data));
if (data.data) { if (data.contentObj && data.contentObj.data) {
this.item = data.contentObj.data;
} else if (data.data) {
this.item = data.data; this.item = data.data;
} else if (data) { } else if (data) {
this.item = data; this.item = data;
...@@ -55,7 +57,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -55,7 +57,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (!this.item.contentObj) { if (!this.item.contentObj) {
this.item.contentObj = {}; this.item.contentObj = {};
} }
console.log('this.item:: ', this.item); console.log('this.item::: ', JSON.stringify(this.item));
this.init(); this.init();
......
...@@ -940,13 +940,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -940,13 +940,15 @@ export class PlayComponent implements OnInit, OnDestroy {
// } // }
// } // }
// this.g_currentUser = window['air'].airClassInfo.user; // this.g_currentUser = window['air'].airClassInfo.user;
console.log('getData: ', data); console.log('getData: ', JSON.stringify(data));
if (data && typeof data == "object") { if (data && typeof data == "object") {
this.g_data = data; this.g_data = data;
if (data.data) {
this.g_formData = data.data.contentObj;
} else {
this.g_formData = data.contentObj; this.g_formData = data.contentObj;
if (data.contentObj && data.contentObj.data) {
this.g_data = data.contentObj.data;
this.g_formData = data.contentObj.data.contentObj
} }
} else { } else {
this.g_data = {}; this.g_data = {};
......
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