提交 07fc68b7 编写于 作者: Q qiang

chore: build

上级 2830a507
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......
......@@ -414,7 +414,7 @@ var serviceContext = (function () {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
function toRawType (val) {
return _toString.call(val).slice(8, -1)
......@@ -494,6 +494,16 @@ var serviceContext = (function () {
} else {
return false
}
}
function sortObject (obj) {
const sortObj = {};
if (isPlainObject(obj)) {
Object.keys(obj).sort().forEach(key => {
sortObj[key] = obj[key];
});
}
return !Object.keys(sortObj) ? obj : sortObj
}
const encodeReserveRE = /[!'()*]/g;
......@@ -6535,16 +6545,16 @@ var serviceContext = (function () {
const _osName = osName.toLowerCase();
return {
brand,
deviceBrand: brand,
deviceModel,
devicePixelRatio: plus.screen.scale,
deviceId: deviceId$1(),
deviceOrientation,
deviceType,
brand,
model: deviceModel,
system: `${_osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`,
platform: _osName
platform: _osName,
system: `${_osName === 'ios' ? 'iOS' : 'Android'} ${osVersion}`
}
}
......@@ -6563,23 +6573,23 @@ var serviceContext = (function () {
: hostLanguage;
return {
SDKVersion: '',
hostSDKVersion: '',
enableDebug: false,
appId,
appName,
appVersion,
appVersionCode,
appLanguage,
version: plus.runtime.innerVersion,
language: osLanguage,
theme: '',
enableDebug: false,
hostSDKVersion: undefined,
hostPackageName,
hostName,
hostVersion,
hostLanguage,
hostTheme,
hostFontSizeSetting: undefined
hostFontSizeSetting: undefined,
language: osLanguage,
SDKVersion: '',
theme: undefined,
version: plus.runtime.innerVersion
}
}
......@@ -6596,24 +6606,14 @@ var serviceContext = (function () {
const appBaseInfo = getAppBaseInfo();
_initSystemInfo = true;
const { osName, osLanguage, osVersion } = systemInfo;
const _osName = osName.toLowerCase();
const osLanguageSplit = osLanguage.split('-');
const osLanguageSplitLast = osLanguageSplit[osLanguageSplit.length - 1];
const _osLanguage = `${osLanguageSplit[0]}${osLanguageSplitLast ? '-' + osLanguageSplitLast : ''}`;
const extraData = {
errMsg: 'getSystemInfo:ok',
fontSizeSetting: appBaseInfo.hostFontSizeSetting,
uniCompileVersion: __uniConfig.compilerVersion,
uniRuntimeVersion: __uniConfig.compilerVersion,
osLanguage: _osLanguage,
osName: _osName
osName: systemInfo.osName.toLowerCase()
};
if (_osName === 'ios') {
extraData.romName = _osName;
extraData.romVersion = osVersion;
if (systemInfo.hostName) {
extraData.hostSDKVersion = systemInfo.uniRuntimeVersion;
}
const _systemInfo = Object.assign(
......@@ -6629,7 +6629,7 @@ var serviceContext = (function () {
delete _systemInfo.enableDebug;
delete _systemInfo.theme;
return _systemInfo
return sortObject(_systemInfo)
}
function vibrateLong () {
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -763,12 +763,6 @@ function removeStorageSync (key) {
})
}
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
function addSafeAreaInsets (result) {
if (result.safeArea) {
const safeArea = result.safeArea;
......@@ -785,11 +779,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-alipay".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-alipay".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -804,12 +797,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-alipay".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
_hostName = result.app;
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -821,6 +812,9 @@ function populateParameters (result) {
let _SDKVersion = SDKVersion;
{ _SDKVersion = my.SDKVersion; }
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -828,6 +822,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -840,7 +835,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -852,7 +847,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -879,23 +874,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-alipay".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
_hostName = result.app;
return _hostName
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function addUuid (result) {
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -778,12 +778,6 @@ var previewImage = {
}
};
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -814,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-baidu".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-baidu".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -837,12 +830,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-baidu".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
{ _hostName = result.host; }
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -855,6 +846,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -862,6 +856,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -874,7 +869,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -886,7 +881,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -897,23 +892,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-baidu".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
{ _hostName = result.host; }
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -607,12 +607,6 @@ var baseApi = /*#__PURE__*/Object.freeze({
interceptors: interceptors
});
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -643,11 +637,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-jd".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-jd".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -665,11 +658,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-jd".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -680,6 +672,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -687,6 +682,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -699,7 +695,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -711,7 +707,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -738,23 +734,27 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-jd".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -778,12 +778,6 @@ var previewImage = {
}
};
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -814,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-kuaishou".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-kuaishou".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -833,12 +826,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-kuaishou".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
{ _hostName = result.host; }
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -849,6 +840,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -856,6 +850,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -868,7 +863,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -880,7 +875,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -907,23 +902,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-kuaishou".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
{ _hostName = result.host; }
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -808,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-lark".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-lark".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -827,12 +826,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-lark".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
{ _hostName = result.appName; }
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -843,6 +840,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -850,6 +850,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -862,7 +863,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -874,7 +875,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -901,18 +902,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
{
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-lark".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
{ _hostName = result.appName; }
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -778,12 +778,6 @@ var previewImage = {
}
};
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -814,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-qq".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-qq".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -833,12 +826,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-qq".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
_hostName = result.AppPlatform;
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -849,6 +840,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -856,6 +850,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -868,7 +863,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -880,7 +875,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -907,23 +902,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-qq".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
_hostName = result.AppPlatform;
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -808,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-toutiao".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-toutiao".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -827,12 +826,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-toutiao".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
{ _hostName = result.appName; }
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -843,6 +840,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -850,6 +850,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -862,7 +863,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -874,7 +875,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -901,18 +902,28 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
{
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-toutiao".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
{ _hostName = result.appName; }
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -117,7 +117,17 @@ function cached (fn) {
const camelizeRE = /-(\w)/g;
const camelize = cached((str) => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')
});
});
function sortObject (obj) {
const sortObj = {};
if (isPlainObject(obj)) {
Object.keys(obj).sort().forEach(key => {
sortObj[key] = obj[key];
});
}
return !Object.keys(sortObj) ? obj : sortObj
}
const HOOKS = [
'invoke',
......@@ -673,12 +683,6 @@ var previewImage = {
}
};
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -709,11 +713,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-weixin".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -728,18 +731,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = 'WeChat' ;
let _hostName = hostName || _platform; // mp-jd
{
if (environment) {
_hostName = environment;
} else if (result.host && result.host.env) {
_hostName = result.host.env;
}
}
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -750,6 +745,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -757,6 +755,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -769,7 +768,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -781,7 +780,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -808,23 +807,34 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = 'WeChat' ;
let _hostName = result.hostName || _platform; // mp-jd
{
if (result.environment) {
_hostName = result.environment;
} else if (result.host && result.host.env) {
_hostName = result.host.env;
}
}
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......@@ -845,24 +855,22 @@ var getAppBaseInfo = {
returnValue: function (result) {
const { version, language, SDKVersion, theme } = result;
let _hostName = "mp-weixin".split('-')[1]; // mp-jd
{
if (result.host && result.host.env) {
_hostName = result.host.env;
}
}
const _hostName = getHostName(result);
Object.assign(result, {
hostVersion: version,
hostLanguage: language.replace('_', '-'),
hostName: _hostName,
hostSDKVersion: SDKVersion,
hostTheme: theme,
const hostLanguage = language.replace('_', '-');
result = sortObject(Object.assign(result, {
appId: process.env.UNI_APP_ID,
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE
});
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
hostVersion: version,
hostLanguage,
hostName: _hostName,
hostSDKVersion: SDKVersion,
hostTheme: theme
}));
}
};
......@@ -870,14 +878,14 @@ var getDeviceInfo = {
returnValue: function (result) {
const { brand, model } = result;
const deviceType = getGetDeviceType(result, model);
const deviceBrand = getDeviceBrand(brand, model);
const deviceBrand = getDeviceBrand(brand);
useDeviceId(result);
Object.assign(result, {
result = sortObject(Object.assign(result, {
deviceType,
deviceBrand,
deviceModel: model
});
}));
}
};
......@@ -885,10 +893,10 @@ var getWindowInfo = {
returnValue: function (result) {
addSafeAreaInsets(result);
Object.assign(result, {
result = sortObject(Object.assign(result, {
windowTop: 0,
windowBottom: 0
});
}));
}
};
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -607,12 +607,6 @@ var baseApi = /*#__PURE__*/Object.freeze({
interceptors: interceptors
});
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -643,11 +637,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "mp-xhs".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "mp-xhs".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -662,11 +655,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "mp-xhs".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -677,6 +669,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -684,6 +679,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -696,7 +692,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -708,7 +704,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -735,23 +731,27 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "mp-xhs".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
......@@ -98,7 +98,7 @@ function hasOwn (obj, key) {
return hasOwnProperty.call(obj, key)
}
function noop () {}
function noop () { }
/**
* Create a cached version of a pure function.
......@@ -778,12 +778,6 @@ var previewImage = {
}
};
function _getDeviceBrand (model) {
if (/iphone/gi.test(model) || /ipad/gi.test(model) || /mac/gi.test(model)) { return 'apple' }
if (/windows/gi.test(model)) { return 'microsoft' }
return ''
}
const UUID_KEY = '__DC_STAT_UUID';
let deviceId;
function useDeviceId (result) {
......@@ -814,11 +808,10 @@ function populateParameters (result) {
const {
brand = '', model = '', system = '',
language = '', theme, version,
hostName, platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation,
environment
platform, fontSizeSetting,
SDKVersion, pixelRatio, deviceOrientation
} = result;
const isQuickApp = "quickapp-webview".indexOf('quickapp-webview') !== -1;
// const isQuickApp = "quickapp-webview".indexOf('quickapp-webview') !== -1
// osName osVersion
let osName = '';
......@@ -833,11 +826,10 @@ function populateParameters (result) {
const deviceType = getGetDeviceType(result, model);
// deviceModel
const deviceBrand = getDeviceBrand(brand, model, isQuickApp);
const deviceBrand = getDeviceBrand(brand);
// hostName
const _platform = "quickapp-webview".split('-')[1];
let _hostName = hostName || _platform; // mp-jd
const _hostName = getHostName(result);
// deviceOrientation
let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持
......@@ -848,6 +840,9 @@ function populateParameters (result) {
// SDKVersion
let _SDKVersion = SDKVersion;
// hostLanguage
const hostLanguage = language.replace(/_/g, '-');
// wx.getAccountInfoSync
const parameters = {
......@@ -855,6 +850,7 @@ function populateParameters (result) {
appName: process.env.UNI_APP_NAME,
appVersion: process.env.UNI_APP_VERSION_NAME,
appVersionCode: process.env.UNI_APP_VERSION_CODE,
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: process.env.UNI_COMPILER_VERSION,
uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,
uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,
......@@ -867,7 +863,7 @@ function populateParameters (result) {
osVersion,
hostTheme: theme,
hostVersion,
hostLanguage: language.replace('_', '-'),
hostLanguage,
hostName: _hostName,
hostSDKVersion: _SDKVersion,
hostFontSizeSetting: fontSizeSetting,
......@@ -879,7 +875,7 @@ function populateParameters (result) {
ua: undefined,
hostPackageName: undefined,
browserName: undefined,
browseVersion: undefined
browserVersion: undefined
};
Object.assign(result, parameters);
......@@ -906,23 +902,27 @@ function getGetDeviceType (result, model) {
return deviceType
}
function getDeviceBrand (
brand,
model,
isQuickApp = false
) {
let deviceBrand = model.split(' ')[0].toLocaleLowerCase();
if (
isQuickApp
) {
function getDeviceBrand (brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = brand.toLocaleLowerCase();
} else {
deviceBrand = _getDeviceBrand(deviceBrand);
}
return deviceBrand
}
function getAppLanguage (defaultLanguage) {
return getLocale$1
? getLocale$1()
: defaultLanguage
}
function getHostName (result) {
const _platform = "quickapp-webview".split('-')[1];
let _hostName = result.hostName || _platform; // mp-jd
return _hostName
}
var getSystemInfo = {
returnValue: function (result) {
useDeviceId(result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册