Complete profile updation

pull/9/head
johnniang 2019-04-02 09:54:22 +08:00
parent 226cce875c
commit b10a4aeef8
2 changed files with 11 additions and 3 deletions

View File

@ -11,11 +11,11 @@ userApi.getProfile = () => {
})
}
userApi.updateProfile = updatedUserProfile => {
userApi.updateProfile = profile => {
return service({
url: `${baseUrl}/profile`,
method: 'put',
data: updatedUserProfile
data: profile
})
}

View File

@ -72,7 +72,10 @@
/>
</a-form-item>
<a-form-item>
<a-button type="primary">保存</a-button>
<a-button
type="primary"
@click="updateProfile"
>保存</a-button>
</a-form-item>
</a-form>
</a-tab-pane>
@ -163,6 +166,11 @@ export default {
}
userApi.updatePassword(this.passwordParam.oldPassword, this.passwordParam.newPassword).then(response => {})
},
updateProfile() {
userApi.updateProfile(this.user).then(response => {
this.user = response.data.data
})
}
}
}