Commit af9a149c authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

add header

parent 13517339
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-toolbar-title>{{ $auth.$storage.getUniversal("userName") }}</v-toolbar-title>
<v-btn icon @click="logout"> <v-btn icon @click="logout">
<v-icon>mdi-export</v-icon> <v-icon>mdi-export</v-icon>
</v-btn> </v-btn>
......
...@@ -242,19 +242,14 @@ export default { ...@@ -242,19 +242,14 @@ export default {
createUser() { createUser() {
const self = this const self = this
this.$axios this.$axios
.post('/users/', .post('/users/',{
{ headers: {
email: this.email, 'Content-Type': 'application/json'
password: this.password,
name:this.name,
}, },
{ email: this.email,
headers: { password: this.password,
'Content-Type': 'application/json', name:this.name,
Authorization: `Bearer ${this.$auth.$storage.getUniversal("token")}`, })
},
}
)
.then(response => { .then(response => {
// $bvModal.hide('modal-login'); // $bvModal.hide('modal-login');
this.$bvModal.hide('modal-login') this.$bvModal.hide('modal-login')
...@@ -281,12 +276,7 @@ export default { ...@@ -281,12 +276,7 @@ export default {
if(confirm("Do you really want to delete?")){ if(confirm("Do you really want to delete?")){
try{ try{
this.$axios this.$axios
.delete(`/users/${userID}`,{ .delete(`/users/${userID}`)
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.$auth.$storage.getUniversal("token")}`,
},
})
.then(response => { .then(response => {
console.log(response.data) console.log(response.data)
this.users.splice(this.editedIndex, 1) this.users.splice(this.editedIndex, 1)
...@@ -314,19 +304,10 @@ export default { ...@@ -314,19 +304,10 @@ export default {
console.log(this?.eID) console.log(this?.eID)
try{ try{
this.$axios this.$axios
.put(`/users/${this?.eID}`, .put(`/users/${this?.eID}`,{
{ email: this.eEmail,
email: this.eEmail, password: this.ePassword,
password: this.ePassword, name:this.eName,} )
name:this.eName,
},
{
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${this.$auth.$storage.getUniversal("token")}`,
},
}
)
.then(response => { .then(response => {
self.$toast.success('User updated successfully!',{ self.$toast.success('User updated successfully!',{
duration: 3000 duration: 3000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment