From 43892230c092878da4a0ad6eb84640b98e1cc9eb Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Tue, 30 Nov 2021 19:53:28 +0800 Subject: [PATCH] refactor(sdk): remove resume logic --- .../uni-app-plus/dist/uni-app-service.es.js | 25 +++++-------------- .../service/framework/app/initGlobalEvent.ts | 13 +++++----- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/packages/uni-app-plus/dist/uni-app-service.es.js b/packages/uni-app-plus/dist/uni-app-service.es.js index 3d3ee55e0..1627c8c19 100644 --- a/packages/uni-app-plus/dist/uni-app-service.es.js +++ b/packages/uni-app-plus/dist/uni-app-service.es.js @@ -2678,13 +2678,6 @@ var serviceContext = (function (vue) { function getEnterOptions() { return enterOptions; } - function initEnterOptions({ path, query, referrerInfo, }) { - extend(enterOptions, { - path, - query: query ? parseQuery(query) : {}, - referrerInfo: referrerInfo || {}, - }); - } function initLaunchOptions({ path, query, referrerInfo, }) { extend(launchOptions, { path, @@ -18577,11 +18570,12 @@ var serviceContext = (function (vue) { emit(ON_APP_ENTER_BACKGROUND); }); plusGlobalEvent.addEventListener('resume', () => { - const info = parseRedirectInfo(); - if (info && info.userAction && info.path) { - initEnterOptions(info); - initEnterReLaunch(info); - } + // TODO 暂时不用 + // const info = parseRedirectInfo() + // if (info && info.userAction && info.path) { + // initEnterOptions(info) + // initEnterReLaunch(info) + // } emit(ON_APP_ENTER_FOREGROUND, getEnterOptions()); }); weexGlobalEvent.addEventListener('uistylechange', function (event) { @@ -18614,13 +18608,6 @@ var serviceContext = (function (vue) { } function onPlusMessage(type, callback, once = false) { UniServiceJSBridge.subscribe('plusMessage.' + type, callback, once); - } - function initEnterReLaunch(info) { - __uniConfig.realEntryPagePath = - __uniConfig.realEntryPagePath || __uniConfig.entryPagePath; - __uniConfig.entryPagePath = info.path; - __uniConfig.entryPageQuery = info.query; - $reLaunch({ url: addLeadingSlash(info.path) + info.query }, { resolve() { }, reject() { } }); } function initAppLaunch(appVm) { diff --git a/packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts b/packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts index c11308a93..82b5fcb30 100644 --- a/packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts +++ b/packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts @@ -10,8 +10,6 @@ import { $reLaunch } from '../../api/route/_reLaunch' import { EVENT_BACKBUTTON, backbuttonListener, - parseRedirectInfo, - initEnterOptions, getEnterOptions, RedirectInfo, } from './utils' @@ -34,11 +32,12 @@ export function initGlobalEvent() { }) plusGlobalEvent.addEventListener('resume', () => { - const info = parseRedirectInfo() - if (info && info.userAction && info.path) { - initEnterOptions(info) - initEnterReLaunch(info) - } + // TODO 暂时不用 + // const info = parseRedirectInfo() + // if (info && info.userAction && info.path) { + // initEnterOptions(info) + // initEnterReLaunch(info) + // } emit(ON_APP_ENTER_FOREGROUND, getEnterOptions()) }) -- GitLab