// 针对不同平台的配置

import { OSS_URL } from './const'

let platform = {
  cosUrl: OSS_URL,
  appName: '灵犀学',
  wxName: '灵犀学',
  // 1966113040587837442
  tenantId: '1966391196339204098',
}
const url = window.location.href
if (url.includes('zazhipu.com')) {
  platform = {
    cosUrl: 'https://zazhipu-1313840333.cos.ap-chengdu.myqcloud.com',
    appName: '小志学到',
    wxName: '小志学到',
    tenantId: '1966358228128296962',
  }
} else if (url.includes('qzdyai.com')) {
  platform = {
    cosUrl: 'https://qzdyai-1313840333.cos.ap-chengdu.myqcloud.com',
    appName: '勤智德艺AI',
    wxName: '勤智德艺AI',
    tenantId: '1966391196339204098',
  }
}

const getCosUrl = (path: any) => {
  return `${platform.cosUrl}/${path}`
}

const getLogo = () => {
  return getCosUrl('urm/logo.png')
}

const getQrCode = () => {
  return getCosUrl('urm/wxpa_qr_code.jpg')
}

export default {
  getCosUrl,
  getLogo,
  getQrCode,
  platform,
}
