|
@@ -82,38 +82,6 @@ export const actions = {
|
|
|
commit('news/GET_SNAPSHOT_FAILURE', err)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- loadAllNews ({ commit }, params = {}) {
|
|
|
- commit('newsPage/REQUEST_ALLNEWS')
|
|
|
- return axios.get('/api/news/created', {params})
|
|
|
- .then(response => {
|
|
|
- commit('newsPage/GET_ALLNEWS_SUCCESS', response.data)
|
|
|
- }, err => {
|
|
|
- commit('newsPage/GET_ALLNEWS_FAILURE', err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- loadDetailNews ({ commit }, params = {}) {
|
|
|
- console.log(params.id)
|
|
|
- let id = params.id
|
|
|
- commit('detailNews/REQUEST_DETAILNEWS', params)
|
|
|
- return axios.get(`/api/news/${id}`)
|
|
|
- .then(response => {
|
|
|
- commit('detailNews/GET_DETAILNEWS_SUCCESS', response.data)
|
|
|
- }, err => {
|
|
|
- commit('detailNews/GET_DETAILNEWS_FAILURE', err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- loadHotNews ({ commit }, params = {}) {
|
|
|
- commit('hotNews/REQUEST_HOTNEWS')
|
|
|
- return axios.get('/api/news/viewCount', {params})
|
|
|
- .then(response => {
|
|
|
- commit('hotNews/GET_HOTNEWS_SUCCESS', response.data)
|
|
|
- }, err => {
|
|
|
- commit('hotNews/GET_HOTNEWS_FAILURE', err)
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
loadProductCounts ({ commit }, params = {}) {
|
|
|
commit('product/common/REQUEST_COUNTS')
|