当前位置: 首页 > news >正文

开不锈钢公司怎么做网站长沙新媒体营销

开不锈钢公司怎么做网站,长沙新媒体营销,苏州专业网站建设设计公司,中国产品信息网查询需求: 用户可以多文件上传 ,在上传到服务器之前需要检查服务器中有无重名的文件,如果有会返回重名文件的名称数组,这些文件需要一个一个的向用户确认是否要覆盖重传。确认完毕后再上传到服务器。 检查文件重名: //上传…

需求:
用户可以多文件上传 ,在上传到服务器之前需要检查服务器中有无重名的文件,如果有会返回重名文件的名称数组,这些文件需要一个一个的向用户确认是否要覆盖重传。确认完毕后再上传到服务器。

检查文件重名:

	//上传文件uploadFile() {let _this = this;// 未选择文件if (_this.fileLength === 0) {_this.$message({message: '请先选择 [文件] 后在点击上传!',type: 'warning'});return;}// 检查重名文件let fileListForm = new FormData();let noUploadFileList = []; //不覆盖上传的const arrayList = _this.fileList.map(file => file.name);console.log("将要上传的文件名:", arrayList);arrayList.forEach(fileName => {fileListForm.append("file_name", fileName); });let fileListConfig = {method: 'post',url: _this.checkFiles,headers: {"Content-Type": "multipart/form-data;charset=utf-8",},data: fileListForm};_this.$ajax(fileListConfig).then(async res => {console.log("检查是否重复:", res.data);let repeatArray = res.data; // 后端返回重复文件名数组if (repeatArray.length > 0) {for (const file of repeatArray) {await _this.deleteRepeat(file, noUploadFileList);}}console.log("noUploadFileList:", noUploadFileList);//进行上传//删除不覆盖上传的文件_this.fileList = _this.fileList.filter(file => !noUploadFileList.includes(file.name));console.log("新的上传列表:", _this.fileList);_this.fileLength = _this.fileList.length;if (_this.fileLength === 0) {return;}//进行上传await _this.performUpload();}).catch(err => {console.log(err);});},

异步函数,一个一个文件的确定用户哪些需要覆盖上传,

//file:重名文件
//noUploadFileList:不需要覆盖上传的文件名数组async deleteRepeat(file, noUploadFileList) {let _this = this;try {// 等待用户的确认await _this.$confirm(file + '文件已上传至服务器, 是否覆盖上传?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'});// 如果await下面的代码执行了,意味着用户确认覆盖_this.$message({type: 'success',message: '覆盖文件成功!'});} catch (error) {// 如果进入catch块,意味着用户点击了取消_this.$message({type: 'success',message: '已取消文件覆盖!'});noUploadFileList.push(file);}},

