Files
danyang-match/miniapp/env.js
T

23 lines
581 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 环境配置文件
*
* 开发环境(微信开发者工具)使用本地后端地址;
* 生产环境使用线上域名。
*/
const isDev = (function() {
try {
// 使用非废弃的 API(wx.getSystemInfoSync 在基础库 3.7.0+ 已废弃)
const info = wx.getDeviceInfo ? wx.getDeviceInfo() : wx.getSystemInfoSync();
return info.platform === 'devtools';
} catch (e) {
return false;
}
})();
module.exports = {
API_BASE_URL: isDev
? 'http://localhost:8085/api/v1'
: 'https://api.danyang-match.example.com/api/v1',
IS_DEV: isDev,
};