0
点赞
收藏
分享

微信扫一扫

spring.cloud.gateway.discovery.locator.enabled配置项分析

看山远兮 04-16 17:30 阅读 1

话不多说 上代码

<a-upload
style="margin-left: 8px"
:before-upload="beforeUpload"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
>
   <a-button> <a-icon type="upload" /> 导入 </a-button>
</a-upload>

 提示内容可以根据自己的来

formData是二进制文件流传给后端的

exportUser:后端提供的接口

   
import { Modal} from 'ant-design-vue'

beforeUpload(file) {
      const formData = new FormData()
      formData.append('file', file)
      exportUser(formData).then((res) => {
        if (res.code == 200) {
          Modal.success({
            title: '系统提示',
            content: res.message,
            okText: '知道了',
          })
        } else {
          Modal.error({
            title: '系统提示',
            content: res.message,
            okText: '知道了',
          })
        }
      })
      this.getList()
      return false
    },

export function exportUser(data){
  return axios({
    url: '/schedule/createImport',
    data: data,
    method:'post',
  })
}
举报

相关推荐

0 条评论