Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- updatePhoto(event) {
- this.imageRow = []
- let file = event.target.files[0]
- this.imageRow.push({
- preview: window.URL.createObjectURL(file),
- image: file
- })
- let formData = new FormData()
- this.imageRow.forEach((element, index) => {
- formData = new FormData()
- formData.append('image', element.image)
- UserService.updateUserInfo(formData).then((res) => {
- this.userImage = res.data.image.medium_square_crop
- }, err => {
- })
- })
- }
- let postObject = {
- username: this.username,
- password: this.password
- }
- let data = new FormData()
- Object.keys(postObject).forEach(key => data.append(key, postObject[key]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement