123456789101112131415161718192021222324252627 |
- import http from '@/request/index.js';
- export const state = {
- groundData: [], //查询待上架和已上架数据
- };
- export const mutations = {
- setGroundData(state, data) {
- state.groundData = data
- },
- }
- export const actions = {
- getGroundData({
- commit,
- rootState
- }, data) {
- return new Promise((resolve, reject) => {
- http('home.getData', data, '加载中').then(res => {
- if (res.code == "0" && res.success == "true") {
- commit('setGroundData', res.data);
- }else{
- commit('setGroundData', []);
- }
- }).catch(e => {
- reject(e)
- })
- })
- }
- }
|