diff --git a/src/components/Nav.vue b/src/components/Nav.vue index b717bc84077fef9860c22e13ead446f32a81524c..1c7baa59521d857e983bfd9aafde41e0e4cbbc16 100644 --- a/src/components/Nav.vue +++ b/src/components/Nav.vue @@ -18,6 +18,7 @@ </div> <div id="UserClub"> <h3>Club Info</h3> + <router-link to='/joinedClub'>JClub</router-link> </div> </div> </template> diff --git a/src/components/NavOfClub.vue b/src/components/NavOfClub.vue new file mode 100644 index 0000000000000000000000000000000000000000..54f4c8b6e1afe3e6480dc819401ae21a41f63bac --- /dev/null +++ b/src/components/NavOfClub.vue @@ -0,0 +1,5 @@ +<template> + <div class="NavOfClub"> + <h1>Home</h1> | <h1></h1> + </div> +</template> \ No newline at end of file diff --git a/src/router/index.js b/src/router/index.js index cfd28f39691cb94a2b7774f9fb810b1a8ba979c1..9990cb1530521f386ec7081dc5a98b5dcccdef29 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,7 @@ import Home from '../views/Home.vue' import Login from '../views/Login.vue' import SignUp from '../views/SignUp.vue' import Club from '../views/Club.vue' +import joinedClub from '../views/JoinedClub.vue' Vue.use(VueRouter) @@ -37,6 +38,11 @@ const routes = [ path: '/club', name: 'club', component: Club + }, + { + path: '/joinedClub', + name: 'joinedClub', + component: joinedClub } ] diff --git a/src/views/JoinedClub.vue b/src/views/JoinedClub.vue new file mode 100644 index 0000000000000000000000000000000000000000..52fc53a8ae170dc90d70456d2e56ba69a75237a1 --- /dev/null +++ b/src/views/JoinedClub.vue @@ -0,0 +1,16 @@ +<template> + <div class="joinedClub"> + <NavOfClub></NavOfClub> + <h1>This is joinedClub Page</h1> + </div> +</template> + +<script> +import NavOfClub from '@/components/NavOfClub.vue' +export default { + name: 'joinedClub', + components: { + NavOfClub + } +} +</script> \ No newline at end of file diff --git a/src/views/Login.vue b/src/views/Login.vue index 353f4f06aae2f8bea9ebf4802d6e5520ab26fd05..5f9139281bfeea8a57d14d650ffa9ac0e9c8759f 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -9,8 +9,6 @@ </div> <button v-on:click="btnLogin">Login</button><br> - {{data}} <br> - {{$store.state.nowUser}} <router-link to='/signup'><p>If you are not yet a member ...</p></router-link> </div> </template> diff --git a/src/views/SignUp.vue b/src/views/SignUp.vue index b5d52ba6a69914ae73cb3c35665358b766f9e3e4..3941d7f1468663ffe6505f708e1b7c200383529b 100644 --- a/src/views/SignUp.vue +++ b/src/views/SignUp.vue @@ -47,24 +47,39 @@ export default { univ: '', department: '', sid: '', - ifsuper: '', + ifsuper: 0, } }, methods: { async btnSignUp(){ - const res = await this.$http.post('http://jnhonlinux.ddns.net:3000/signup', { - 'uid': this.uid, - 'password': this.password, - 'email': this.email, - 'phone': this.phone, - 'univ': this.univ, - 'department': this.department, - 'sid': this.sid, - 'ifsuper': this.ifsuper - }); - if(res.data.success == true) { - alert('Go to Login'); - this.$router.push('/login'); + if(this.uid == '' || this.password == ''){ + alert('input Your Id & Pwd'); + }else if(!this.sid_valid){ + alert('plz input Number in StudentId'); + } else { + const res = await this.$http.post('http://jnhonlinux.ddns.net:3000/signup', { + 'uid': this.uid, + 'password': this.password, + 'email': this.email, + 'phone': this.phone, + 'univ': this.univ, + 'department': this.department, + 'sid': this.sid, + 'ifsuper': this.ifsuper + }); + if(res.data.success == true) { + alert('Go to Login'); + this.$router.push('/login'); + } + } + } + }, + computed: { + sid_valid: function() { + if(!isNaN(this.sid)){ + return true + } else { + return false } } }