import qs from 'qs';
import http from '../service/http.service';
import config from '../config';

const { opapiHost } = config;

export function getCaptcha() {
  return `${opapiHost}/user/captcha`;
}

export function login(params) {
  return http.post(`${opapiHost}/backStms/prologue/login`, qs.stringify(params), {
    accessToken: true
  });
}

export function getUserInfo() {
  return http.get(`${opapiHost}/backStms/oauth/currentuserinfo`, {
    accessToken: true
  });
}
// 获取权限
export function getMenuData() {
  return http.get(`${config.opapiHost}/backStms/user/getresources/APP016`, {
    accessToken: true
  });
}