Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/User/Info.vue
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | export default { | ||||
passwordMode: '', | passwordMode: '', | ||||
user_id: null, | user_id: null, | ||||
user: { aliases: [], config: [] }, | user: { aliases: [], config: [] }, | ||||
status: {} | status: {} | ||||
} | } | ||||
}, | }, | ||||
computed: { | computed: { | ||||
isSelf: function () { | isSelf: function () { | ||||
return this.user_id == this.$store.state.authInfo.id | return this.user_id == this.$root.authInfo.id | ||||
}, | }, | ||||
passwordLink: function () { | passwordLink: function () { | ||||
return this.$root.appUrl + '/password-reset/' + this.passwordLinkCode | return this.$root.appUrl + '/password-reset/' + this.passwordLinkCode | ||||
} | } | ||||
}, | }, | ||||
created() { | created() { | ||||
this.user_id = this.$route.params.user | this.user_id = this.$route.params.user | ||||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | export default { | ||||
} else if (this.passwordMode == 'input') { | } else if (this.passwordMode == 'input') { | ||||
post.password = this.user.password | post.password = this.user.password | ||||
post.password_confirmation = this.user.password_confirmation | post.password_confirmation = this.user.password_confirmation | ||||
} | } | ||||
axios[method](location, post) | axios[method](location, post) | ||||
.then(response => { | .then(response => { | ||||
if (response.data.statusInfo) { | if (response.data.statusInfo) { | ||||
this.$store.state.authInfo.statusInfo = response.data.statusInfo | this.$root.authInfo.statusInfo = response.data.statusInfo | ||||
} | } | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'users' }) | this.$router.push({ name: 'users' }) | ||||
}) | }) | ||||
}, | }, | ||||
submitSettings() { | submitSettings() { | ||||
this.$root.clearFormValidation($('#settings form')) | this.$root.clearFormValidation($('#settings form')) | ||||
Show All 13 Lines | export default { | ||||
.then(response => { | .then(response => { | ||||
if (response.data.status == 'success') { | if (response.data.status == 'success') { | ||||
this.$toast.success(response.data.message) | this.$toast.success(response.data.message) | ||||
this.$router.push({ name: 'users' }) | this.$router.push({ name: 'users' }) | ||||
} | } | ||||
}) | }) | ||||
}, | }, | ||||
showDeleteConfirmation() { | showDeleteConfirmation() { | ||||
if (this.user_id == this.$store.state.authInfo.id) { | if (this.user_id == this.$root.authInfo.id) { | ||||
// Deleting self, redirect to /profile/delete page | // Deleting self, redirect to /profile/delete page | ||||
this.$router.push({ name: 'profile-delete' }) | this.$router.push({ name: 'profile-delete' }) | ||||
} else { | } else { | ||||
// Display the warning | // Display the warning | ||||
new Modal('#delete-warning').show() | new Modal('#delete-warning').show() | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
</script> | </script> |