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
{
Schema
::
create
(
'users'
,
function
(
Blueprint
$table
)
{
$table
->
bigIncrements
(
'id'
);
$table
->
string
(
'name'
);
$table
->
string
(
'email'
)
->
unique
();
$table
->
string
(
'email'
,
100
)
->
unique
();
$table
->
timestamp
(
'email_verified_at'
)
->
nullable
();
$table
->
string
(
'password'
);
$table
->
rememberToken
();
...
...
database/migrations/2014_10_12_100000_create_password_resets_table.php
View file @
005f3ca5
...
...
@@ -14,7 +14,7 @@ class CreatePasswordResetsTable extends Migration
public
function
up
()
{
Schema
::
create
(
'password_resets'
,
function
(
Blueprint
$table
)
{
$table
->
string
(
'email'
)
->
index
();
$table
->
string
(
'email'
,
100
)
->
index
();
$table
->
string
(
'token'
);
$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
.
_
=
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
Vuetify
from
'vuetify'
;
...
...
resources/js/views/Login.vue
View file @
005f3ca5
...
...
@@ -3,20 +3,25 @@
<v-container
grid-list-md
text-xs-center
>
<p
class=
"headline my-4"
>
ลงชื่อเข้าใช้
</p>
<v-flex
sm4
offset-sm4
>
<v-text-field
label=
"อีเมล"
prepend-inner-icon=
"email"
color=
"primary"
class=
"fix-size red--text"
></v-text-field>
<v-text-field
label=
"รหัสผ่าน"
type=
"password"
color=
"primary"
prepend-inner-icon=
"lock"
></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
>
เข้าสู่ระบบ
</v-btn>
<v-form
@
submit
.
prevent=
"login()"
>
<v-text-field
label=
"อีเมล"
prepend-inner-icon=
"email"
color=
"primary"
class=
"fix-size red--text"
type=
"email"
v-model=
"user.email"
></v-text-field>
<v-text-field
label=
"รหัสผ่าน"
type=
"password"
color=
"primary"
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-flex
sm5
>
<v-divider></v-divider>
...
...
@@ -42,6 +47,26 @@
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
user
:
{
email
:
''
,
password
:
''
}
}
},
methods
:
{
login
()
{
console
.
log
(
'login'
)
axios
.
post
(
'/login'
,
this
.
user
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.fix-size
{
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