Commit ca055cf0 by unknown

'文件云存储COS前端对应'

1 parent 9ce536ad
......@@ -30,8 +30,7 @@ export default {
loading: false,
action:
process.env.VUE_APP_BASE_API +
window.CONFIG.services.wecom +
'/material/upload',
'/common/uploadFile2Cos',
headers: window.CONFIG.headers,
domain: process.env.VUE_APP_BASE_API
}
......@@ -102,8 +101,10 @@ export default {
onSuccess(res, file) {
if (res.code === 200) {
this.loading = false
this.$emit('update:fileUrl', res.data.materialUrl)
this.$emit('update:fileName', res.data.materialName)
// this.$emit('update:fileUrl', res.data.materialUrl)
// this.$emit('update:fileName', res.data.materialName)
this.$emit('update:fileUrl', res.url)
this.$emit('update:fileName', res.fileName)
// this.fileUrl = URL.createObjectURL(file.raw)
}
},
......@@ -132,7 +133,7 @@ export default {
>
<slot>
<template v-if="fileUrl">
<img v-if="type === '0'" :src="domain + fileUrl" class="upload-img" />
<img v-if="type === '0'" :src="fileUrl" class="upload-img" />
<div v-else-if="type === '2'">
<video
id="myVideo"
......@@ -145,7 +146,7 @@ export default {
:autoplay="false"
preload="auto"
>
<source :src="domain + fileUrl" type="video/mp4" />
<source :src="fileUrl" type="video/mp4" />
</video>
</div>
<div v-else>{{ fileName }}</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!