课程下的子模块返回时报404

This commit is contained in:
18571350067 2022-01-05 19:49:54 +08:00
parent 1a372f89d4
commit 68cd027a59
3 changed files with 29 additions and 21 deletions

View File

@ -118,7 +118,7 @@ export default {
courseQuestion(record) { courseQuestion(record) {
this.$router.push({ this.$router.push({
path: '/course/question/ExamQuestion', path: '/course/question/ExamQuestion',
query: { coursewareId: record.id, courseId: this.$route.query.id }, query: { coursewareId: record.id, courseId: this.$route.query.id, types: this.$route.query.type },
}) })
}, },
@ -128,7 +128,11 @@ export default {
if (!this.courseId) preview = true if (!this.courseId) preview = true
this.$router.push({ this.$router.push({
path: '/course/CoursewarePreview', path: '/course/CoursewarePreview',
query: { coursewareId: record.id, courseId: this.$route.query.id || this.courseId }, query: {
coursewareId: record.id,
courseId: this.$route.query.id || this.courseId,
types: this.$route.query.type,
},
}) })
}, },
}, },

View File

@ -99,10 +99,9 @@ export default {
props: { props: {
coursewareId: { coursewareId: {
type: Number, type: Number,
}
}, },
watch: {
}, },
watch: {},
data() { data() {
return { return {
images: [], images: [],
@ -142,8 +141,8 @@ export default {
if (this.courseware.videoList.length > 0) { if (this.courseware.videoList.length > 0) {
// //
if (this.courseware.image != '' || this.courseware.image) { if (this.courseware.image != '' || this.courseware.image) {
this.images = this.courseware.image.split(","); this.images = this.courseware.image.split(',')
this.playerOptions.poster = this.images[0]; this.playerOptions.poster = this.images[0]
} }
// //
if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0) if (this.courseware.type == '1') this.play(this.courseware.videoList[0].path, 0)
@ -164,7 +163,10 @@ export default {
methods: { methods: {
// //
goback() { goback() {
this.$router.push({ path: '/course/CoursewareList', query: { id: this.$route.query.courseId } }) this.$router.push({
path: '/course/CoursewareList',
query: { id: this.$route.query.courseId, type: this.$route.query.types },
})
}, },
/// ///
@ -178,10 +180,9 @@ export default {
// //
this.playerOptions.sources = [] this.playerOptions.sources = []
this.playerOptions.sources.push({ type: 'video/mp4', src: path }) this.playerOptions.sources.push({ type: 'video/mp4', src: path })
console.log("index",index); console.log('index', index)
console.log("images",this.images); console.log('images', this.images)
this.playerOptions.poster = this.images[index] this.playerOptions.poster = this.images[index]
} }
}, },

View File

@ -27,7 +27,7 @@ export default {
selectedRows: [], selectedRows: [],
form: { form: {
ids: '', ids: '',
coursewareId:'' coursewareId: '',
}, },
loadData: (parameter) => { loadData: (parameter) => {
return requiredList(Object.assign(parameter, this.queryParam)).then((res) => { return requiredList(Object.assign(parameter, this.queryParam)).then((res) => {
@ -47,7 +47,10 @@ export default {
methods: { methods: {
// //
goback() { goback() {
this.$router.push({ path: '/course/CoursewareList', query: { id: this.$route.query.courseId } }) this.$router.push({
path: '/course/CoursewareList',
query: { id: this.$route.query.courseId, type: this.$route.query.types },
})
}, },
onSelectChange(selectedRowKeys, selectedRows) { onSelectChange(selectedRowKeys, selectedRows) {
@ -59,15 +62,15 @@ export default {
// //
save() { save() {
this.form.ids = this.selectedRowKeys.toString(); this.form.ids = this.selectedRowKeys.toString()
this.form.coursewareId = this.$route.query.coursewareId; this.form.coursewareId = this.$route.query.coursewareId
console.log('from:{}', this.form) console.log('from:{}', this.form)
addOrUpdate(this.form).then((res) => { addOrUpdate(this.form).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message.info('保存成功') this.$message.info('保存成功')
// //
this.goback(); this.goback()
} }
}) })
}, },
@ -77,7 +80,7 @@ export default {
// id // id
requiredQuestionId({ coursewareId: this.$route.query.coursewareId }).then((res) => { requiredQuestionId({ coursewareId: this.$route.query.coursewareId }).then((res) => {
console.log('+++++++++++++', res) console.log('+++++++++++++', res)
this.selectedRowKeys = res.data; this.selectedRowKeys = res.data
}) })
}, },
}, },