index.js 1.03 KB
Newer Older
陈浩玮's avatar
yonghu  
陈浩玮 committed
1
import { request, METHOD, formatObj } from '@/utils';
陈浩玮's avatar
陈浩玮 committed
2
import Lang from '@/utils/langUtils';
3
export * from './menu';
水落(YangLei)'s avatar
水落(YangLei) committed
4
export * from './system';
水落(YangLei)'s avatar
水落(YangLei) committed
5
export * from './task';
水落(YangLei)'s avatar
水落(YangLei) committed
6
export * from './xunjian';
水落(YangLei)'s avatar
水落(YangLei) committed
7 8 9 10

export function getUserDetailInfoApi() {
    return request('/api/v1/detail', METHOD.GET);
}
陈浩玮's avatar
yonghu  
陈浩玮 committed
11 12 13 14 15 16 17 18 19 20 21 22
export const getStaticParam = async staticKey => {
    const res = await request('/api/v1/parameters/business/multi/list', METHOD.GET, {
        queryList: staticKey,
    });
    const curData = res.find(i => i.key === staticKey);
    const newData = await formatObj(curData.businessParameterList || [], {
        value: 'paramValue',
        label: 'paramName',
        key: 'paramId',
    });
    return newData;
};
陈浩玮's avatar
陈浩玮 committed
23 24 25 26 27 28 29 30 31 32 33 34 35

export const getStaticDataApi = async data => {
    const res = await request('/api/v1/parameters/business/list', METHOD.GET, {
        ...data,
        paramLocale: Lang.get(),
    });
    const newData = await formatObj(res || [], {
        value: 'paramValue',
        label: 'paramName',
        key: 'paramId',
    });
    return newData;
};