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';
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