Blame view
src/store/modules/read.js
694 Bytes
323398550 若干功能添加 |
1 2 |
import urlAlias from '../url' import request from '../request' |
7a2dda446 首页逻辑修改 |
3 |
|
323398550 若干功能添加 |
4 |
const { |
7a2dda446 首页逻辑修改 |
5 |
read |
323398550 若干功能添加 |
6 |
} = urlAlias |
7a2dda446 首页逻辑修改 |
7 8 |
const state = { |
323398550 若干功能添加 |
9 10 |
goodInfo: {} } |
7a2dda446 首页逻辑修改 |
11 12 13 |
const mutations = { INIT: (state, goodInfo) => { |
323398550 若干功能添加 |
14 15 16 |
state.goodInfo = goodInfo } } |
7a2dda446 首页逻辑修改 |
17 18 19 |
const actions = { fetch({ commit }, param) { |
323398550 若干功能添加 |
20 |
return new Promise((resolve, reject) => request({ |
7a2dda446 首页逻辑修改 |
21 |
url: read, |
7d6833f2c 地址列表 |
22 |
data: param, |
7a2dda446 首页逻辑修改 |
23 24 |
success: (res) => { commit('INIT', res.data.data) |
323398550 若干功能添加 |
25 |
resolve() |
7a2dda446 首页逻辑修改 |
26 27 |
}, fail: (res) => { |
323398550 若干功能添加 |
28 |
console.log('fail status === > ', res) |
7a2dda446 首页逻辑修改 |
29 30 |
}, complete: (res) => { |
323398550 若干功能添加 |
31 32 33 34 35 |
console.log('complete status === > ', res) } })) } } |
7a2dda446 首页逻辑修改 |
36 37 38 39 40 |
export default { namespaced: true, state, mutations, |
323398550 若干功能添加 |
41 42 |
actions } |