Commit c6248d13 authored by liujiangnan's avatar liujiangnan

fix: 封面存储失败的问题

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