| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- // 判断当前环境
- const isDev = process.env.NODE_ENV === 'development'
- // API基础URL配置
- export const API_BASE_URL = isDev
- ? 'https://mylive91.com/api'
- : 'https://mylive91.com/api' // 生产环境
- // App名称配置请求头
- export const APP_NAME = 'MewLive'
- // 支付方式切换参数 ('wechat' | 'alipay')
- export const PAYMENT_TYPE = 'wechat'
- // 支付宝支付自定义金额模块开关
- export const ALI_CUSTOM = false
- // 支付方式ID
- export const PAY_WAY_ID = {
- ANDROID: 10,
- IOS: 21,
- }
- // 检测设备类型
- export function getDevicePayWayId() {
- const ua = navigator.userAgent.toLowerCase()
- if (/iphone|ipad|ipod|ios/.test(ua)) {
- return PAY_WAY_ID.IOS
- }
- // 默认返回安卓支付方式
- return PAY_WAY_ID.ANDROID
- }
- // 获取平台类型
- export function getPlatformType() {
- const ua = navigator.userAgent.toLowerCase()
- if (/iphone|ipad|ipod|ios/.test(ua)) {
- return 'ios'
- } else if (/android/.test(ua)) {
- return 'android'
- }
- // 默认返回web平台
- return 'web'
- }
- // 其他全局配置可以在这里添加
- export default {
- API_BASE_URL,
- isDev,
- PAY_WAY_ID,
- getDevicePayWayId,
- getPlatformType,
- }
|