import packageInfo from '@/package.json';

const { version } = packageInfo;

// 开发环境配置
export let baseUrl;
if (process.env.NODE_ENV === 'development') {
  baseUrl = import.meta.env.SOUND_CHAIN_DEV_BASE_URL;
} else {
  baseUrl = import.meta.env.SOUND_CHAIN_BASE_URL;
}
if (typeof baseUrl === 'undefined') {
  console.error('请检查.env配置文件是否存在');
} else {
  console.log(`[音链 ${version}]  https://doc.iocoder.cn`);
}

export const apiPath = import.meta.env.SOUND_CHAIN_API_PATH;
export const staticUrl = import.meta.env.SOUND_CHAIN_STATIC_URL;

export default {
  baseUrl,
  apiPath,
  staticUrl,
};
