We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload (file, success) { let url = this.config.uploadUrl let xhr = new XMLHttpRequest() let form = new FormData() let self = this if (!!config.uploadParams) { Object.keys(this.config.uploadParams).map((i) => { form.append(i, this.config.uploadParams[i]); }); } form.append(this.config.uploadName, file) xhr.open('POST', url, true) xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { const json = JSON.parse(xhr.responseText) const imgUrl = self.config.uploadCallback(json) success(imgUrl) } else { if (self.config.uploadFailed) { self.config.uploadFailed(xhr.responseText) } // 测试网站, 模拟上传 if (location.href.indexOf('ericjj.com/smeditor.github.io') > 0) { const imgUrl = self.config.uploadCallback('') success(imgUrl) } } } } xhr.send(form) }
The text was updated successfully, but these errors were encountered:
upload (file, success) { let url = this.config.uploadUrl let xhr = new XMLHttpRequest() let form = new FormData() let self = this if (!!this.config.uploadParams) { Object.keys(this.config.uploadParams).map((i) => { form.append(i, this.config.uploadParams[i]); }); } form.append(this.config.uploadName, file) xhr.open('POST', url, true) xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { const json = JSON.parse(xhr.responseText) const imgUrl = self.config.uploadCallback(json) success(imgUrl) } else { if (self.config.uploadFailed) { self.config.uploadFailed(xhr.responseText) } // 测试网站, 模拟上传 if (location.href.indexOf('ericjj.com/smeditor.github.io') > 0) { const imgUrl = self.config.uploadCallback('') success(imgUrl) } } } } xhr.send(form) } /
Sorry, something went wrong.
No branches or pull requests
upload (file, success) {
let url = this.config.uploadUrl
let xhr = new XMLHttpRequest()
let form = new FormData()
let self = this
if (!!config.uploadParams) {
Object.keys(this.config.uploadParams).map((i) => {
form.append(i, this.config.uploadParams[i]);
});
}
form.append(this.config.uploadName, file)
xhr.open('POST', url, true)
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
const json = JSON.parse(xhr.responseText)
const imgUrl = self.config.uploadCallback(json)
success(imgUrl)
} else {
if (self.config.uploadFailed) {
self.config.uploadFailed(xhr.responseText)
}
// 测试网站, 模拟上传
if (location.href.indexOf('ericjj.com/smeditor.github.io') > 0) {
const imgUrl = self.config.uploadCallback('')
success(imgUrl)
}
}
}
}
xhr.send(form)
}
The text was updated successfully, but these errors were encountered: