提交 347c3825 编写于 作者: D DCloud_LXH

chore: lint

上级 0bb4e07d
function _getDeviceBrand(model) { function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' } if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' } if (/windows/gi.test(model)) { return 'microsoft' }
return '' return ''
...@@ -6,7 +6,7 @@ function _getDeviceBrand(model) { ...@@ -6,7 +6,7 @@ function _getDeviceBrand(model) {
const UUID_KEY = '__DC_STAT_UUID' const UUID_KEY = '__DC_STAT_UUID'
let deviceId let deviceId
export function useDeviceId(result) { export function useDeviceId (result) {
deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY) deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY)
if (!deviceId) { if (!deviceId) {
deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7) deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7)
...@@ -18,7 +18,7 @@ export function useDeviceId(result) { ...@@ -18,7 +18,7 @@ export function useDeviceId(result) {
result.deviceId = deviceId result.deviceId = deviceId
} }
export function addSafeAreaInsets(result) { export function addSafeAreaInsets (result) {
if (result.safeArea) { if (result.safeArea) {
const safeArea = result.safeArea const safeArea = result.safeArea
result.safeAreaInsets = { result.safeAreaInsets = {
...@@ -30,7 +30,7 @@ export function addSafeAreaInsets(result) { ...@@ -30,7 +30,7 @@ export function addSafeAreaInsets(result) {
} }
} }
export function populateParameters(result) { export function populateParameters (result) {
const { const {
brand = '', model = '', system = '', brand = '', model = '', system = '',
language = '', theme, version, language = '', theme, version,
...@@ -60,10 +60,10 @@ export function populateParameters(result) { ...@@ -60,10 +60,10 @@ export function populateParameters(result) {
} }
// deviceType // deviceType
let deviceType = getGetDeviceType(result, model) const deviceType = getGetDeviceType(result, model)
// deviceModel // deviceModel
let deviceBrand = getDeviceBrand(brand, model, isQuickApp) const deviceBrand = getDeviceBrand(brand, model, isQuickApp)
// hostName // hostName
let _hostName = hostName || __PLATFORM__.split('-')[1] // mp-jd let _hostName = hostName || __PLATFORM__.split('-')[1] // mp-jd
...@@ -128,7 +128,7 @@ export function populateParameters(result) { ...@@ -128,7 +128,7 @@ export function populateParameters(result) {
Object.assign(result, parameters) Object.assign(result, parameters)
} }
export function getGetDeviceType(result, model) { export function getGetDeviceType (result, model) {
let deviceType = result.deviceType || 'phone' let deviceType = result.deviceType || 'phone'
if (__PLATFORM__ !== 'mp-baidu') { if (__PLATFORM__ !== 'mp-baidu') {
const deviceTypeMaps = { const deviceTypeMaps = {
...@@ -149,7 +149,7 @@ export function getGetDeviceType(result, model) { ...@@ -149,7 +149,7 @@ export function getGetDeviceType(result, model) {
return deviceType return deviceType
} }
export function getDeviceBrand( export function getDeviceBrand (
brand, brand,
model, model,
isQuickApp = false isQuickApp = false
...@@ -165,4 +165,4 @@ export function getDeviceBrand( ...@@ -165,4 +165,4 @@ export function getDeviceBrand(
deviceBrand = _getDeviceBrand(deviceBrand) deviceBrand = _getDeviceBrand(deviceBrand)
} }
return deviceBrand return deviceBrand
} }
\ No newline at end of file
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
appId: process.env.UNI_APP_ID, appId: process.env.UNI_APP_ID,
appName: process.env.UNI_APP_NAME, appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME, appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE, appVersionCode: process.env.UNI_APP_VERSION_CODE
}) })
} }
} }
import { useDeviceId, getGetDeviceType, getDeviceBrand } from './enhance-system-info'; import { useDeviceId, getGetDeviceType, getDeviceBrand } from './enhance-system-info'
export default { export default {
returnValue: function (result) { returnValue: function (result) {
const { brand, model } = result const { brand, model } = result
let deviceType = getGetDeviceType(result, model) const deviceType = getGetDeviceType(result, model)
let deviceBrand = getDeviceBrand(brand, model) const deviceBrand = getDeviceBrand(brand, model)
useDeviceId(result) useDeviceId(result)
Object.assign(result, { Object.assign(result, {
deviceType, deviceType,
deviceBrand, deviceBrand,
deviceModel: model, deviceModel: model
}) })
} }
} }
import { addSafeAreaInsets } from './enhance-system-info'; import { addSafeAreaInsets } from './enhance-system-info'
export default { export default {
returnValue: function (result) { returnValue: function (result) {
...@@ -6,7 +6,7 @@ export default { ...@@ -6,7 +6,7 @@ export default {
Object.assign(result, { Object.assign(result, {
windowTop: 0, windowTop: 0,
windowBottom: 0, windowBottom: 0
}) })
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册