|
@@ -716,7 +716,7 @@ export default {
|
|
|
}).then(async (res) => {
|
|
}).then(async (res) => {
|
|
|
const createdCourse = res.data.data;
|
|
const createdCourse = res.data.data;
|
|
|
if (createdCourse) {
|
|
if (createdCourse) {
|
|
|
- if (_this.form.fileList.length !== 0) {
|
|
|
|
|
|
|
+ if (_this.form.fileList.length !== 0 && this.form.fileList[0].raw) {
|
|
|
const imageUrl = (await _this.$apis.uploadCourseImage(createdCourse.name, this.form.fileList[0].raw)).data.data;
|
|
const imageUrl = (await _this.$apis.uploadCourseImage(createdCourse.name, this.form.fileList[0].raw)).data.data;
|
|
|
if (imageUrl) {
|
|
if (imageUrl) {
|
|
|
createdCourse.imageUrl = imageUrl;
|
|
createdCourse.imageUrl = imageUrl;
|
|
@@ -745,10 +745,9 @@ export default {
|
|
|
moocUrl: _this.form.moocUrl,
|
|
moocUrl: _this.form.moocUrl,
|
|
|
price: Number(_this.form.price),
|
|
price: Number(_this.form.price),
|
|
|
}).then(async (res) => {
|
|
}).then(async (res) => {
|
|
|
- console.log(res);
|
|
|
|
|
const updatedCourse = res.data.data;
|
|
const updatedCourse = res.data.data;
|
|
|
if (updatedCourse) {
|
|
if (updatedCourse) {
|
|
|
- if (_this.form.fileList.length !== 0) {
|
|
|
|
|
|
|
+ if (_this.form.fileList.length !== 0 && this.form.fileList[0].raw) {
|
|
|
const imageUrl = (await _this.$apis.uploadCourseImage(updatedCourse.name, this.form.fileList[0].raw)).data.data;
|
|
const imageUrl = (await _this.$apis.uploadCourseImage(updatedCourse.name, this.form.fileList[0].raw)).data.data;
|
|
|
if (imageUrl) {
|
|
if (imageUrl) {
|
|
|
updatedCourse.imageUrl = imageUrl;
|
|
updatedCourse.imageUrl = imageUrl;
|