<template>
  <div class="upload-wrapper">
    <el-upload
      class="upload-demo"
      drag
      action="http://127.0.0.1:8989/upload"
      multiple
      :headers="{'Authorization': token}"
      :on-success="handleMethodSuccess"
    >
      <i class="el-icon-upload" />
      <div class="el-upload__text">将文件拖拽到此处，或<em>点击上传</em></div>
    </el-upload>
  </div>
</template>

<script>
import { getToken } from '@/utils/auth'
export default {
  computed: {
    token() {
      return getToken()
    }
  },
  methods: {
    handleMethodSuccess() {
      // console.log('handleMethodSuccess')
    }
  }
}
</script>

<style lang="scss">
  .upload-wrapper {
    padding: 30px;
  }
</style>
