From 9e3571b1812d61a0f52007cff19b730832583b73 Mon Sep 17 00:00:00 2001
From: JangNamhyeok <chrow16@ajou.ac.kr>
Date: Tue, 3 Dec 2019 16:39:29 +0900
Subject: [PATCH] Jang

---
 src/components/Nav.vue       |  1 +
 src/components/NavOfClub.vue |  5 +++++
 src/router/index.js          |  6 +++++
 src/views/JoinedClub.vue     | 16 ++++++++++++++
 src/views/Login.vue          |  2 --
 src/views/SignUp.vue         | 43 ++++++++++++++++++++++++------------
 6 files changed, 57 insertions(+), 16 deletions(-)
 create mode 100644 src/components/NavOfClub.vue
 create mode 100644 src/views/JoinedClub.vue

diff --git a/src/components/Nav.vue b/src/components/Nav.vue
index b717bc8..1c7baa5 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 0000000..54f4c8b
--- /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 cfd28f3..9990cb1 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 0000000..52fc53a
--- /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 353f4f0..5f91392 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 b5d52ba..3941d7f 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
             }
         }
     }
-- 
GitLab