From b57f8438795d92c8167a3b4d7c024a24812ef458 Mon Sep 17 00:00:00 2001 From: yy-wow Date: Tue, 5 Nov 2024 14:44:22 -0800 Subject: [PATCH] fix: review --- designer-demo/src/composable/http/index.js | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/designer-demo/src/composable/http/index.js b/designer-demo/src/composable/http/index.js index a0fc41c00..08dccee0e 100644 --- a/designer-demo/src/composable/http/index.js +++ b/designer-demo/src/composable/http/index.js @@ -9,29 +9,6 @@ const { BROADCAST_CHANNEL } = constants const { post: globalNotify } = useBroadcastChannel({ name: BROADCAST_CHANNEL.Notify }) -const procession = { - promiseLogin: null, - mePromise: {} -} - -const loginDom = document.createElement('div') -document.body.appendChild(loginDom) -const loginVM = createApp(Login).mount(loginDom) - -window.lowcode = { - platformCenter: { - Session: { - rebuiltCallback: function () { - loginVM.closeLogin() - - procession.mePromise.resolve('login ok') - procession.promiseLogin = null - procession.mePromise = {} - } - } - } -} - const showError = (url, message) => { globalNotify({ type: 'error', @@ -67,6 +44,29 @@ const preResponse = (res) => { } const openLogin = () => { + const procession = { + promiseLogin: null, + mePromise: {} + } + + const loginDom = document.createElement('div') + document.body.appendChild(loginDom) + const loginVM = createApp(Login).mount(loginDom) + + window.lowcode = { + platformCenter: { + Session: { + rebuiltCallback: function () { + loginVM.closeLogin() + + procession.mePromise.resolve('login ok') + procession.promiseLogin = null + procession.mePromise = {} + } + } + } + } + return new Promise((resolve, reject) => { if (!procession.promiseLogin) { procession.promiseLogin = loginVM.openLogin(procession, '/api/rebuildSession')