30 lines
940 B
TypeScript
30 lines
940 B
TypeScript
// api/config.ts
|
|
export const ENV = process.env.NODE_ENV || 'development';
|
|
|
|
/**
|
|
* 开发/生产的 base url 组织成 SERVICE_MAP。
|
|
* 根据实际域名替换下面的地址。
|
|
*/
|
|
const BASE_URL_MAP = {
|
|
development: {
|
|
MAIN: 'http://192.168.110.100:9300/pb/', // 张川川
|
|
// MAIN: 'https://global.nuttyreading.com/', // 线上
|
|
// PAYMENT: 'https://dev-pay.example.com', // 暂时用不到
|
|
// CDN: 'https://cdn-dev.example.com', // 暂时用不到
|
|
},
|
|
production: {
|
|
MAIN: 'https://global.nuttyreading.com/',
|
|
// PAYMENT: 'https://pay.example.com', // 暂时用不到
|
|
// CDN: 'https://cdn.example.com', // 暂时用不到
|
|
},
|
|
} as const;
|
|
|
|
export const APP_INFO = {
|
|
TYPE: 'abroad', // APP 名称
|
|
VERSION_CODE: '1.0.0', // APP 版本号,可能升级的时候会用,这里需要再确定?
|
|
}
|
|
|
|
export const REQUEST_TIMEOUT = 30000;
|
|
|
|
export const SERVICE_MAP = (BASE_URL_MAP as any)[ENV] ?? BASE_URL_MAP.development;
|