Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

秒传md5校验自定义reason有时会出现缺失参数的情况,uploadError回调函数中的reason只接受到了Uploaded及之后的四个字段 #3182

Open
qwhatevera opened this issue Nov 30, 2021 · 3 comments

Comments

@qwhatevera
Copy link

beforeSendFile: function (file) {
const task = new $.Deferred()
const data = {
md5: md5(file.name + file.size + file.type + file.lastModifiedDate)
}
checkSecondPass(data).then(res => {
if (res && res.isSuccess) {
if (res.data) {
task.reject(
'Uploaded,' +
res.data.url +
',' +
res.data.submittedFileName +
',' +
Math.floor(file.size / 1024) +
',' +
res.data.resolution +
',' +
res.data.displayMode +
',' +
res.data.shotImageUrl +
',' +
res.data.length
)
} else {
task.resolve()
}
} else {
task.reject('uploadError')
}
})
return task
},

@LSL1618
Copy link

LSL1618 commented Jan 26, 2022

帮你格式化一下,要不然看着头疼

beforeSendFile: function (file) {
	const task = new $.Deferred()
	const data = {
		md5: md5(file.name + file.size + file.type + file.lastModifiedDate)
	}
	checkSecondPass(data).then(res => {
		if (res && res.isSuccess) {
			if (res.data) {
				task.reject(
					'Uploaded,' + res.data.url + ',' +
					res.data.submittedFileName + ',' +
					Math.floor(file.size / 1024) + ',' +
					res.data.resolution + ',' +
					res.data.displayMode + ',' +
					res.data.shotImageUrl + ',' +
					res.data.length)
			} else {
				task.resolve()
			}
		} else {
			task.reject('uploadError')
		}
	})
	return task
},

@qwhatevera
Copy link
Author

感谢,粘贴过来手快点了保存格式就变乱了,第一次提issue,也不知道咋改,就没管了。

@1269085759
Copy link

目前不知道原因,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants