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
50dc7722
Commit
50dc7722
authored
Apr 18, 2019
by
Kittisak Maneewong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config default baseurl axios vue laravel
parent
51ab882a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
21 deletions
+4
-21
app.js
public/js/app.js
+0
-0
app.js
resources/js/app.js
+1
-11
store.js
resources/js/store.js
+2
-2
app.blade.php
resources/views/app.blade.php
+1
-1
web.php
routes/web.php
+0
-7
No files found.
public/js/app.js
View file @
50dc7722
This diff is collapsed.
Click to expand it.
resources/js/app.js
View file @
50dc7722
...
@@ -4,15 +4,7 @@ window._ = require('lodash');
...
@@ -4,15 +4,7 @@ window._ = require('lodash');
window
.
axios
=
require
(
'axios'
);
window
.
axios
=
require
(
'axios'
);
window
.
axios
.
defaults
.
headers
.
common
[
'X-Requested-With'
]
=
'XMLHttpRequest'
;
window
.
axios
.
defaults
.
baseUrl
=
'http://localhost:8000/'
;
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'
;
...
@@ -24,8 +16,6 @@ import store from './store';
...
@@ -24,8 +16,6 @@ import store from './store';
import
'iview/dist/styles/iview.css'
;
import
'iview/dist/styles/iview.css'
;
// Vue.config.productionTip = false;
Vue
.
use
(
Vuetify
);
Vue
.
use
(
Vuetify
);
Vue
.
use
(
iView
);
Vue
.
use
(
iView
);
...
...
resources/js/store.js
View file @
50dc7722
...
@@ -57,7 +57,7 @@ export default new Vuex.Store({
...
@@ -57,7 +57,7 @@ export default new Vuex.Store({
login
({
commit
,
dispatch
},
payload
)
{
login
({
commit
,
dispatch
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
commit
(
'setLoading'
,
true
)
commit
(
'setLoading'
,
true
)
axios
.
post
(
'api/auth/login'
,
payload
)
axios
.
post
(
'
/
api/auth/login'
,
payload
)
.
then
(
res
=>
{
.
then
(
res
=>
{
commit
(
'setLoading'
,
false
)
commit
(
'setLoading'
,
false
)
if
(
payload
.
role
==
1
)
{
if
(
payload
.
role
==
1
)
{
...
@@ -100,7 +100,7 @@ export default new Vuex.Store({
...
@@ -100,7 +100,7 @@ export default new Vuex.Store({
register
({
commit
},
payload
)
{
register
({
commit
},
payload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
commit
(
'setLoading'
,
true
)
commit
(
'setLoading'
,
true
)
axios
.
post
(
'api/auth/register'
,
payload
)
axios
.
post
(
'
/
api/auth/register'
,
payload
)
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
payload
.
role
===
1
)
{
if
(
payload
.
role
===
1
)
{
iView
.
LoadingBar
.
finish
()
iView
.
LoadingBar
.
finish
()
...
...
resources/views/app.blade.php
View file @
50dc7722
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui"
>
<
meta
name=
"csrf-token"
content=
"{{ csrf_token() }}"
>
<
!-- <meta name="csrf-token" content="{{ csrf_token() }}"> --
>
<title>
CO-OP Search
</title>
<title>
CO-OP Search
</title>
...
...
routes/web.php
View file @
50dc7722
...
@@ -12,9 +12,3 @@
...
@@ -12,9 +12,3 @@
*/
*/
Route
::
get
(
'/{any}'
,
'AppController@index'
)
->
where
(
'any'
,
'.*'
);
Route
::
get
(
'/{any}'
,
'AppController@index'
)
->
where
(
'any'
,
'.*'
);
Route
::
group
([
'prefix'
=>
'employer/api/auth'
],
function
(
$router
)
{
Route
::
post
(
'register'
,
'AuthController@register'
);
Route
::
post
(
'login'
,
'AuthController@login'
);
Route
::
get
(
'current'
,
'AuthController@getAuthenticatedUser'
);
});
\ No newline at end of file
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