调整课程资源显示链接

main
陈沅 7 months ago
parent 089e9ebd1e
commit 03ca8754ae

@ -23,6 +23,14 @@ import {formatFloat, toDecimal, toDecimalx} from "./common/ulit";
Vue.prototype.$Base64 = Base64; Vue.prototype.$Base64 = Base64;
Vue.use(VueCookies); Vue.use(VueCookies);
Vue.prototype.$video = Video; Vue.prototype.$video = Video;
Vue.prototype.$processUrl = function(url) {
if (url.startsWith('/UploadFiles')) {
return `http://cloud.sztzjy.com/${url}`;
} else {
return this.$isHttp(url);
}
};
Video.Hls.xhr.beforeRequest = function(options) { //添加请求头token Video.Hls.xhr.beforeRequest = function(options) { //添加请求头token
options.headers = options.headers || {}; options.headers = options.headers || {};
options.headers.token = Vue.prototype.$getToken(); options.headers.token = Vue.prototype.$getToken();

@ -16,7 +16,7 @@
<template v-for="(item, index) in courseList" > <template v-for="(item, index) in courseList" >
<li :key="index"> <li :key="index">
<el-row class="img_course_center"> <el-row class="img_course_center">
<el-image @click="courseHome(item,index)" :src="$isHttp(item.courseCover)" class="img c_p"></el-image> <el-image @click="courseHome(item,index)" :src="$processUrl(item.courseCover)" class="img c_p"></el-image>
<el-row class="cz_li"> <el-row class="cz_li">
<!-- <el-col :span="12" class="tc" style="border-right: 1px solid white;"> <!-- <el-col :span="12" class="tc" style="border-right: 1px solid white;">
<el-link style="color: white;" @click="courseTop(item,index)" :underline="false" type="primary">置顶</el-link> <el-link style="color: white;" @click="courseTop(item,index)" :underline="false" type="primary">置顶</el-link>
@ -142,7 +142,7 @@ export default {
this.$addSystemUseLog(param); this.$addSystemUseLog(param);
},timeNum); },timeNum);
// //
} },
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timeIn); // clearInterval(this.timeIn); //

@ -212,21 +212,21 @@ export default {
this.show.PDFShow = data.resourcesInfoType == 3?true:false; this.show.PDFShow = data.resourcesInfoType == 3?true:false;
this.show.imgShow = data.resourcesInfoType == 5?true:false; this.show.imgShow = data.resourcesInfoType == 5?true:false;
if(data.resourcesInfoType == 1){ if(data.resourcesInfoType == 1){
this.player.src({src:this.$isHttp(data.resourcesInfoContent),type:data.resourcesInfoContent.indexOf(".mp4")>=0?'video/mp4':'video/webm'}); this.player.src({src:this.$processUrl(data.resourcesInfoContent),type:data.resourcesInfoContent.indexOf(".mp4")>=0?'video/mp4':'video/webm'});
this.player.play(); // this.player.play(); //
}else if(data.resourcesInfoType == 2){ }else if(data.resourcesInfoType == 2){
if(data.resourcesInfoContent.indexOf(".pdf") >= 0 || data.resourcesInfoContent.indexOf(".PDF") >= 0 ){ if(data.resourcesInfoContent.indexOf(".pdf") >= 0 || data.resourcesInfoContent.indexOf(".PDF") >= 0 ){
this.show.PDFUrl = this.$isHttp(data.resourcesInfoContent); this.show.PDFUrl = this.$processUrl(data.resourcesInfoContent);
this.show.fileShow = false; this.show.fileShow = false;
this.show.PDFShow = true; this.show.PDFShow = true;
}else{ }else{
this.show.fileUrl = this.$viewUrl + this.$isHttp(data.resourcesInfoContent); this.show.fileUrl = this.$viewUrl + this.$processUrl(data.resourcesInfoContent);
this.show.fileShow = true; this.show.fileShow = true;
this.show.PDFShow = false; this.show.PDFShow = false;
} }
}else if(data.resourcesInfoType == 3){ }else if(data.resourcesInfoType == 3){
this.show.PDFUrl = this.$isHttp(data.resourcesInfoContent); this.show.PDFUrl = this.$processUrl(data.resourcesInfoContent);
}else if(data.resourcesInfoType == 5){ }else if(data.resourcesInfoType == 5){
this.show.imgUrl = data.resourcesInfoContent; this.show.imgUrl = data.resourcesInfoContent;
this.show.imgTitle = data.resourcesInfoName; this.show.imgTitle = data.resourcesInfoName;

@ -213,6 +213,7 @@ export default {
} }
}, },
look(item){ // look(item){ //
debugger
if(item.resourcesInfoType == 4){ if(item.resourcesInfoType == 4){
window.open(item.resourcesInfoContent.indexOf("http") == 0?item.resourcesInfoContent:"http://"+item.resourcesInfoContent); window.open(item.resourcesInfoContent.indexOf("http") == 0?item.resourcesInfoContent:"http://"+item.resourcesInfoContent);
}else{ }else{

@ -3,7 +3,7 @@
<div> <div>
<div class="course_index"> <div class="course_index">
<el-row> <el-row>
<el-image style="width: 243px;height: 140px;float: left;margin-right: 20px;border: 1px solid #E1E1E1;" :src="courseInfo.courseInfoThumbnail"></el-image> <el-image style="width: 243px;height: 140px;float: left;margin-right: 20px;border: 1px solid #E1E1E1;" :src="$processUrl(courseInfo.courseInfoThumbnail)"></el-image>
<p class="fontB" style="margin-top:0 ;">{{courseInfo.courseInfoName}}</p> <p class="fontB" style="margin-top:0 ;">{{courseInfo.courseInfoName}}</p>
<el-row class="courseInfoContent" style="line-height: 27px;word-break:break-all" v-html="courseInfo.courseInfoContent"></el-row> <el-row class="courseInfoContent" style="line-height: 27px;word-break:break-all" v-html="courseInfo.courseInfoContent"></el-row>
</el-row> </el-row>

Loading…
Cancel
Save