vue + element的upload上传文件到腾讯云 SDK上传
根据台接口拿到临时密钥就可以直接用
<template>
<div class="up-img">
<el-upload
class="avatar-uploader"
action=""
:show-file-list="false"
:before-upload="beforeAvatarUpload"
:on-progress="getSing"
>
<img v-if="value" :src="value" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</div>
</template>
<script>
import COS from 'cos-js-sdk-v5'
import {
credential } from '@/api/live'
export default {
name: 'Upload',
props: {
value: {
type: String,
default: ''
}
},
data(