Commit 71971d03 by 陈超

T

parent 73a09a88
...@@ -222,6 +222,7 @@ ...@@ -222,6 +222,7 @@
}, 'json'); }, 'json');
}, },
onRead: function(r) { onRead: function(r) {
let that = this
let formData = new FormData() let formData = new FormData()
formData.append('file', r.file) formData.append('file', r.file)
let url = U('widget/Upload/save') + '&attach_type=avatar&upload_type=image&thumb=1&width=44&height=44&cut=false' let url = U('widget/Upload/save') + '&attach_type=avatar&upload_type=image&thumb=1&width=44&height=44&cut=false'
...@@ -231,8 +232,10 @@ ...@@ -231,8 +232,10 @@
data: formData, data: formData,
contentType: false, contentType: false,
processData: false, processData: false,
success: function(data) { success: function(res) {
console.log(data) if(res.status == 1) {
that.currentAvatar = res.data.src
}
}, },
error: function(data) { error: function(data) {
console.log(data) console.log(data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment