From b28167044e0954f033ced3bf8c1902f15021836a Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Fri, 29 Oct 2021 09:52:31 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=BE=E7=A8=8B=E5=90=8E?=
=?UTF-8?q?=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=86=85=E5=AE=B9=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/course/add/index.vue | 66 +++++++++++++---------------------
1 file changed, 25 insertions(+), 41 deletions(-)
diff --git a/src/pages/course/add/index.vue b/src/pages/course/add/index.vue
index 1d9e5ad..0a24bd7 100644
--- a/src/pages/course/add/index.vue
+++ b/src/pages/course/add/index.vue
@@ -2,7 +2,7 @@
-
+
@@ -89,10 +89,6 @@ export default {
quill
},
methods: {
- // 返回
- goBack() {
- this.$router.back();
- },
save() {
if (this.submiting) return false;
if (!this.name) return util.warningMsg("请填写课程名称");
@@ -115,10 +111,9 @@ export default {
this.submiting = false;
util.successMsg("修改成功");
this.$router.back();
- })
- .catch(err => {
- this.submiting = false;
- });
+ }).catch(err => {
+ this.submiting = false;
+ });
} else {
this.$post(this.api.addCourse, data).then(res => {
this.submiting = false;
@@ -126,40 +121,33 @@ export default {
type: "success",
confirmButtonText: "马上设置",
cancelButtonText: "稍后操作"
- })
- .then(() => {
- this.$router.push(`courseConfig?id=${res.data.courseId}`);
- }).catch(() => {
+ }).then(() => {
+ this.$router.push(`/course/contentSettings?id=${res.courseId}`);
+ }).catch(() => {
this.$router.back();
});
- })
- .catch(err => {
- this.submiting = false;
- });
+ }).catch(err => {
+ this.submiting = false;
+ });
}
},
getClassification() {
this.$get(this.api.queryGlClassification).then(res => {
this.classificationList = res.classificationList;
- }).catch(res => {
- });
+ }).catch(res => {});
},
getData() {
- this.$get(`${this.api.getCourse}/${this.id}`)
- .then(res => {
- let data = res.course;
- this.name = data.name;
- this.classificationId = data.classificationId;
- this.description = data.description;
- this.coverUrl = data.coverUrl;
- this.uploadList.push({
- name: "cover.jpg",
- url: this.coverUrl
- });
- })
- .catch(err => {
-
+ this.$get(`${this.api.getCourse}/${this.id}`).then(res => {
+ let data = res.course;
+ this.name = data.name;
+ this.classificationId = data.classificationId;
+ this.description = data.description;
+ this.coverUrl = data.coverUrl;
+ this.uploadList.push({
+ name: "cover.jpg",
+ url: this.coverUrl
});
+ }).catch(err => {});
},
handleExceed(files, fileList) { // 上传文件
util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!");
@@ -182,8 +170,7 @@ export default {
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", "");
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.coverUrl = "";
- }).catch(res => {
- });
+ }).catch(res => {});
},
goback() { // 返回
if (this.isDetail) {
@@ -191,12 +178,9 @@ export default {
} else {
this.$confirm("确定返回?未更新的信息将不会保存。", "提示", {
type: "warning"
- })
- .then(() => {
- this.$router.back();
- })
- .catch(() => {
- });
+ }).then(() => {
+ this.$router.back();
+ }).catch(() => {});
}
}
}