当我上传图片时,效果非常好! 但是,每两个$ file在发送之前就是null ...
$scope.upload = function (file) {
console.log(file)
Upload.upload({
data: {resource: file},
url: 'http://localhost:3000/api/v1/resource/parking/' + $scope.parking._id,
headers: {'Authorization': 'Bearer' + $auth.getToken()}
}).then(function (response) {
getParking();
$scope.messagesConfigurationGalerie = {
success: Array.isArray(response.data) ? response.data : [response.data]
};
})
.catch(function (response) {
$scope.messagesConfigurationGalerie = {
error: Array.isArray(response.data) ? response.data : [response.data]
};
});
};
JS:
+
console.log(文件)每两个Null一次 TY
答案 0 :(得分:0)
如果我在每次上传之间重新加载页面,它就有效......