/* eslint-disable */
import {
  request
} from './network'
import store from '@/store'



//登录前获取营地主题
export function getCam(code) {
  let data = {};
  data['identity'] = code ? code : store.state.indexIdentity;
  if (!data['identity']) {
    return false;
  }
  return request({
    method: 'get',
    url: '/web/auth/getCam',
    params: data
  })
}
export function getCamInfo(code) {
  let data = {};
  data['identity'] = code ? code : store.state.indexIdentity;
  if (!data['identity']) {
    return false;
  }
  return request({
    method: 'get',
    url: '/web/auth/getCamInfo',
    params: data
  })
}
// 登录
export function login(data) {
  data['identity'] = store.state.indexIdentity;
  return request({
    method: 'post',
    url: '/web/auth/login',
    params: data

  })
}

// 退出
export function logout(data) {
  data['identity'] = store.state.indexIdentity;
  return request({
    method: 'post',
    url: '/web/auth/loginOut',
    data
  })
}

// 通过旧密码找回密码
export function changePassOld(data) {
  data['identity'] = store.state.indexIdentity;
  return request({
    method: 'post',
    url: '/web/auth/changePassOld',
    data
  })
}

// 通过验证码找回密码
export function changePassCode(data) {
  data['identity'] = store.state.indexIdentity;
  return request({
    method: 'post',
    url: '/web/auth/changePassCode',
    data
  })
}

