import axios from 'axios'; import { message } from 'ant-design-vue'; import { industryInfo, front } from '@/config/api'; const actions = { /** * 获取行业资讯列表 * @param {any} commit * @param {object} params 提交的数据 */ async getIndustryInfoList({ commit }, params) { try { const res = await industryInfo(params); const { code, msg, data } = res.data; if (code === 200) { return data; } else { message.error(msg || '获取失败'); throw msg; } } catch (error) { throw error || '获取失败'; } }, /** * 获取活动公告列表 * @param {any} commit * @param {object} params 提交的数据 */ async getFrontList({ commit }, params) { try { const res = await front(params); const { code, msg, data } = res.data; if (code === 200) { return data; } else { message.error(msg || '获取失败'); throw msg; } } catch (error) { throw error || '获取失败'; } }, }; export default actions;