/*
模块功能:区分当前运行环境
编写时间:2021/10/26
编写者:刘俊雄
*/
// 客户端id: 1-小程序 2-公众号 3-ios 4-android 5-pc 6-h5(非微信环境)
let status = {
'MP-WEIXIN':{
code:1
},
'WEIXIN-H5':{
code:2
},
'IOS':{
code:3
},
'ANDROID':{
code:4
},
// 'PC':{
// code:5
// },
'H5':{
code:6
}
}
let key = ''
// App 运行环境
//
let systemInfo = uni.getSystemInfoSync()
if( systemInfo.platform === 'android' ){
key = "ANDROID"
}else if( systemInfo.platform === 'ios' ){
key = "IOS"
}
//
// H5 运行环境
//
if( navigator.userAgent.toLowerCase().indexOf('micromessenger')+1 ){
key = "WEIXIN-H5"
}else{
key = "H5"
}
//
// 微信小程序 运行环境
//
key = "MP-WEIXIN"
//
export const clientCode = status[key]