Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
67245b12
Commit
67245b12
authored
Jun 04, 2019
by
Sébastien Chopin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Change API for hackerwebapp
parent
8f258ebb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
nuxt.config.js
nuxt.config.js
+1
-1
index.js
store/index.js
+3
-4
No files found.
nuxt.config.js
View file @
67245b12
...
@@ -28,7 +28,7 @@ export default {
...
@@ -28,7 +28,7 @@ export default {
modules
:
[
'~/modules'
],
modules
:
[
'~/modules'
],
axios
:
{
axios
:
{
baseURL
:
'https://api.h
npwa.com/v0/
'
baseURL
:
'https://api.h
ackerwebapp.com
'
},
},
plugins
:
[
plugins
:
[
...
...
store/index.js
View file @
67245b12
...
@@ -69,7 +69,6 @@ export const actions = {
...
@@ -69,7 +69,6 @@ export const actions = {
}
}
this
.
feedCancelSource
=
CancelToken
.
source
()
this
.
feedCancelSource
=
CancelToken
.
source
()
}
}
return
lazy
(
return
lazy
(
(
items
)
=>
{
(
items
)
=>
{
const
ids
=
items
.
map
(
item
=>
item
.
id
)
const
ids
=
items
.
map
(
item
=>
item
.
id
)
...
@@ -77,7 +76,7 @@ export const actions = {
...
@@ -77,7 +76,7 @@ export const actions = {
commit
(
'SET_ITEMS'
,
{
items
})
commit
(
'SET_ITEMS'
,
{
items
})
},
},
()
=>
()
=>
this
.
$axios
.
$get
(
`/
${
feed
}
/
${
page
}
.json
`
,
{
this
.
$axios
.
$get
(
`/
${
feed
}
?page=
${
page
}
`
,
{
cancelToken
:
this
.
feedCancelSource
&&
this
.
feedCancelSource
.
token
cancelToken
:
this
.
feedCancelSource
&&
this
.
feedCancelSource
.
token
}),
}),
(
state
.
feeds
[
feed
][
page
]
||
[]).
map
(
id
=>
state
.
items
[
id
])
(
state
.
feeds
[
feed
][
page
]
||
[]).
map
(
id
=>
state
.
items
[
id
])
...
@@ -87,7 +86,7 @@ export const actions = {
...
@@ -87,7 +86,7 @@ export const actions = {
FETCH_ITEM
({
commit
,
state
},
{
id
})
{
FETCH_ITEM
({
commit
,
state
},
{
id
})
{
return
lazy
(
return
lazy
(
item
=>
commit
(
'SET_ITEM'
,
{
item
}),
item
=>
commit
(
'SET_ITEM'
,
{
item
}),
()
=>
this
.
$axios
.
$get
(
`/item/
${
id
}
.json
`
),
()
=>
this
.
$axios
.
$get
(
`/item/
${
id
}
`
),
Object
.
assign
({
id
,
loading
:
true
,
comments
:
[]
},
state
.
items
[
id
])
Object
.
assign
({
id
,
loading
:
true
,
comments
:
[]
},
state
.
items
[
id
])
)
)
},
},
...
@@ -95,7 +94,7 @@ export const actions = {
...
@@ -95,7 +94,7 @@ export const actions = {
FETCH_USER
({
state
,
commit
},
{
id
})
{
FETCH_USER
({
state
,
commit
},
{
id
})
{
return
lazy
(
return
lazy
(
user
=>
commit
(
'SET_USER'
,
{
id
,
user
}),
user
=>
commit
(
'SET_USER'
,
{
id
,
user
}),
()
=>
this
.
$axios
.
$get
(
`/user/
${
id
}
.json
`
),
()
=>
this
.
$axios
.
$get
(
`/user/
${
id
}
`
),
Object
.
assign
({
id
,
loading
:
true
},
state
.
users
[
id
])
Object
.
assign
({
id
,
loading
:
true
},
state
.
users
[
id
])
)
)
}
}
...
...
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