阿里云oss

dev_review
yujialong 1 year ago
parent f1c6f571f8
commit 4597a8919e
  1. 4
      src/components/upload/index.vue
  2. 100
      src/views/course/contentSettings.vue
  3. 3
      src/views/match/list/index.vue
  4. 1720
      src/views/theoreticalCourse/contentSettings/index.vue

@ -111,7 +111,7 @@ export default {
});
this.uploading = false
const url = 'http://huoran.oss-cn-shenzhen.aliyuncs.com/' + name
const url = 'https://huoran.oss-cn-shenzhen.aliyuncs.com/' + name
this.changeFileList && this.$emit('update:fileList', [
...this.fileList,
{
@ -124,7 +124,7 @@ export default {
this.$emit('onSuccess', {
format: util.getFileExt(file.name),
name: file.name,
url: url,
url,
size: file.size,
})
} catch (error) { }

@ -169,25 +169,6 @@
<p>视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</p>
</template>
</Upload>
<!-- <el-upload :before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file">
<el-button size="small"><img src="@/assets/img/upload.png"
alt=""> 上传资源</el-button>
<div slot="tip"
class="el-upload__tip">视频请上传MP4格式大小不超过150Moffice文件大小不要超过10M</div>
</el-upload>
<el-progress v-if="showProgress"
:stroke-width="3"
:percentage="progressPercent"></el-progress> -->
</el-form-item>
<el-form-item label="小节名称">
<el-input placeholder="请输入小节名称"
@ -216,24 +197,6 @@
@onSuccess="uploadSuccess">
<div slot="tip"></div>
</Upload>
<!-- <el-upload :before-upload="beforeUpload"
:on-remove="handleRemove"
:on-error="uploadError"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:file-list="uploadList"
:headers="headers"
:http-request="handleRequest"
name="file">
<el-button size="small"><img src="@/assets/img/upload.png"
alt=""> 上传资源</el-button>
</el-upload>
<el-progress v-if="showProgress"
:stroke-width="3"
:percentage="progressPercent"></el-progress> -->
</div>
<span slot="footer"
class="dialog-footer">
@ -277,7 +240,7 @@
style="transform: scale(1) rotate(0deg);margin-top: -1px; max-height: 100%; max-width: 100%;">
</div>
</div>
<div v-show="iframeSrc"
<div v-show="iframeSrc || videoSrc"
class="el-image-viewer__wrapper"
:class="{active: iframeSrc}"
style="z-index: 2000">
@ -293,6 +256,16 @@
id="fileIframe"
:src="iframeSrc"
frameborder="0"></iframe>
<video v-if="videoSrc"
class="video"
width="1200"
height="600"
autoplay
controls>
<source :src="videoSrc"
type="video/mp4">
您的浏览器不支持 video 标签
</video>
<template v-if="showMask">
<div class="mask"
style="width: 200px;height: 30px;top: 53px;right: 320px"></div>
@ -412,6 +385,7 @@ export default {
fileUrl: "",
originalFileName: "",
fileType: "",
videoSrc: '',
playAuth: "",
player: null,
previewImg: "",
@ -548,6 +522,7 @@ export default {
},
uploadSuccess (file) {
this.uploading = false
this.fileId = ''
this.fileType = file.format
this.fileUrl = file.url
this.fileName = file.name
@ -802,18 +777,18 @@ export default {
},
//
download (row) {
const { fileType } = row
const { fileType, fileId } = row
// ppt
if (fileType === 'pptx') {
this.downloadFile(row.name, row.fileUrl)
} else if (fileType === 'mp4') {
//
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
const player = new Aliplayer({
} else if (fileId) {
//
this.$get(`${this.api.getPlayAuth}/${fileId}`).then(res => {
new Aliplayer({
id: "playerDownload",
width: "100%",
autoplay: false,
vid: row.fileId,
vid: fileId,
playauth: res.data.playAuth,
encryptType: 1 //
}, player => {
@ -826,22 +801,26 @@ export default {
},
preview (row) {
if (this.transferType(row.fileType) == "视频") {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {
this.player = new Aliplayer({
id: "player",
width: "100%",
autoplay: false,
vid: row.fileId,
playauth: this.playAuth,
encryptType: 1 //
});
}
}).catch(res => {
});
//
if (row.fileId) {
this.$get(`${this.api.getPlayAuth}/${row.fileId}`).then(res => {
this.playAuth = res.data.playAuth;
if (this.player) {
this.player.replayByVidAndPlayAuth(row.fileId, this.playAuth);
} else {
this.player = new Aliplayer({
id: "player",
width: "100%",
autoplay: false,
vid: row.fileId,
playauth: this.playAuth,
encryptType: 1 //
});
}
}).catch(res => { });
} else {
this.videoSrc = row.fileUrl
}
} else if (this.transferType(row.fileType) == "图片") {
this.previewImg = row.fileUrl;
} else if (row.fileType == "pdf") {
@ -984,6 +963,7 @@ export default {
},
closeIframe () {
this.iframeSrc = "";
this.videoSrc = ''
this.showMask = false;
this.showMask1 = false;
this.showMask2 = false;

@ -423,7 +423,8 @@ export default {
})
this.$post(this.api.editCompetitionContent, {
competitionContents: data
}).then(res => {
}).then(async res => {
await this.$post(`${this.api.refreshPageNotification}?content=1`)
util.successMsg('修改成功')
this.modifyVisible = false
this.getData()

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save