forked from TALL/check-work
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.1 KiB
48 lines
1.1 KiB
5 years ago
|
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;
|