mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
修改
This commit is contained in:
@@ -14,10 +14,10 @@ VUE_APP_BOE_WEB_URL = 'https://u.boe.com'
|
||||
VUE_APP_BOE_MOBILE_URL = 'http://192.168.0.10:8082/mobile'
|
||||
|
||||
# File路径的基础url
|
||||
VUE_APP_FILE_BASE_URL = 'http://localhost:9090/cdn/upload'
|
||||
VUE_APP_FILE_BASE_URL = 'http://localhost:8091/upload'
|
||||
|
||||
# File路径的基础url的相对路径,加此项是为了不影响之前的路径配置
|
||||
VUE_APP_FILE_RELATIVE_PATH = 'http://localhost:9090/cdn/upload'
|
||||
VUE_APP_FILE_RELATIVE_PATH = '/upload'
|
||||
|
||||
# 登录地址
|
||||
VUE_APP_LOGIN_URL='/pc/login'
|
||||
|
||||
@@ -14,7 +14,7 @@ VUE_APP_BOE_WEB_URL = 'https://u.boe.com/preview'
|
||||
VUE_APP_BOE_MOBILE_URL = 'http://u.boe.com'
|
||||
|
||||
# File路径的基础url
|
||||
VUE_APP_FILE_BASE_URL='http://u-pre.boe.com/upload'
|
||||
VUE_APP_FILE_BASE_URL='http://u.boe.com/upload'
|
||||
|
||||
# File路径的基础url的相对路径,加此项是为了不影响之前的路径配置
|
||||
VUE_APP_FILE_RELATIVE_PATH = '/upload'
|
||||
@@ -23,4 +23,4 @@ VUE_APP_FILE_RELATIVE_PATH = '/upload'
|
||||
VUE_APP_PUBLIC_PATH='/pc'
|
||||
|
||||
# 登录地址
|
||||
VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/'
|
||||
VUE_APP_LOGIN_URL='https://u.boe.com/web/'
|
||||
|
||||
@@ -459,7 +459,6 @@ export default {
|
||||
$this.$message.error('加载pdf课件文件失败');
|
||||
}
|
||||
});
|
||||
|
||||
//let url = this.fileBaseUrl + r.content;
|
||||
}else if(con.contentType ==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
@@ -500,34 +499,19 @@ export default {
|
||||
createPlayUrl(fid,u){
|
||||
let nowDate=new Date();
|
||||
let ctime=parseInt(nowDate.getTime()/1000);
|
||||
let beforeUrl=parseInt(nowDate.getTime()/1000)+u;
|
||||
let beforeUrl=parseInt(nowDate.getTime()/1000)+'/'+fid;
|
||||
//console.log(beforeUrl,'beforeUrl');
|
||||
//let urlSign=encodeURIComponent(encrypt(beforeUrl));
|
||||
let urlSign=encodeURIComponent(encrypt(beforeUrl));
|
||||
//console.log(urlSign,'urlSign');
|
||||
cookies.set('PLAYSIGN_TIME', ctime);//写客户端的cookie保存
|
||||
//this.blobUrl=process.env.VUE_APP_BASE_API+'/xboe/m/course/play/resource?sign='+urlSign;
|
||||
this.blobUrl=process.env.VUE_APP_BASE_API+'/xboe/course/resource?fid='+fid;
|
||||
//this.blobUrl='http://127.0.0.1:9090/xboe/course/resource?fid='+fid;
|
||||
//this.blobUrl=this.fileBaseUrl+u;
|
||||
//以下判断是为了区分本地环境和服务器环境
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
this.blobUrl=process.env.VUE_APP_FILE_BASE_URL+u;
|
||||
}else{
|
||||
this.blobUrl=process.env.VUE_APP_BASE_API+'/xboe/m/course/cware/resource?sign='+urlSign;
|
||||
}
|
||||
//console.log(this.blobUrl,'this.blobUrl');
|
||||
},
|
||||
createVideoBlob(url){
|
||||
let $this=this;
|
||||
let xhr = new XMLHttpRequest;
|
||||
xhr.open("GET",url,true);
|
||||
xhr.responseType = 'blob';
|
||||
//xhr.onload:只有 4 状态会触发
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState==4 && xhr.status == 200) {//请求成功
|
||||
//获取blob对象
|
||||
let blob = xhr.response;
|
||||
//获取blob对象地址,并把值赋给容器
|
||||
let urlObj = window.URL.createObjectURL(blob);
|
||||
$this.blobUrl=urlObj;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
},
|
||||
showQrimage(row){
|
||||
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
// https://u.boe.com/mobile/pages/resource/microDetail?id=963456709515939840
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
<div v-if="resType == 10" style="position: relative;">
|
||||
<videoPlayer id="myVideoPlayer" v-if="resType == 10"
|
||||
:src="fileBaseUrl+curriculumData.url"
|
||||
:src="blobUrl"
|
||||
@onPlayerPlaying="onPlayerPlaying"
|
||||
:initTime="contentData.lastStudyTime"
|
||||
@onPlayerPlay="onPlayerPlay"
|
||||
@@ -257,7 +257,9 @@ import pdfPreview from '@/components/PdfPreview/index.vue';
|
||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||
import videoPlayer from '@/components/VideoPlayer/index.vue';
|
||||
import hyperLink from '@/components/Course/hyperLink.vue';
|
||||
import studyUtil from '@/utils/study.js';
|
||||
import studyUtil from '@/utils/study.js';
|
||||
import {encrypt} from '@/utils/jsencrypt.js';
|
||||
import cookies from 'vue-cookies'
|
||||
export default {
|
||||
name: 'ucStudyIndex',
|
||||
components: { courseImage, portalHeader, portalFooter, hyperLink, comments, homework, exam, interactBar, assess, pdfPreview, audioPlayer, videoPlayer },
|
||||
@@ -343,23 +345,22 @@ export default {
|
||||
return treeList;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createVideoBlob(url){
|
||||
let $this=this;
|
||||
let xhr = new XMLHttpRequest;
|
||||
xhr.open("GET",url,true);
|
||||
xhr.responseType = 'blob';
|
||||
//xhr.onload:只有 4 状态会触发
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState==4 && xhr.status == 200) {//请求成功
|
||||
//获取blob对象
|
||||
let blob = xhr.response;
|
||||
//获取blob对象地址,并把值赋给容器
|
||||
let urlObj = window.URL.createObjectURL(blob);
|
||||
$this.blobUrl=urlObj;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
methods: {
|
||||
createPlayUrl(fid,u){
|
||||
let nowDate=new Date();
|
||||
let ctime=parseInt(nowDate.getTime()/1000);
|
||||
let beforeUrl=parseInt(nowDate.getTime()/1000)+'/'+fid;
|
||||
//console.log(beforeUrl,'beforeUrl');
|
||||
let urlSign=encodeURIComponent(encrypt(beforeUrl));
|
||||
//console.log(urlSign,'urlSign');
|
||||
cookies.set('PLAYSIGN_TIME', ctime);//写客户端的cookie保存
|
||||
//以下判断是为了区分本地环境和服务器环境
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
this.blobUrl=process.env.VUE_APP_FILE_BASE_URL+u;
|
||||
}else{
|
||||
this.blobUrl=process.env.VUE_APP_BASE_API+'/xboe/m/course/cware/resource?sign='+urlSign;
|
||||
}
|
||||
console.log(this.blobUrl,'this.blobUrl');
|
||||
},
|
||||
widthOpen(url) {
|
||||
window.open(url, '_blank');
|
||||
@@ -815,8 +816,8 @@ export default {
|
||||
this.curriculumData.url = r.content;
|
||||
}
|
||||
//let url=process.env.VUE_APP_BASE_API+'/xboe/m/course/file/show?cf='+this.curriculumData.url;
|
||||
let url=this.fileBaseUrl+this.curriculumData.url;
|
||||
//this.createVideoBlob(url);
|
||||
//let url=this.fileBaseUrl+this.curriculumData.url;
|
||||
this.createPlayUrl(r.contentRefId,this.curriculumData.url);
|
||||
} else if (r.contentType == 40) {
|
||||
// if (r.content != '' && r.content.indexOf('.pdf') == -1) {
|
||||
apiCourseFile.detail(r.contentRefId).then(cfrs => {
|
||||
|
||||
Reference in New Issue
Block a user