Comments (5)
uiUpload3.start({
url: localStorage.post + "drivermanger-server/api/driver/file/avatar",
data: { file: 替换后的数据 },
onSuccess:function (data) {}
from bui-guide.
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.
你没有更新成最新版吧?
from bui-guide.
你没有更新成最新版吧?
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.
最新版是 1.5.1 , 不建议修改源码的方式, 下次有问题你还敢更新吗?
from bui-guide.
Related Issues (20)
- 相册预览图片根据手势放大 HOT 1
- 您好,bui做seo优化好做吗 HOT 1
- 能否出视频教程 HOT 1
- bui.actionsheet 点击后一直alert 0 HOT 2
- 功能性问题 HOT 1
- 扫描二维码 HOT 1
- bui是免费使用吗 HOT 1
- 因项目需要,如何使用深层目录方式 HOT 1
- 多语言 HOT 2
- echarts现在用不了 HOT 2
- 单页面路由使用echarts为什么报这个错呀?一直解决不了,麻烦看看谢谢了 HOT 2
- 请问怎么全局处理用户登录后session过期的问题? HOT 1
- 文件上传uiUpload获取不到blob文件流 HOT 2
- 表单验证
- 高分辨率下变形问题
- 是否提供可付费购买源码license授权 HOT 2
- 层级选择可以无限极吗 HOT 1
- 网站通知 HOT 1
- BUI 有PC的组件库吗 HOT 3
- 报错cannot read properties of null (reading 'html') HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bui-guide.