Commit e66bc7df authored by Kittisak Maneewong's avatar Kittisak Maneewong

Edit Login to Account

parent 32aee8b3
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,7 +7,7 @@ import AppLayout from './layouts/AppLayout.vue'; ...@@ -7,7 +7,7 @@ import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.vue'; import EmployerLayout from './layouts/EmployerLayout.vue';
import Home from './views/Home.vue'; import Home from './views/Home.vue';
import Login from './views/Login.vue'; import Account from './views/Account.vue';
import LoginEmployer from './views/LoginEmployer.vue'; import LoginEmployer from './views/LoginEmployer.vue';
import PageNotFound from './views/PageNotFound.vue'; import PageNotFound from './views/PageNotFound.vue';
...@@ -44,7 +44,7 @@ export default new VueRouter({ ...@@ -44,7 +44,7 @@ export default new VueRouter({
{ {
path: 'account', path: 'account',
name: 'account', name: 'account',
component: Login component: Account
}, },
{ {
path: '*', path: '*',
......
...@@ -109,10 +109,9 @@ export default { ...@@ -109,10 +109,9 @@ export default {
}, },
methods: { methods: {
login () { login () {
axios.post('/login', this.loginData) axios.post('api/auth/login', this.loginData)
.then((res) => { .then((res) => {
console.log(res) console.log(res)
console.log(res.body)
this.$router.push('/') this.$router.push('/')
}) })
.catch((err) => { .catch((err) => {
...@@ -120,7 +119,7 @@ export default { ...@@ -120,7 +119,7 @@ export default {
}) })
}, },
register () { register () {
axios.post('/register', { axios.post('api/auth/register', {
name: this.registerData.first_name + ' ' + this.registerData.last_name, name: this.registerData.first_name + ' ' + this.registerData.last_name,
email: this.registerData.email, email: this.registerData.email,
password: this.registerData.password, password: this.registerData.password,
...@@ -128,6 +127,13 @@ export default { ...@@ -128,6 +127,13 @@ export default {
}) })
.then((res) => { .then((res) => {
this.$router.push('/account'); this.$router.push('/account');
this.registerData = {
first_name: '',
last_name: '',
email: '',
password: '',
password_confirmation: ''
}
console.log(res) console.log(res)
}) })
.catch((err) => { .catch((err) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment