收藏
回答

上传代码报错:上传失败:网络请求错误 非法的文件。上午还好好的,下午提示更新版本,更下版本就这样了?

现在是最新版本1.06.2307260,

上午提过好几次都成功了,代码基本没动

回答关注问题邀请回答
收藏

4 个回答

  • 工号 9527
    工号 9527
    2023-09-04

    你看看这个文件勒

    2023-09-04
    有用
    回复 2
    • 小迪
      小迪
      发表于移动端
      2023-09-04
      这个文件一直没动过….我又下载了低版本的05那个版本,又成功了,所以新版本怎么不行
      2023-09-04
      回复
    • 工号 9527
      工号 9527
      2023-09-05回复小迪
      给个代码片段看下?
      2023-09-05
      回复
  • ~~
    ~~
    2023-09-19

    今天更新了一下微信开发者工具,然后就报你这个错了。

    新版本得把js转es勾选上才行。

    2023-09-19
    有用 1
    回复 1
    • ~~
      ~~
      2023-09-19
      将JS编译成ES5
      2023-09-19
      回复
  • Tony Stark
    Tony Stark
    2023-09-20

    遇到同样的问题,错误文件:

    uniapp打包后的文件:

    require('../../common/vendor.js');// 流程通用mixin on('flowAudit')
    import { flowDetail, auditAgree, auditReject, flowAudit, getFlowBase } from "@/api/api";
    import { formatDate, previewFile, getImagePath, countNumber } from "@/utils";
    
    
    const AnalysysAgent = uni.AnalysysAgent;
    
    
    const mixin = {
    	data: function () {
    		return {
    			status: "loading",
    			params: {},
    			baseFlow: {},
    			base: {},
    			info: {},
    			edit: false,
    			auditStatus: "start", // start:准备开始 in:进行中 end:结束
    		};
    	},
    	methods: {
    		dateFormat(dateTime, format = "yyyy-MM-dd") {
    			if (dateTime) {
    				return formatDate(dateTime, format);
    			}
    			return "";
    		},
    		numberSum(list) {
    			return countNumber(list);
    		},
    		formChange(key, value) {
    			this.$set(this.form, key, value);
    		},
    		formValueChange(key, event) {
    			this.formChange(key, event.detail.value);
    		},
    		bindTransfer() {
    			// 转派
    			let { params } = this;
    			uni.navigateTo({ url: `/packageB/pages/task/transfer/index?taskId=${params.taskId}` });
    		},
    		bindHideButton(audit = 'false') {
    			this.params = {
    				...this.params,
    				audit,
    			}
    		},
    		bindAgree() {
    			// 同意
    			let { params } = this;
    			uni.showLoading({ mask: true });
    			auditAgree(params.taskId)
    				.then(() => {
    					uni.hideLoading();
    					this.bindHideButton();
    					this.emitSubscribe("agree");
    					AnalysysAgent.track("ihr_flowAgree", this.base);
    					uni.showModal({
    						title: "操作成功",
    						content: "操作成功,返回上一页?",
    						showCancel: false,
    						success: () => {
    							uni.navigateBack();
    						},
    					});
    				})
    				.catch((error) => {
    					uni.hideLoading();
    					uni.showToast({ title: error.message || "服务异常", icon: "none" });
    					this.auditStatus = "end";
    				});
    		},
    		bindReject(remark) {
    			// 拒绝
    			let { params } = this;
    			uni.showLoading({ mask: true });
    			let para = {
    				"status": "REJECT",
    				"taskId": params.taskId,
    				"approveRemark": remark
    			}
    			auditReject(para)
    				.then(() => {
    					uni.hideLoading();
    					this.bindHideButton();
    					this.emitSubscribe("reject");
    
    
    					AnalysysAgent.track("ihr_flowReject", this.base);
    					uni.showModal({
    						title: "驳回成功",
    						content: "驳回成功,返回上一页?",
    						showCancel: false,
    						success: () => {
    							uni.navigateBack();
    						},
    					});
    				})
    				.catch((error) => {
    					uni.hideLoading();
    					uni.showToast({ title: error.message || "服务异常", icon: "none" });
    					this.auditStatus = "end";
    				});
    		},
    		bindAudit(params) {
    			//审核(有审核数据才用此接口)
    			uni.showLoading({ mask: true });
    			flowAudit(params)
    				.then(() => {
    					uni.hideLoading();
    					this.bindHideButton();
    					this.emitSubscribe("agree");
    
    
    					AnalysysAgent.track("ihr_flowAudit", { base: this.base, params });
    					uni.showModal({
    						title: "操作成功",
    						content: "操作成功,返回上一页?",
    						showCancel: false,
    						success: () => {
    							uni.navigateBack();
    						},
    					});
    				})
    				.catch((error) => {
    					uni.hideLoading();
    					uni.showToast({ title: error.message || "服务异常", icon: "none" });
    					this.auditStatus = "end";
    				});
    		},
    		onPreview(fileId, showMenu = true) {
    			previewFile(getImagePath(fileId), { showMenu });
    		},
    		emitSubscribe(status) {
    			uni.$emit("taskListUpdate", { status: status });
    		},
    		initPageData() {
    			let { procInstId } = this.params;
    			this.status = "loading";
    			getFlowBase(procInstId).then(result => {
    				this.baseFlow = result || {};
    				if (result?.completeFlag != true && result?.approveFlag == true) {
    					this.bindHideButton('true');
    					if (result?.runTimeTasks && result?.runTimeTasks.length) {
    						let formKey = result?.runTimeTasks[0].formKey;
    						if (formKey) {
    							this.params = {
    								...this.params,
    								formKey,
    							}
    						}
    					}
    				} else {
    					this.bindHideButton();
    				}
    				flowDetail(result?.businessKey)
    					.then((data) => {
    						if (data) {
    							this.status = "success";
    							this.base = data;
    
    
    							try {
    								this.info = JSON.parse(data.flowEntity);
    								if (process.env.NODE_ENV !== "production") {
    									console.info(JSON.stringify(this.info));
    								}
    							} catch (e) {
    								uni.showToast({ title: "数据异常,JSON转换失败", icon: "none" });
    							}
    
    
    							if (this.initPageFinish) {
    								this.initPageFinish(this.base, this.info);
    							}
    						} else {
    							this.status = "error";
    							uni.showModal({
    								title: '数据错误',
    								content: '流程被删除或程序意外终止导致数据异常',
    							})
    						}
    					})
    					.catch((error) => {
    						this.status = "error";
    						uni.showToast({ title: error.message || "获取流程详情失败", icon: "none" });
    						console.error("获取流程详情失败:", error);
    					});
    			})
    				.catch((error) => {
    					this.status = "error";
    					uni.showToast({ title: error.message || "获取流程实例失败", icon: "none" });
    					console.error("获取流程详情失败:", error);
    				});
    		},
    		initSubscribe() {
    			//订阅审核按钮点击
    			uni.$on("flowAudit", (data) => {
    
    
    				const { taskId, type } = data;
    				if (taskId == this.params.taskId) {
    					if (this.auditStatus !== "in") {
    						this.auditStatus = "in";
    						if (type == "reject") {
    							uni.showModal({
    								title: "驳回原因",
    								editable: true,
    								placeholderText: '请输入驳回原因',
    								confirmColor: '#dd524d',
    								success: (res) => {
    									if (res.confirm) {
    										this.bindReject(res.content);
    									} else {
    										this.auditStatus = "end";
    									}
    								},
    							});
    						} else if (type == "agree") {
    							if (this.edit) {
    								this.validation()
    									.then((values) => {
    										if (values) {
    											const { dataJson, variables, attachments } = values;
    											let param = {
    												taskId,
    												status: "AGREE",
    												approveRemark: "同意",
    												attachments: attachments,
    												dataJson: JSON.stringify(dataJson || values),
    												variables: variables,
    											};
    											uni.showModal({
    												title: "提示",
    												content: "同意通过该流程?",
    												success: (res) => {
    													if (res.confirm) {
    														this.bindAudit(param);
    													} else {
    														this.auditStatus = "end";
    													}
    												},
    											});
    										} else {
    											uni.showModal({
    												title: "提示",
    												content: "同意通过该流程?",
    												success: (res) => {
    													if (res.confirm) {
    														this.bindAgree();
    													} else {
    														this.auditStatus = "end";
    													}
    												},
    											});
    										}
    									})
    									.catch((error) => {
    										console.error(error)
    										this.$showToast({ title: error || "验证出错啦", icon: "none" });
    										this.auditStatus = "end";
    									});
    							} else {
    								uni.showModal({
    									title: "提示",
    									content: "同意通过该流程?",
    									success: (res) => {
    										if (res.confirm) {
    											this.bindAgree();
    										} else {
    											this.auditStatus = "end";
    										}
    									},
    								});
    							}
    						} else if (type == "transfer") {
    							this.auditStatus = "end";
    							this.bindTransfer();
    						}
    					}
    				}
    			});
    		},
    	},
    	onLoad(option) {
    		this.params = option;
    		this.initPageData();
    		this.initSubscribe();
    	},
    	onUnload() {
    		uni.$off(["flowAudit"]);
    	},
    };
    
    
    export default mixin;
    
    
    
    2023-09-20
    有用
    回复
  • 小迪
    小迪
    2023-09-05

    这是这个文件的内容

    2023-09-05
    有用
    回复
登录 后发表内容