📅  最后修改于: 2022-03-11 14:55:31.632000             🧑  作者: Mango
uploadFile(e){
const file = e.target.files[0];
storage.ref('images/'+ file.name).put(file)
.then(response => {
response.ref.getDownloadURL().then((downloadURL) => {
firebase.database().ref(YOUR_DATABASE).child(THE_USER_ID).update({imageUrl:downloadURL})
}
.catch(err => console.log(err))
}