import { request } from '@umijs/max';
import { RespResult } from './core/ReqData';
import { Base64 } from 'js-base64';
import { CLIENT_ID, CLIENT_SECRET } from '@/utils/loginUtil/config';

/**
 *
 * @description 认证相关接口
 */
const IS_PROD = process.env.NODE_ENV === 'production' ? true : false;


export const reqBaseUrl = IS_PROD
  ? '/zzcc/apis'
  : `/apis`;

const urlProxyApis = (url: string) => {
  return `${reqBaseUrl}${url}`;
};


/**
 *
 * @description sso跳转
 */
export async function getSSOUrlApi(params:any) {
  return request<RespResult<any>>(
    urlProxyApis('/admin/sso/chen-du/sso-url'),
    {
      method: 'get',
      params
    }
  )
}

/**
 *
 * @description 行业系统url
 */
export async function getIndustryListApi(params: any) {
  return request<RespResult<any>>(
    urlProxyApis('/admin/zzcc/industry/apps2'),
    {
      method: 'get',
      params
    }
  )
}

/**
 *
 * @description 行业系统url
 */
export async function getSpecialServiceListApi(params: any) {
  return request<RespResult<any>>(
    urlProxyApis('/admin/zzcc/industry/apps'),
    {
      method: 'get',
      params
    }
  )
}


/**
 *
 * @description V2504大屏人员在线的接口
 */
export async function getOnlineNumbersApi(params: any) {
  return request<RespResult<any>>(
    urlProxyApis('/admin/system/refreshToken/mobile/online/numbers'),
    {
      method: 'get',
      params
    }
  )
}