diff --git a/src/components/Nav.vue b/src/components/Nav.vue index a6452da1a50c5bf5f8ff046a16c39c3faaad07ea..d0d749e85a1781d9994e8523348ec7f2044633ae 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 b21aba7120cb792f3bfe926eb84f6afc4b6c4478..b2a20d4654bd19a6d49f669ab89d25e3c3843fc5 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 0832ea30bdd808a0874b3dfb44793846e80083dd..5ee9c51cce22b0963f56be82dd1fc87a7fd73937 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>