diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000000000000000000000000000000000000..60d37d57da6cd3ee1eceef250f45d89f4d2438e3 Binary files /dev/null and b/dist.zip differ diff --git a/src/views/Free.vue b/src/views/Free.vue index 86107e9a7bc7087ee8487f9d8aa90360d1a00575..308b2094bdf564c398b33e7d40e607f7daa2a9bb 100644 --- a/src/views/Free.vue +++ b/src/views/Free.vue @@ -14,6 +14,7 @@ <input type="text" v-model = "comment"> <button @click="post()">달기</button> </div> + <div v-for="com in commentlist"> {{com.uid}} ㅣ {{com.comment}} </div> diff --git a/src/views/club_top_bar/club_Manage.vue b/src/views/club_top_bar/club_Manage.vue index b79a340ab702ea41612b0255886734d24581adc0..8103338aff0c21035801d830a37966e39a67d8f0 100644 --- a/src/views/club_top_bar/club_Manage.vue +++ b/src/views/club_top_bar/club_Manage.vue @@ -16,7 +16,6 @@ <button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, name: applymem.user}}">자세히</router-link></button> </div> </div> - <br><br> </div> </template> diff --git a/src/views/club_top_bar/club_Page.vue b/src/views/club_top_bar/club_Page.vue index 9b46a2235165957f3b64ac2d420118eb61a68d11..403bfa5f40c8bdd5bef8ed0809673701d2b78c8a 100644 --- a/src/views/club_top_bar/club_Page.vue +++ b/src/views/club_top_bar/club_Page.vue @@ -8,7 +8,7 @@ <div> <h1>소개</h1> {{club[0].introduce}} - <router-link :to="{path:`/introduce/${club[0].id}`}">수정하기</router-link> + <button @click="post()">수정하기</button> </div> <hr/> <h1>공지사항</h1> @@ -19,14 +19,15 @@ </div> </router-link> </div> - <router-link :to="{path:`/notice_write/${club[0].id}`}">글쓰기</router-link> + <button @click="post2()">글쓰기</button> </div> </template> <script> import NavClub from '@/components/NavClub.vue' import axios from "axios" - +import {mapState} from "vuex" +import router from "../../router/index" export default { name: 'club_page', components: { @@ -52,7 +53,35 @@ export default { const noticeboard= await axios.get(`http://jnhonlinux.ddns.net:3000/noticeBoard/all/${id}`) console.log(noticeboard) this.noticeBoard = noticeboard.data.result - }, + computed: { + ...mapState(['userInfo']) + }, + methods:{ + async post(){ + let id = this.$route.params.clubId; + const res = await axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/auth/${id}`,{ + id : this.$route.params.clubId, + user : this.userInfo.name + }) + if(res.data.auth == false){ + alert("동아리 회원만 이용할 수 있습니다.") + } else{ + router.push(`/introduce/${this.club[0].id}`) + } + }, + async post2(){ + let id = this.$route.params.clubId; + const res = await axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/auth/${id}`,{ + id : this.$route.params.clubId, + user : this.userInfo.name + }) + if(res.data.auth == false){ + alert("동아리 회원만 이용할 수 있습니다.") + } else{ + router.push(`/notice_write/${this.club[0].id}`) + } + } + } } </script> diff --git a/src/views/club_top_bar/club_Post.vue b/src/views/club_top_bar/club_Post.vue index 5c91585f404167077a647a7f6b4cf39fdffa7d5c..2fa70432e39f6d8d83d1196f7c8d36a8a4b118c9 100644 --- a/src/views/club_top_bar/club_Post.vue +++ b/src/views/club_top_bar/club_Post.vue @@ -9,21 +9,24 @@ </div> </router-link> </div> - <router-link :to="{path:`/post/${club[0].id}`}">글쓰기</router-link> + <button @click="post()">글쓰기</button> + <!--<router-link :to="{path:`/post/${club[0].id}`}">글쓰기</router-link>--> </div> </template> <script> import NavClub from '@/components/NavClub.vue' - +import router from "../../router/index" +import {mapState} from "vuex" +import axios from "axios" export default { name: 'club_post', components: { 'NavClub': NavClub }, - data(){ - return { + data(){ + return { club:[{ id:'', name:'', @@ -36,15 +39,32 @@ export default { content:'', writer:'' }] - } - }, - async created() { + } + }, + computed: { + ...mapState(['userInfo']) + }, + 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 activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/all/${id}`) console.log(activityLog) this.activityLog = activityLog.data.result + }, + methods:{ + async post(){ + let id = this.$route.params.clubId; + const res = await axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/auth/${id}`,{ + id : this.$route.params.clubId, + user : this.userInfo.name + }) + if(res.data.auth == false){ + alert("동아리 회원만 이용할 수 있습니다.") + } else{ + router.push(`/post/${this.club[0].id}`) + } + } } } </script>