import formatUrl from 'amos-processor/lib/utils/urlFormat';
import { secBaseUrl } from './../consts/urlConsts';
import { commonGet, commonPost } from './../utils/request';

export const getCurrentUser = () => {
  return commonGet(secBaseUrl.currentUserUrl);
};

export const getSystemAllMenu = () => {
  return commonGet(formatUrl(secBaseUrl.systemMenusUrl));
};

export const login = (code, userId) => {
  return commonPost(formatUrl(secBaseUrl.loginUrl), { code, userId });
};

export const getPermissionsCompany = () => {
  return commonGet(formatUrl(secBaseUrl.systemMenusUrl));
};

/**
 * 获取当前角色权限菜单
 * @param {*} roleSeq 角色Id
 */
export const getPermissionsMenus = (roleSeq) => {
  return commonGet(formatUrl(secBaseUrl.permissionsMenusUrl, { roleSeq }));
};

export const getPermissionsCompanyData = () => {
  return commonGet(formatUrl(secBaseUrl.permissionsCompanyUrl));
};

//根据字典编号查询字典列表BANK_ORG
export const getDictionaryList = (dictCode) => {
  return commonGet(formatUrl(secBaseUrl.dictionaryValueUrl, { dictCode }));
};


