//队伍证书上传
getFile() {
var that = this;
// //1 创建formData
let formData = new FormData(); // //2 添加数据,key可以重复。不会被覆盖。因此可以多文件上传。多文件都放在同一个formData对象中
// formData.append('file', xx);
// formData.append('file', xx);
formData.append('id', that.consult_data.id);
console.log(Array.from(that.$refs.more.files));
Array.from(that.$refs.more.files).forEach((file) => {
formData.append('certs', file);
}); // //3 发送请求, 注意请求头数据类型要用 'multipart/form-data'
that.axios
.post(`entryFormController/uploadCert.do`, formData, {
'Content-Type': 'multipart/form-data;',
})
.then((res) => {
if (res.data.code == 200) {
that.loadList();
that.$message.success('成功上传' + res.data.data + '个证书');
} else if (res.data.code == 400) {
that.$message.error(res.data.message);
}
});
}, //队员证书上传
seeFile(index) {
var that = this;
// //1 创建formData
let formData = new FormData();
console.log(66666666666, that.listed);
// //2 添加数据,key可以重复。不会被覆盖。因此可以多文件上传。多文件都放在同一个formData对象中
formData.append('id', that.consult_data.users[index].id); formData.append('cert', that.$refs['rend' + index].files[0]); // //3 发送请求, 注意请求头数据类型要用 'multipart/form-data'
that.axios
.post(`entryFormController/uploadCert.do`, formData, {
'Content-Type': 'multipart/form-data;',
})
.then((res) => {
if (res.data.code == 200) {
that.$message.success('操作成功');
that.teamList(that.consult_data);
}
console.log(res);
});
},

vue上传证书的更多相关文章

  1. iOS极光推送,两次Bundleid不一致( 开发证书没有通过验证 是否重新上传证书)的解决方案

    极光在配置ios端推送时,需要上传p12证书,如果遇到如下图:: 证书上传未通过的原因一般有: 1.当前上传的p12证书密码输入有误: 2. 证书导出的时候展开了证书,把个人私钥导了出来,导证书的时候 ...

  2. powershell上传证书

    https://www.cnblogs.com/threestone/p/4001632.html powershell上传证书

  3. vue 上传文件 和 下载文件

    Vue上传文件,不必使用什么element 的uplaod, 也不用什么npm上找的个人写的包,就用原生的Vue加axios就行了, 废话不多说,直接上代码:html: <input type= ...

  4. 阿里云slb上传证书错误

    阿里云上传证书错误 今天在阿里云给slb上传新买的证书,传的过程中报错了,如下: 网上找了半天没找到,鼠标放在错误哪行行首,会报一个错 大意就是一行最多64个字符,我检查了下,报错这行是68个字符,于 ...

  5. vue 上传文件 和 下载文件 面试的时候被问到过

    Vue上传文件,不必使用什么element 的uplaod, 也不用什么npm上找的个人写的包,就用原生的Vue加axios就行了, 废话不多说,直接上代码:html: <input type= ...

  6. vue 上传进度显示

    参考资料: https://ask.csdn.net/questions/767017 https://www.cnblogs.com/best-fyx/p/11363506.html 我使用的是el ...

  7. Azure PowerShell (3) 上传证书

    <Windows Azure Platform 系列文章目录> 本文介绍的是国外的Azure Global Update 2015-09-01 发现一个新的命令,在Azure PowerS ...

  8. iOS开发极光推送显示 开发证书没有通过验证 是否重新上传证书?解决方法

    1.证书密码错误 2证书环境不匹 3导证书时因手误把私钥导出来了,而不是证书 1.当前上传的p12证书密码输入有误: 2. 证书导出的时候展开了证书,把个人私钥导了出来,导证书的时候请不要展开证书: ...

  9. axios+Vue上传文件显示进度

    一,前言 最近在用Vue,然后上传文件时需要显示进度,于是网上搜了一下,经过自己实测终于也弄明白了 二,效果 三,代码 HTML代码 <div id="app"> &l ...

  10. vue上传文件

    <div> <input type="file" class="file" name="file" @change=&qu ...

随机推荐

  1. linux查找服务位置

  2. js之new的原理和源码

    new的原理即作用: function Student(name,age){ this.name=name; this.age=age; } var stu=new Student("小明& ...

  3. kill 多个进程的脚本

    杀死多个进程的脚本 #!/bin/bash pids=$(ps -ef | grep warehouse |awk '{print $2}') for pid in $pids do echo $pi ...

  4. IntelliJ IDEA修改系统缓存目录

    IntelliJ IDEA修改系统缓存目录 博客分类: intellij IDEA使用 IntelliJ IDEAIDEA缓存  阅读更多 intellij IDEA在第一次启动时,会在${user. ...

  5. Linux下获取线程ID tid的方法

    使用Linux Redhat7编写代码的时候,需要使用 gettid() 函数获取线程ID.使用 man gettid 命令查看了一下,gettid()函数的头文件是 #include<sys/ ...

  6. 2345 ip

    121.201.101.43 img1.2345.com121.201.101.43 img2.2345.com121.201.101.43 img3.2345.com121.201.101.43 i ...

  7. js时间戳转换

    第一个参数传时间戳,第二个连接符可以看你的心情,我喜欢'-' formatDate(value, spe = '/') { value = value * 1000 //10位数时间戳要乘1000 1 ...

  8. php严格模式的使用

    <?php declare (strict_types = 1); namespace app\controller; use app\BaseController; use think\fac ...

  9. 类Class

    C# 类(Class) 当你定义一个类时,你定义了一个数据类型的蓝图.这实际上并没有定义任何的数据,但它定义了类的名称意味着什么,也就是说,类的对象由什么组成及在这个对象上可执行什么操作.对象是类的实 ...

  10. interpreting non ascii codepoint

    ProtoBuf 在Windows VS2019 C++平台上的使用 这两天想着了解一下protobuf,搜索了一篇博客照着弄了一下 https://blog.csdn.net/weixin_4478 ...