upload 上传 加token 在 :headers='headers' 注意 不要直接写$refs.upload.headers = {} 这样vue会警告 修改组件内部变量
<Upload :action="$baseUrl + 'API/file/upload'"
:show-upload-list="false"
:headers='headers'
ref='upload'
name="file"
type="drag"
:on-success="handleSuccess"
:before-upload="handleBeforeUpload">
import { getToken } from '@/libs/util'
export default {
data () {
return {
headers: { token: getToken() ? getToken() : ''
},