/**
 * 公共API


import { api } from '~/ui-domain' */
import request from '@/utils/request'
import Storage from '@/utils/storage'

/**
 * 获取图片验证码URL
 * @param scene
 * @param uuid
 * @returns {string}
 */
export function getValidateCodeUrl(scene, uuid) {//${api.admin}
  return `${import.meta.env.VITE_API_URL}/captchas/${uuid}/${scene}?rmd=${new Date().getTime()}`
}

/**
 * 获取登陆验证方式
 */
export function getValidator() {//${api.admin}
  return request({
    url: `${import.meta.env.VITE_API_URL}/validator`,
    method: 'GET',
    needToken: false
  })
}

/**
 * 刷新token
 */
export function refreshToken() {
  return request({
    url: 'admin/systems/admin-users/token',
    method: 'post',
    needToken: false,
    data: {
      refresh_token: Storage.getItem('admin_refresh_token')
    }
  })
}

/**
 * 加盟商刷新Token
 * @returns {*}
 */
export function refreshFranchiseToken() {
  return request({
    url: `/admin/shops/franchise/token`,
    method: 'post',
    needToken: false,
    data: {
      refresh_token: Storage.getItem('admin_refresh_token')
    }
  })
}

/**
 * 获取首页数据
 */
export function getIndexData() {
  return request({
    url: 'admin/index/page',
    method: 'get',
    loading: false
  })
}
/**
 * 获取加盟商首页数据
 */
export function getFranchiseIndexData() {
  return request({
    url: '/admin/shops/franchise/index/page',
    method: 'get',
    loading: false
  })
}

/**
 * 获取站点信息
 * @returns {*}
 */
export function getSiteInfo() {//${api.admin}
  return request({
    url: `https://apidoc.raycos.net/site-show`,
    method: 'get',
    needToken: false,
    loading: false
  })
}

/* 公司查询  */
export function getCompany(para) {
  return request({
    url: `/admin/systems/admin-users/login/getCompany?key=${para}`,
    method: 'get',
    needToken: false
  })
}

/* export function getLoginCompany(para) {
  return request({
      url: `/admin/systems/admin-users/login/getCompany?key=${para}`,
      method: 'get'
  })
} */