From 73f56e030e54e3e514404d1d60e54cd96d919c46 Mon Sep 17 00:00:00 2001 From: KimDoHyun <kdh5998@naver.com> Date: Sun, 8 Dec 2019 20:14:26 +0900 Subject: [PATCH] d --- src/components/Nav.vue | 11 +++++------ src/components/NavClub.vue | 11 +++++++---- src/views/club_top_bar/club_Page.vue | 13 +++++++++++-- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/components/Nav.vue b/src/components/Nav.vue index a6452da..d0d749e 100644 --- a/src/components/Nav.vue +++ b/src/components/Nav.vue @@ -17,12 +17,11 @@ <router-link to='/login' v-if="isLogin === false">로그인</router-link><br> <router-link to='/mypage' v-if="isLogin == true">마이 페이지</router-link><br><br> <router-link to='/club' v-if="isLogin == true">동아리 구경</router-link><br><br> - <div style="list-style:none;" v-if="isLogin == true">내 동아리 - <div v-for= "club in clublist"> - <router-link :to="{path:`/club_page/${club.club}`,params:{clubId:club.club}}"></router-link> - {{club.clubname}} - </div> + {{clublist}} + <li v-for= "club in clublist"> + <router-link :to="{name: 'club_page',params:{clubId:club.club}}">{{club.clubname}}</router-link> + </li> </div><br> <div @click="$store.dispatch('logout')"> <router-link to='/' v-if="isLogin == true">로그아웃</router-link><br><br> @@ -50,7 +49,7 @@ export default { let uid = this.userInfo.uid const res = await axios.get(`http://jnhonlinux.ddns.net:3000/joinedClub/user/${uid}`) this.clublist = res.data.result - + console.log(this.clublist) const res2 = await axios.get('http://jnhonlinux.ddns.net:3000/club') this.club = res2.data.result } diff --git a/src/components/NavClub.vue b/src/components/NavClub.vue index b21aba7..b2a20d4 100644 --- a/src/components/NavClub.vue +++ b/src/components/NavClub.vue @@ -33,13 +33,16 @@ export default { }, methods:{ post(){ - axios.post(`http://jnhonlinux.ddns.net:3000/freeBoard`,{ + let id = this.$route.params.clubId; + axios.post(`http://jnhonlinux.ddns.net:3000/freeBoard/${id}`,{ uid: this.userInfo.uid }).then(res=>{ - - let id = this.$route.params.clubId; + console.log(res.data) + if(res.data.success == true){ router.push(`/club_free/${id}`) - + } else { + alert('Not User'); + } }) } diff --git a/src/views/club_top_bar/club_Page.vue b/src/views/club_top_bar/club_Page.vue index 0832ea3..5ee9c51 100644 --- a/src/views/club_top_bar/club_Page.vue +++ b/src/views/club_top_bar/club_Page.vue @@ -12,13 +12,16 @@ <hr/> <div> <h1>공지사항</h1> + <div v-for="notice in noticeBoard"> + 작성자: {{notice}} + </div> </div> </div> </template> <script> import NavClub from '@/components/NavClub.vue' - +import axios from "axios" export default { name: 'club_page', @@ -33,13 +36,19 @@ export default { univ:'', logo:'', produce:'' - }] + }], + noticeBoard:[] } }, async created() { let id = this.$route.params.clubId; const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) this.club = res.data.result + + const noticeboard= await axios.get(`http://jnhonlinux.ddns.net:3000/noticeBoard/all/${id}`) + console.log(noticeboard) + this.noticeBoard = noticeboard.data.result + }, } </script> -- GitLab