|
@@ -7,7 +7,7 @@
|
|
|
<span>上传 IM 图片</span>
|
|
<span>上传 IM 图片</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="text item">
|
|
<div class="text item">
|
|
|
- <el-tooltip class="item" effect="dark" content="点击上传图片" placement="top-end">
|
|
|
|
|
|
|
+ <el-tooltip v-if="imgOssUrl !== null" class="item" effect="dark" content="点击上传图片" placement="top-end">
|
|
|
<el-upload
|
|
<el-upload
|
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
|
:action="imgOssUrl"
|
|
:action="imgOssUrl"
|
|
@@ -34,23 +34,24 @@
|
|
|
<span>OSS 地址</span>
|
|
<span>OSS 地址</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="text item">
|
|
<div class="text item">
|
|
|
- <el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
|
|
+ <el-form ref="form" :model="formData" label-width="80px">
|
|
|
<el-form-item label="视频地址">
|
|
<el-form-item label="视频地址">
|
|
|
- <el-input v-model="form.fileUrl" style="padding-right: 1px" readonly />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="图片地址">
|
|
|
|
|
- <el-input v-model="form.imageUrl" style="padding-right: 1px" readonly />
|
|
|
|
|
|
|
+ <el-input v-model="formData.uploadId" style="padding-right: 1px" readonly />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
+ <el-row v-if="imageUrl !== null" style="padding-right: 5px; padding-left: 5px; padding-bottom: 5px">
|
|
|
|
|
+ <el-image :src="imageUrl" />
|
|
|
|
|
+ </el-row>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import { getServerInfo } from '@/api/content'
|
|
import { getServerInfo } from '@/api/content'
|
|
|
|
|
+import { putImageFile } from '@/api/im'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'PublishFile',
|
|
name: 'PublishFile',
|
|
@@ -65,10 +66,12 @@ export default {
|
|
|
},
|
|
},
|
|
|
coverUrl: null,
|
|
coverUrl: null,
|
|
|
// ****************************************************************************************************************
|
|
// ****************************************************************************************************************
|
|
|
- form: {
|
|
|
|
|
- fileUrl: null,
|
|
|
|
|
- imageUrl: null
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ receiverId: 10011,
|
|
|
|
|
+ channelId: null,
|
|
|
|
|
+ uploadId: null
|
|
|
|
|
+ },
|
|
|
|
|
+ imageUrl: null
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -113,7 +116,14 @@ export default {
|
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
|
const resData = res.data
|
|
const resData = res.data
|
|
|
this.coverUrl = URL.createObjectURL(file.raw)
|
|
this.coverUrl = URL.createObjectURL(file.raw)
|
|
|
- this.form.imageUrl = resData.url
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.formData.channelId = this.imgData.channelId
|
|
|
|
|
+ this.formData.uploadId = resData.uploadId
|
|
|
|
|
+ putImageFile(this.formData).then(resp => {
|
|
|
|
|
+ if (resp.code === 0) {
|
|
|
|
|
+ this.imageUrl = resp.data
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
this.$notify({
|
|
this.$notify({
|
|
|
title: '提示',
|
|
title: '提示',
|