Skip to content
Snippets Groups Projects
Commit c5c03d34 authored by KimDoHyun's avatar KimDoHyun
Browse files

final

parent 0b0bb534
Branches
No related tags found
No related merge requests found
dist.zip 0 → 100644
File added
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<input type="text" v-model = "comment"> <input type="text" v-model = "comment">
<button @click="post()">달기</button> <button @click="post()">달기</button>
</div> </div>
<div v-for="com in commentlist"> <div v-for="com in commentlist">
{{com.uid}}{{com.comment}} {{com.uid}}{{com.comment}}
</div> </div>
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, name: applymem.user}}">자세히</router-link></button> <button><router-link :to="{name:'applymember', params:{clubId: `${club[0].id}`, name: applymem.user}}">자세히</router-link></button>
</div> </div>
</div> </div>
<br><br>
</div> </div>
</template> </template>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div> <div>
<h1>소개</h1> <h1>소개</h1>
{{club[0].introduce}} {{club[0].introduce}}
<router-link :to="{path:`/introduce/${club[0].id}`}">수정하기</router-link> <button @click="post()">수정하기</button>
</div> </div>
<hr/> <hr/>
<h1>공지사항</h1> <h1>공지사항</h1>
...@@ -19,14 +19,15 @@ ...@@ -19,14 +19,15 @@
</div> </div>
</router-link> </router-link>
</div> </div>
<router-link :to="{path:`/notice_write/${club[0].id}`}">글쓰기</router-link> <button @click="post2()">글쓰기</button>
</div> </div>
</template> </template>
<script> <script>
import NavClub from '@/components/NavClub.vue' import NavClub from '@/components/NavClub.vue'
import axios from "axios" import axios from "axios"
import {mapState} from "vuex"
import router from "../../router/index"
export default { export default {
name: 'club_page', name: 'club_page',
components: { components: {
...@@ -52,7 +53,35 @@ export default { ...@@ -52,7 +53,35 @@ export default {
const noticeboard= await axios.get(`http://jnhonlinux.ddns.net:3000/noticeBoard/all/${id}`) const noticeboard= await axios.get(`http://jnhonlinux.ddns.net:3000/noticeBoard/all/${id}`)
console.log(noticeboard) console.log(noticeboard)
this.noticeBoard = noticeboard.data.result 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> </script>
...@@ -9,14 +9,17 @@ ...@@ -9,14 +9,17 @@
</div> </div>
</router-link> </router-link>
</div> </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> </div>
</template> </template>
<script> <script>
import NavClub from '@/components/NavClub.vue' import NavClub from '@/components/NavClub.vue'
import router from "../../router/index"
import {mapState} from "vuex"
import axios from "axios"
export default { export default {
name: 'club_post', name: 'club_post',
components: { components: {
...@@ -38,6 +41,9 @@ export default { ...@@ -38,6 +41,9 @@ export default {
}] }]
} }
}, },
computed: {
...mapState(['userInfo'])
},
async created() { async created() {
let id = this.$route.params.clubId; let id = this.$route.params.clubId;
const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`) const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`)
...@@ -45,6 +51,20 @@ export default { ...@@ -45,6 +51,20 @@ export default {
const activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/all/${id}`) const activityLog = await this.$http.get(`http://jnhonlinux.ddns.net:3000/activityLog/all/${id}`)
console.log(activityLog) console.log(activityLog)
this.activityLog = activityLog.data.result 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> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment