Giter Site home page Giter Site logo

Comments (5)

imouou avatar imouou commented on May 13, 2024

uiUpload3.start({
url: localStorage.post + "drivermanger-server/api/driver/file/avatar",
data: { file: 替换后的数据 },
onSuccess:function (data) {}

from bui-guide.

Abelies avatar Abelies commented on May 13, 2024

uiUpload3.start({
url: localStorage.post + "drivermanger-server/api/driver/file/avatar",
data: { file: 替换后的数据 },
onSuccess:function (data) {}

data: { file: 替换后的数据 },

这样上传的依然是uiUpload3.data()里最后个file 并不是压缩后的
我看了下uiUpload.start源码
function c(e) {
var n = t.extend(!0, {},
C, e);
if (x = n.url, y = m.value(), O = n.showProgress, y) {
if (O && v.show(), j) {
var i = n.data, // 此处i 获取到了我传过来的blob文件
a = new FormData;
a.append(n.fileKey, y); // y即是uiUpload3.data()中最后个文件 直接将y替换为i又传不了
for (var o in i) a.append(o, i[o]);
n.data = a,
d(n)
} else w.start(n);
return this
}
}
function u(e) {
return j ? (v && v.stop(), b && b.abort(), e && e.call(I, v, b)) : w.stop(e),
this
}
function d(e) {
var n = e.onSuccess,
i = e.onFail;
return b = t.ajax({
url: x,
type: e.method,
data: e.data,
cache: e.cache,
headers: e.headers,
contentType: e.contentType,
processData: e.processData,
timeout: e.timeout,
xhr: function() {
var e = t.ajaxSettings.xhr();
if (f && e.upload) return e.upload.addEventListener("progress", f, !1),
e
},
success: function(e) {
p(),
n && n.call(I, e)
},
error: function(e, t) {
p(),
i && i.call(I, e, t)
}
}),
this
}

from bui-guide.

imouou avatar imouou commented on May 13, 2024

你没有更新成最新版吧?

from bui-guide.

Abelies avatar Abelies commented on May 13, 2024

你没有更新成最新版吧?

v1.5啊 通过改源码解决了 谢谢回答
function c(e) {
var n = t.extend(!0, {},
C, e);
if (x = n.url, y = m.value(), O = n.showProgress, y) {
if (O && v.show(), j) {
var i = n.data,
a = new FormData;
a.append(n.fileKey, y);
for (var o in i) a.append(o, i[o]);
if ( !i ) { n.data = a };
// n.data = a,
d(n)
} else w.start(n);
return this
}
}

from bui-guide.

imouou avatar imouou commented on May 13, 2024

最新版是 1.5.1 , 不建议修改源码的方式, 下次有问题你还敢更新吗?

from bui-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.