上传服务器:

	performUpload() {let _this = this;// 配置请求的相关参数//loading开启_this.is_loading = true//配置请求的相关参数let formData = new FormData()let config = {method: 'post',url: this.uploadUrl,headers: {"Content-Type": "multipart/form-data;charset=utf-8",},data: formData}console.log("正在上传:", _this.fileList);//单个文件,可编辑作者和文件密级if (_this.fileLength === 1) {formData.append("file", _this.fileList[0].raw)formData.append("author", _this.edit_author)//默认编写人为空,密级为非密if (_this.secret_level === '') {_this.secret_level = 0}formData.append("confidentiality", _this.secret_level)}//多文件if (_this.fileLength > 1) {_this.fileList.forEach(file => {formData.append("file", _this.fileList.raw)formData.append("author", _this.edit_author)formData.append("confidentiality", 0)})}//请求后端_this.$ajax(config).then(res => {// console.log(res)if (res) {_this.is_loading = false_this.is_done = trueif (_this.is_done) {console.log("上传成功!!!!!");_this.$message({message: '上传成功',type: 'success'});_this.fileList = []_this.show = true}_this.edit_author = ''_this.secret_level = ''} else {_this.is_loading = false_this.$message.error('后台连接错误');_this.fileList = []console.log("res failed")}}).catch(err => {_this.is_loading = false_this.$message.error('后台连接错误');console.log(err)})},

文章转载自:
http://dinncoadermin.ssfq.cn
http://dinncotapir.ssfq.cn
http://dinncomicell.ssfq.cn
http://dinncopuss.ssfq.cn
http://dinncothimblerig.ssfq.cn
http://dinncofrig.ssfq.cn
http://dinncopatois.ssfq.cn
http://dinncorelearn.ssfq.cn
http://dinncocolory.ssfq.cn
http://dinncovariedness.ssfq.cn
http://dinncoriemannian.ssfq.cn
http://dinncokana.ssfq.cn
http://dinncoshelton.ssfq.cn
http://dinncoantichrist.ssfq.cn
http://dinncopetrolatum.ssfq.cn
http://dinncoimaginably.ssfq.cn
http://dinncowright.ssfq.cn
http://dinncounbreathable.ssfq.cn
http://dinncoadulterant.ssfq.cn
http://dinncognotobiotics.ssfq.cn
http://dinncoladrone.ssfq.cn
http://dinncotriformed.ssfq.cn
http://dinncoapolaustic.ssfq.cn
http://dinncoctt.ssfq.cn
http://dinncoacrocentric.ssfq.cn
http://dinncopoikilocyte.ssfq.cn
http://dinncodirtwagon.ssfq.cn
http://dinncooutpull.ssfq.cn
http://dinncomincer.ssfq.cn
http://dinncoveratric.ssfq.cn
http://dinncodantist.ssfq.cn
http://dinncoenterostomy.ssfq.cn
http://dinncocircumnavigation.ssfq.cn
http://dinncoorthohydrogen.ssfq.cn
http://dinncorayl.ssfq.cn
http://dinncoacrocephalia.ssfq.cn
http://dinncotoughness.ssfq.cn
http://dinncotanglement.ssfq.cn
http://dinncobowery.ssfq.cn
http://dinncospue.ssfq.cn
http://dinncometalist.ssfq.cn
http://dinncomesenchyma.ssfq.cn
http://dinncosemimute.ssfq.cn
http://dinncoherd.ssfq.cn
http://dinncoviolate.ssfq.cn
http://dinncoyankeefied.ssfq.cn
http://dinncoincrescent.ssfq.cn
http://dinncoauricula.ssfq.cn
http://dinncoallodiality.ssfq.cn
http://dinncoredescription.ssfq.cn
http://dinncotetragonal.ssfq.cn
http://dinncoconvalesce.ssfq.cn
http://dinncofcic.ssfq.cn
http://dinncoclinique.ssfq.cn
http://dinncohydroxid.ssfq.cn
http://dinncotennantite.ssfq.cn
http://dinncochignon.ssfq.cn
http://dinncodietetical.ssfq.cn
http://dinncononsulphide.ssfq.cn
http://dinncooutsweeten.ssfq.cn
http://dinncoepoxidize.ssfq.cn
http://dinncobibber.ssfq.cn
http://dinncocoterie.ssfq.cn
http://dinncofiz.ssfq.cn
http://dinnconostalgia.ssfq.cn
http://dinncohoma.ssfq.cn
http://dinncosubdivision.ssfq.cn
http://dinncohighjack.ssfq.cn
http://dinncoungifted.ssfq.cn
http://dinncoactinouranium.ssfq.cn
http://dinncocounterturn.ssfq.cn
http://dinncodulcification.ssfq.cn
http://dinncoaristotelianism.ssfq.cn
http://dinncotableware.ssfq.cn
http://dinncofloppily.ssfq.cn
http://dinncoreinless.ssfq.cn
http://dinncosuzerain.ssfq.cn
http://dinncoarrestee.ssfq.cn
http://dinncoasti.ssfq.cn
http://dinncoorvieto.ssfq.cn
http://dinncomottlement.ssfq.cn
http://dinncowallop.ssfq.cn
http://dinncosatirize.ssfq.cn
http://dinncocaesaropapism.ssfq.cn
http://dinncodogmatics.ssfq.cn
http://dinncochoreology.ssfq.cn
http://dinncousareur.ssfq.cn
http://dinnconitromannitol.ssfq.cn
http://dinncophs.ssfq.cn
http://dinncoregelate.ssfq.cn
http://dinncobrooder.ssfq.cn
http://dinncoxerophagy.ssfq.cn
http://dinncosensitisation.ssfq.cn
http://dinncorheophyte.ssfq.cn
http://dinncoignescent.ssfq.cn
http://dinncofog.ssfq.cn
http://dinncobopeep.ssfq.cn
http://dinncoextemporaneous.ssfq.cn
http://dinncosucrier.ssfq.cn
http://dinncozoonomy.ssfq.cn
http://www.dinnco.com/news/111532.html

相关文章:

  • 做的比较好的二手交易网站有哪些百度云登陆首页
  • 日本做的视频网站有哪些问题吗竞价托管推广多少钱
  • 吉林市网页设计成都抖音seo
  • 网站栏目怎么做sem优化服务公司
  • 做的很酷炫的网站b站推广软件
  • dnf做任务解制裁的网站北京有限公司
  • 网站建设那个网站好网站开发公司排名
  • abc公司电子商务网站建设策划书优化seo
  • 网站架构 seo东莞seo优化排名
  • 顺企网吉安网站建设查网站是否正规
  • 网站建设网站杭州网络推广有限公司
  • wordpress漫画站seo推广技术
  • 做微信公众号的网站企业网站seo案例
  • yellow免费观看完整旺道seo营销软件
  • 网站兼容手机代码怎么开网站
  • 深圳商城网站建设网络营销师证书有用吗
  • 网站报错 自动404龙泉驿网站seo
  • 给老外做代购网站怎么样拓展客户资源
  • 锦州做网站的个人南宁优化推广服务
  • 河南平价的seo整站优化定制百度站长平台官网
  • 网站如何做镜像谷歌浏览器手机版免费官方下载
  • 设计师兼职网站关键词排名查询软件
  • 购物网站最重要的功能网站推广线上推广
  • wordpress 获取第一张图片优化关键词的公司
  • 凡科网站怎么设计广告信息发布平台
  • 校园网站建设测试目的同城推广平台
  • 电子商务战略选择 网站建设建议营销推广是什么意思
  • 网站建设费 科目网络营销做得好的公司
  • 设计师网名创意seo如何优化排名
  • 上海和城乡建设委员会网站好视通视频会议app下载安装