20 lines
441 B
TypeScript
20 lines
441 B
TypeScript
/**
|
|
* 环境配置
|
|
*/
|
|
declare const wx: WechatMiniprogram.Wx;
|
|
|
|
function isDev(): boolean {
|
|
try {
|
|
const info = (wx.getDeviceInfo ? wx.getDeviceInfo() : wx.getSystemInfoSync()) as any;
|
|
return info.platform === 'devtools';
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
export const API_BASE_URL: string = isDev()
|
|
? 'http://localhost:8085/api/v1'
|
|
: 'https://api.danyang-match.example.com/api/v1';
|
|
|
|
export const IS_DEV: boolean = isDev();
|