Commit 446eb146 authored by liujiangnan's avatar liujiangnan

feat: 封面

parent daa0fc17
...@@ -231,7 +231,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -231,7 +231,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存数据 * 储存数据
*/ */
save() { save() {
this.createCover();
(window as any).courseware.setData(this.item, null, this.saveKey); (window as any).courseware.setData(this.item, null, this.saveKey);
this.refresh(); this.refresh();
} }
...@@ -295,8 +294,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -295,8 +294,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.http.post(this.uploadUrl, formData).subscribe( this.http.post(this.uploadUrl, formData).subscribe(
(res: any) => { (res: any) => {
(window as any).courseware.sendEvent("screenshot", {"url": res.url}, this.saveKey); (window as any).courseware.sendEvent("screenshot", {"url": res.url}, this.saveKey);
this.item.contentObj.pic_id = res.url;
this.save();
}, },
(err) => { (err) => {
console.log(err); console.log(err);
...@@ -400,6 +397,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -400,6 +397,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
onBtnSave() { onBtnSave() {
this.createCover();
this.save(); this.save();
this.extraData.changeDirtyCount = 0; this.extraData.changeDirtyCount = 0;
} }
......
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