Skip to content
Snippets Groups Projects
Commit c0e97fac authored by LEE JEONG EUN's avatar LEE JEONG EUN
Browse files

add logout

parent 9961bd71
No related branches found
No related tags found
No related merge requests found
Pipeline #4275 failed
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<v-list-tile-title v-text="link.text"/> <v-list-tile-title v-text="link.text"/>
</v-list-tile> </v-list-tile>
<v-list-tile active-class="success" class="v-list-item v-list__tile--buy" to="/"> <v-list-tile active-class="success" class="v-list-item v-list__tile--buy" @click="signOut" to="/">
<v-list-tile-action> <v-list-tile-action>
<v-icon>mdi-package-up</v-icon> <v-icon>mdi-package-up</v-icon>
</v-list-tile-action> </v-list-tile-action>
...@@ -99,7 +99,15 @@ export default { ...@@ -99,7 +99,15 @@ export default {
}, },
methods: { methods: {
...mapMutations('app', ['setDrawer', 'toggleDrawer']) ...mapMutations('app', ['setDrawer', 'toggleDrawer']),
signOut: function(){
this.$http.get('/login/logout').then(res=>{
alert(res.sucess);
})
}
} }
} }
</script> </script>
......
...@@ -47,8 +47,8 @@ export default { ...@@ -47,8 +47,8 @@ export default {
headers: [ headers: [
{ {
sortable: false, sortable: false,
text: 'ID', text: '사진',
value: 'id' value: 'img'
}, },
{ {
sortable: false, sortable: false,
......
<template>
<div id="app">
<section id="write">
<br><br>
<input v-model="title" placeholder="글 제목">
<br><br>
<input v-model="body" placeholder="내용">
<br><br>
<input v-model="petName" placeholder="반려견 이름">
<br><br>
<input v-model="petSex" placeholder="반려견 성별">
<br><br>
<input v-model="petType" placeholder="반려견 견종">
<br><br>
<input v-model="findPlace" placeholder="발견한 장소">
<br><br>
<input v-model="findDate" placeholder="발견 일시">
<br><br>
<input v-model="money" placeholder="사례금(만원)">
<br><br>
<input type="file" @change="fileSeleted">
<button v-on:click="sendFile">send</button>
</section>
</div>
</template>
<script>
export default {
data(){
return{
title: '',
body: '',
created: '',
writer: '',
petName: '',
petSex: '',
petType: '',
findPlace: '',
findDate: '',
money: 0,
comment:[{
body:'',
writer:'',
created:'',
}]
}
},
methods: {
clicked: function(){
this.$http.post('/finderboard',{
body: this.body,
findPlace: this.findPlace,
petType: this.petType,
}).then((response) => {
alert("글 작성 버튼 클릭됨", response)
this.$router.push('/finderboard')
}).catch((err) => {
alert("Error", err)
})
},
sendFile:function(){
var formData=new FormData();
var config={
header:{'Content-Type': 'multipart/form-data'}
};
console.log(this.file);
formData.append('img',this.file);
formData.append('body',this.body);
formData.append('petName',this.petName);
formData.append('petSex',this.petSex);
formData.append('petType',this.petType);
formData.append('lostPlace',this.lostPlace);
formData.append('lostDate',this.lostDate);
formData.append('money',this.money);
for(let key of formData.entries()){
console.log(`${key}`);
}
this.$http.post('/losterboard',formData,config).then((response) => {
console.log(response);
this.$router.push('/losterboard')
}).catch((err) => {
alert(err);
})
}
}
}
</script>
<style>
</style>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment