This repository was archived by the owner on Jun 14, 2021. It is now read-only.
File tree 5 files changed +67
-3
lines changed
5 files changed +67
-3
lines changed Original file line number Diff line number Diff line change 71
71
<a-menu-item key =" login" >
72
72
<a-icon type =" login" />
73
73
<span >Login</span >
74
+ <router-link :to =" { name: 'login' }" />
75
+ </a-menu-item >
76
+ <a-menu-item key =" signup" >
77
+ <a-icon type =" user-add" />
78
+ <span >Sign Up</span >
79
+ <router-link :to =" { name: 'signup' }" />
74
80
</a-menu-item >
75
81
</template >
76
82
</a-menu >
Original file line number Diff line number Diff line change 15
15
<div v-if =" items.length === 0" >
16
16
<a-empty />
17
17
</div >
18
- <waterfall :line-gap =" 370 " :align =" 'center'" :watch =" items" >
18
+ <waterfall :line-gap =" 320 " :align =" 'center'" :watch =" items" >
19
19
<waterfall-slot
20
20
v-for =" item in items"
21
21
:key =" item.id"
22
22
:height =" 435"
23
- :width =" 370 "
23
+ :width =" 300 "
24
24
>
25
25
<MetadataListVideoCard
26
26
:data =" item"
Original file line number Diff line number Diff line change 1
1
<template >
2
- <a-card hoverable style =" width : 350 px " >
2
+ <a-card hoverable style =" width : 300 px " >
3
3
<img
4
4
alt =" cover"
5
5
class =" cover"
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <h1 >Sign Up</h1 >
4
+
5
+ <div style =" max-width : 350px ; display : inline-block ;" >
6
+ <a-input v-model =" username" placeholder =" Username" />
7
+ <br /><br />
8
+ <a-input v-model =" password" type =" password" placeholder =" Password" @keyup.enter =" handleSubmit" />
9
+ <br /><br />
10
+ <a-input v-model =" code" placeholder =" Invitation Code" />
11
+ <br /><br />
12
+ <a-button v-on:click =" handleSubmit" type =" primary" >Sign up</a-button >
13
+ </div >
14
+ </div >
15
+ </template >
16
+
17
+ <script >
18
+ export default {
19
+ data : () => {
20
+ return {
21
+ username: ' ' ,
22
+ password: ' ' ,
23
+ code: ' '
24
+ }
25
+ },
26
+
27
+ methods: {
28
+ handleSubmit : function () {
29
+ this .axios .post (this .apiHost + ' /auth/signup' , {
30
+ username: this .username ,
31
+ password: this .password ,
32
+ code: this .code
33
+ }).then ((res ) => {
34
+ res = res .data
35
+
36
+ if (res .code === 0 ) {
37
+ this .$message .success (' Success' )
38
+ this .$router .push ({ name: ' login' })
39
+ return
40
+ }
41
+
42
+ this .$message .error (res .msg )
43
+ })
44
+ }
45
+ },
46
+
47
+ created : () => {
48
+ document .title = ' Sign Up | JAVClub'
49
+ }
50
+ }
51
+ </script >
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import SeriesList from './components/SeriesList'
22
22
import Profile from './components/Profile'
23
23
import Login from './components/Login'
24
24
import Admin from './components/Admin'
25
+ import SignUp from './components/SignUp'
25
26
26
27
axios . defaults . withCredentials = true
27
28
@@ -100,6 +101,12 @@ const routes = [
100
101
path : '/login' ,
101
102
component : Login
102
103
}
104
+ ,
105
+ {
106
+ name : 'signup' ,
107
+ path : '/signup' ,
108
+ component : SignUp
109
+ }
103
110
]
104
111
105
112
const router = new VueRouter ( {
You can’t perform that action at this time.
0 commit comments