Commit c6248d13 authored by liujiangnan's avatar liujiangnan

fix: 封面存储失败的问题

parent 446eb146
...@@ -116,14 +116,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -116,14 +116,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
AnimationType = AnimationType; AnimationType = AnimationType;
uploadUrl;
uploadData;
constructor(private appRef: ApplicationRef, constructor(private appRef: ApplicationRef,
private http: HttpClient, private http: HttpClient,
private nzMessageService: NzMessageService, private nzMessageService: NzMessageService,
private changeDetectorRef: ChangeDetectorRef) { private changeDetectorRef: ChangeDetectorRef) {
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.fontSizeRange = []; this.fontSizeRange = [];
for (let i = this.MIN_FONT_SIZE; i <= this.MAX_FONT_SIZE; ++i) { for (let i = this.MIN_FONT_SIZE; i <= this.MAX_FONT_SIZE; ++i) {
this.fontSizeRange.push(i); this.fontSizeRange.push(i);
...@@ -291,7 +288,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -291,7 +288,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
const ext = img.type.replace('image/', ''); const ext = img.type.replace('image/', '');
formData.append('file', img, `cover.${ext}`); formData.append('file', img, `cover.${ext}`);
this.http.post(this.uploadUrl, formData).subscribe( this.http.post((<any> window).courseware.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);
}, },
......
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