测试判断ios和android

This commit is contained in:
2025-07-16 09:02:45 +08:00
parent 58807eb0da
commit a9f7d9a962
2 changed files with 12 additions and 2 deletions
+10 -1
View File
@@ -116,7 +116,16 @@ export const getUserInfo = (key = '') => {
const userInfo = uni.getStorageSync('userInfo')
return '' === key ? userInfo : userInfo[key];
}
export const getPhoneEnvBool = (flag) => _ENV.VITE_APP_ENV === flag
export const getPhoneEnvBool = (flag) => {
const {platform} = uni.getSystemInfoSync();
if (platform === 'ios') {
return flag === 'IOS'
} else if (platform === 'android') {
return flag === 'AND'
} else {
return false
}
}
// 将对象和字符串相互转换