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
  });
}