提交 12caf896 编写于 作者: D DCloud_LXH

chore: quickapp-webview getSystemInfo

上级 d2d5fce3
......@@ -21,6 +21,9 @@ export function initDefine(stringifyBoolean: boolean = false) {
manifestJson.versionCode || ''
),
'process.env.UNI_PLATFORM': JSON.stringify(process.env.UNI_PLATFORM),
'process.env.UNI_SUB_PLATFORM': JSON.stringify(
process.env.UNI_SUB_PLATFORM
),
'process.env.UNI_MP_PLUGIN': JSON.stringify(process.env.UNI_MP_PLUGIN),
'process.env.UNI_SUBPACKAGE': JSON.stringify(process.env.UNI_SUBPACKAGE),
'process.env.UNI_COMPILER_VERSION': JSON.stringify(
......
......@@ -39,8 +39,17 @@ export function populateParameters(
fromRes: any,
toRes: UniApp.GetSystemInfoResult
) {
const { brand, model, system, language, theme, version, hostName, platform } =
fromRes
const {
brand,
model,
system,
language,
theme,
version,
hostName = '',
platform,
} = fromRes
const isQuickApp = __PLATFORM__.indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = ''
......@@ -82,7 +91,11 @@ export function populateParameters(
// deviceModel
let deviceBrand = model.split(' ')[0].toLocaleLowerCase()
if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') {
if (
__PLATFORM__ === 'mp-toutiao' ||
__PLATFORM__ === 'mp-lark' ||
isQuickApp
) {
deviceBrand = brand.toLocaleLowerCase()
} else {
deviceBrand = getDeviceBrand(deviceBrand)
......@@ -107,7 +120,7 @@ export function populateParameters(
appVersionCode: process.env.UNI_APP_VERSION_CODE,
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_PLATFORM,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
deviceBrand,
deviceModel: model,
deviceType,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册