Skip to content

Commit

Permalink
fix: review
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-wow committed Nov 5, 2024
1 parent 628e8ad commit b57f843
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions designer-demo/src/composable/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit b57f843

Please sign in to comment.