Commit ce6d75f5 authored by Kittisak Maneewong's avatar Kittisak Maneewong
parents d81253de 2fd2a0ee
......@@ -7,7 +7,7 @@ import AppLayout from './layouts/AppLayout.vue';
import EmployerLayout from './layouts/EmployerLayout.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 PageNotFound from './views/PageNotFound.vue';
......@@ -44,7 +44,7 @@ export default new VueRouter({
{
path: 'account',
name: 'account',
component: Login
component: Account
},
{
path: '*',
......
......@@ -109,10 +109,9 @@ export default {
},
methods: {
login () {
axios.post('/login', this.loginData)
axios.post('api/auth/login', this.loginData)
.then((res) => {
console.log(res)
console.log(res.body)
this.$router.push('/')
})
.catch((err) => {
......@@ -120,7 +119,7 @@ export default {
})
},
register () {
axios.post('/register', {
axios.post('api/auth/register', {
name: this.registerData.first_name + ' ' + this.registerData.last_name,
email: this.registerData.email,
password: this.registerData.password,
......@@ -128,6 +127,13 @@ export default {
})
.then((res) => {
this.$router.push('/account');
this.registerData = {
first_name: '',
last_name: '',
email: '',
password: '',
password_confirmation: ''
}
console.log(res)
})
.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