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

final

parent 0b0bb534
No related branches found
No related tags found
No related merge requests found
dist.zip 0 → 100644
File added
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......@@ -9,14 +9,17 @@
</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: {
......@@ -38,6 +41,9 @@ export default {
}]
}
},
computed: {
...mapState(['userInfo'])
},
async created() {
let id = this.$route.params.clubId;
const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`)
......@@ -45,6 +51,20 @@ export default {
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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment