页面: <el-form-item label="应用APP名称:" prop="appCode" > <el-select class="filter-item" v-model="form.appCode" style="width: 30%;" > <el-option v-for="item in appNameList" :key="item.key" :label="item.name" :value="item.key"> </el-option> </el-select> </el-form-item>
<el-form-item label=" 安 装 包 :" prop="url"> <el-upload ref='upload' class="upload-demo" :file-list="fileList" drag action="/api/system/upload/uploadIosPackage" :data="abcd" :before-upload="beforeUpload" :on-success="handleSuccess" > <div v-if="form.url"></div> <div v-if="form.fileSize"></div> <div v-else> <i class="el-icon-upload"></i> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> </div> </el-upload> </el-form-item>
script:
import axios from 'axios';
data() { return {
abcd: {"abc":"123"},
} }
beforeUpload (file) { let fd = new FormData(); fd.append('file', file); fd.append('appCode',this.form.appCode);//其他参数 axios.post("/api/system/versionExt/uploadIosPackage", fd, { }); return true },
后端: