diff --git a/lib/apis.js b/lib/apis.js index 37418a33aca81e08ee4852647a4df35f7f91a1dd..ff3cb2cfab1c119736c60b5e12a7b47cd076cddb 100644 --- a/lib/apis.js +++ b/lib/apis.js @@ -248,7 +248,9 @@ const third = [ 'unPreloadPage', 'loadSubPackage', 'sendHostEvent', - 'navigateToMiniProgram' + 'navigateToMiniProgram', + 'getLaunchOptionsSync', + 'getEnterOptionsSync' ] const ad = [ diff --git a/src/platforms/app-plus/service/api/index.js b/src/platforms/app-plus/service/api/index.js index 8c2bd331b68c475f13aa84644210df624c64c33f..9a145112b029dd16e290a6e669974de5604e66c4 100644 --- a/src/platforms/app-plus/service/api/index.js +++ b/src/platforms/app-plus/service/api/index.js @@ -56,6 +56,7 @@ export * from './plugin/on-native-event-receive' export * from './plugin/send-native-event' export * from './plugin/load-sub-package' export * from './plugin/sdk' +export * from './plugin/get-launch-options-sync' export * from './route/navigate-back' export * from './route/navigate-to' diff --git a/src/platforms/app-plus/service/api/plugin/get-launch-options-sync.js b/src/platforms/app-plus/service/api/plugin/get-launch-options-sync.js new file mode 100644 index 0000000000000000000000000000000000000000..4146007f8e500fb77c9759da23a602fca5b47c22 --- /dev/null +++ b/src/platforms/app-plus/service/api/plugin/get-launch-options-sync.js @@ -0,0 +1,11 @@ +import { + getEnterOptions, + getLaunchOptions +} from '../../framework/utils' + +export function getLaunchOptionsSync () { + return getLaunchOptions() +} +export function getEnterOptionsSync () { + return getEnterOptions() +} diff --git a/src/platforms/app-plus/service/framework/utils.js b/src/platforms/app-plus/service/framework/utils.js index 3326becfb64ff07bcf3167bcad482afe267e7670..40d0a0d279f97e219aaca82941b2212f73bd44b0 100644 --- a/src/platforms/app-plus/service/framework/utils.js +++ b/src/platforms/app-plus/service/framework/utils.js @@ -46,7 +46,9 @@ export function initLaunchOptions ({ extend(launchOptions, { path, query: query ? parseQuery(query) : {}, - referrerInfo: referrerInfo || {} + referrerInfo: referrerInfo || {}, + channel: plus.runtime.channel, + launcher: plus.runtime.launcher }) extend(enterOptions, launchOptions) return launchOptions @@ -62,7 +64,7 @@ export function parseRedirectInfo () { userAction, fromAppid } = - weexPlus.getRedirectInfo() || {} + weexPlus.getRedirectInfo() || {} const referrerInfo = { appId: fromAppid, extraData: {} @@ -77,4 +79,4 @@ export function parseRedirectInfo () { userAction } } -} +} diff --git a/src/platforms/mp-weixin/helpers/enhance-system-info.js b/src/platforms/mp-weixin/helpers/enhance-system-info.js index 985021dd86d86bab8ef73eb62c48c21747d75fd6..acee10a724f6d8b8b32f864a960e012719839703 100644 --- a/src/platforms/mp-weixin/helpers/enhance-system-info.js +++ b/src/platforms/mp-weixin/helpers/enhance-system-info.js @@ -2,7 +2,7 @@ import { getDeviceBrand } from 'uni-shared' const UUID_KEY = '__DC_STAT_UUID' let deviceId -export function useDeviceId(result) { +export function useDeviceId (result) { deviceId = deviceId || __GLOBAL__.getStorageSync(UUID_KEY) if (!deviceId) { deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7) @@ -14,7 +14,7 @@ export function useDeviceId(result) { result.deviceId = deviceId } -export function addSafeAreaInsets(result) { +export function addSafeAreaInsets (result) { if (result.safeArea) { const safeArea = result.safeArea result.safeAreaInsets = { @@ -26,7 +26,7 @@ export function addSafeAreaInsets(result) { } } -export function populateParameters(result) { +export function populateParameters (result) { const { brand, model, system, language, theme, version, hostName, platform } = result // osName osVersion @@ -75,11 +75,9 @@ export function populateParameters(result) { // hostName let _hostName = hostName // mp-jd if (__PLATFORM__ === 'mp-weixin') _hostName = (result.host || {}).env - if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou') - _hostName = result.host + if (__PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-kuaishou') { _hostName = result.host } if (__PLATFORM__ === 'mp-qq') _hostName = result.AppPlatform - if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') - _hostName = result.appName + if (__PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-lark') { _hostName = result.appName } if (__PLATFORM__ === 'mp-alipay') _hostName = result.app // wx.getAccountInfoSync @@ -111,4 +109,4 @@ export function populateParameters(result) { } Object.assign(result, parameters) -} \ No newline at end of file +}