@@ -99,29 +99,16 @@ export default {
99
99
this .loginForm .timeStamp = new Date ()
100
100
// store.dispatch('userSavesNote', { note: this.form })
101
101
console .log (JSON .stringify (this .loginForm ))
102
+ this .postLogin ({
103
+ userName: this .loginForm .userName ,
104
+ password: this .loginForm .password
105
+ })
102
106
this .loginForm = {
103
107
userName: ' ' ,
104
108
password: ' ' ,
105
109
timeStamp: null
106
110
}
107
111
},
108
- postSignUp (data ) {
109
- console .log (data)
110
- const URI = process .env .VUE_APP_URI || ' http://localhost:4000'
111
- axios
112
- .post (` ${ URI } /signup` , data)
113
- .then (response => {
114
- console .log (response .data .msg )
115
- // this.info = response.data.msg
116
- })
117
- .catch (error => {
118
- console .log (error)
119
- // this.errored = true
120
- })
121
- .finally (() => {
122
- // this.loading = false
123
- })
124
- },
125
112
onSignUpSubmit (evt ) {
126
113
evt .preventDefault ()
127
114
this .signUpForm .timeStamp = new Date ()
@@ -139,10 +126,41 @@ export default {
139
126
password: ' ' ,
140
127
timeStamp: null
141
128
}
129
+ },
130
+ postLogin (data ) {
131
+ axios
132
+ .post (` ${ this .URI } /login` , data)
133
+ .then (response => {
134
+ console .log (response .data .msg )
135
+ // this.info = response.data.msg
136
+ })
137
+ .catch (error => {
138
+ console .log (error)
139
+ // this.errored = true
140
+ })
141
+ .finally (() => {
142
+ // this.loading = false
143
+ })
144
+ },
145
+ postSignUp (data ) {
146
+ axios
147
+ .post (` ${ this .URI } /signup` , data)
148
+ .then (response => {
149
+ console .log (response .data .msg )
150
+ // this.info = response.data.msg
151
+ })
152
+ .catch (error => {
153
+ console .log (error)
154
+ // this.errored = true
155
+ })
156
+ .finally (() => {
157
+ // this.loading = false
158
+ })
142
159
}
143
160
},
144
161
data () {
145
162
return {
163
+ URI : process .env .VUE_APP_URI || ' http://localhost:4000' ,
146
164
loginForm: {
147
165
userName: ' ' ,
148
166
password: ' ' ,
0 commit comments