Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
CO-OP Search
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kittisak Maneewong
CO-OP Search
Commits
005f3ca5
Commit
005f3ca5
authored
Apr 05, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add default axios
parent
634ce2d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
17 deletions
+56
-17
2014_10_12_000000_create_users_table.php
database/migrations/2014_10_12_000000_create_users_table.php
+1
-2
2014_10_12_100000_create_password_resets_table.php
...ations/2014_10_12_100000_create_password_resets_table.php
+1
-1
app.js
public/js/app.js
+0
-0
app.js
resources/js/app.js
+15
-0
Login.vue
resources/js/views/Login.vue
+39
-14
No files found.
database/migrations/2014_10_12_000000_create_users_table.php
View file @
005f3ca5
...
@@ -15,8 +15,7 @@ class CreateUsersTable extends Migration
...
@@ -15,8 +15,7 @@ class CreateUsersTable extends Migration
{
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'name'
);
$table
->
string
(
'email'
,
100
)
->
unique
();
$table
->
string
(
'email'
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
string
(
'password'
);
$table
->
rememberToken
();
$table
->
rememberToken
();
...
...
database/migrations/2014_10_12_100000_create_password_resets_table.php
View file @
005f3ca5
...
@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration
...
@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration
public
function
up
()
public
function
up
()
{
{
Schema
::
create
(
'password_resets'
,
function
(
Blueprint
$table
)
{
Schema
::
create
(
'password_resets'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'email'
)
->
index
();
$table
->
string
(
'email'
,
100
)
->
index
();
$table
->
string
(
'token'
);
$table
->
string
(
'token'
);
$table
->
timestamp
(
'created_at'
)
->
nullable
();
$table
->
timestamp
(
'created_at'
)
->
nullable
();
});
});
...
...
public/js/app.js
View file @
005f3ca5
This diff is collapsed.
Click to expand it.
resources/js/app.js
View file @
005f3ca5
window
.
Vue
=
require
(
'vue'
);
window
.
Vue
=
require
(
'vue'
);
window
.
_
=
require
(
'lodash'
);
window
.
axios
=
require
(
'axios'
);
window
.
axios
.
defaults
.
headers
.
common
[
'X-Requested-With'
]
=
'XMLHttpRequest'
;
let
token
=
document
.
head
.
querySelector
(
'meta[name="csrf-token"]'
);
if
(
token
)
{
window
.
axios
.
defaults
.
headers
.
common
[
'X-CSRF-TOKEN'
]
=
token
.
content
;
}
else
{
console
.
error
(
'CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'
);
}
import
Vue
from
'vue'
;
import
Vue
from
'vue'
;
import
Vuetify
from
'vuetify'
;
import
Vuetify
from
'vuetify'
;
...
...
resources/js/views/Login.vue
View file @
005f3ca5
...
@@ -3,20 +3,25 @@
...
@@ -3,20 +3,25 @@
<v-container
grid-list-md
text-xs-center
>
<v-container
grid-list-md
text-xs-center
>
<p
class=
"headline my-4"
>
ลงชื่อเข้าใช้
</p>
<p
class=
"headline my-4"
>
ลงชื่อเข้าใช้
</p>
<v-flex
sm4
offset-sm4
>
<v-flex
sm4
offset-sm4
>
<v-text-field
<v-form
@
submit
.
prevent=
"login()"
>
label=
"อีเมล"
<v-text-field
prepend-inner-icon=
"email"
label=
"อีเมล"
color=
"primary"
prepend-inner-icon=
"email"
class=
"fix-size red--text"
color=
"primary"
></v-text-field>
class=
"fix-size red--text"
<v-text-field
type=
"email"
label=
"รหัสผ่าน"
v-model=
"user.email"
type=
"password"
></v-text-field>
color=
"primary"
<v-text-field
prepend-inner-icon=
"lock"
label=
"รหัสผ่าน"
></v-text-field>
type=
"password"
<p
class=
"text-xs-right"
><a
href=
"#"
class=
"body-2 font-weight-medium"
>
ลืมรหัสผ่าน?
</a></p>
color=
"primary"
<v-btn
color=
"blue"
block
dark
large
>
เข้าสู่ระบบ
</v-btn>
prepend-inner-icon=
"lock"
v-model=
"user.password"
></v-text-field>
<p
class=
"text-xs-right"
><a
href=
"#"
class=
"body-2 font-weight-medium"
>
ลืมรหัสผ่าน?
</a></p>
<v-btn
color=
"blue"
block
dark
large
type=
"submit"
>
เข้าสู่ระบบ
</v-btn>
</v-form>
<v-layout
row
wrap
align-center
justify-center
fill-height
>
<v-layout
row
wrap
align-center
justify-center
fill-height
>
<v-flex
sm5
>
<v-flex
sm5
>
<v-divider></v-divider>
<v-divider></v-divider>
...
@@ -42,6 +47,26 @@
...
@@ -42,6 +47,26 @@
</div>
</div>
</
template
>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
user
:
{
email
:
''
,
password
:
''
}
}
},
methods
:
{
login
()
{
console
.
log
(
'login'
)
axios
.
post
(
'/login'
,
this
.
user
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.fix-size
{
.fix-size
{
height
:
50px
;
height
:
50px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment