Skip to content

Commit 1c11943

Browse files
Merge branch 'opentiny:develop' into develop
2 parents 2bfbb1c + 2fcc416 commit 1c11943

4 files changed

Lines changed: 20 additions & 4 deletions

File tree

packages/design-core/src/preview/src/previewDefaultRegistry.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
*/
1212

1313
import { GenerateCodeService, Breadcrumb, Media, Lang, HttpService } from '../../../re-export'
14+
const isDevelopEnv = import.meta.env.MODE?.includes('dev')
15+
const useAuth = import.meta.env.VITE_AUTH === 'true'
1416

1517
export default {
1618
root: {
@@ -87,7 +89,8 @@ export default {
8789
oppositeTheme: 'light'
8890
}
8991
],
90-
enableTailwindCSS: true
92+
enableTailwindCSS: true,
93+
enableLogin: useAuth || !isDevelopEnv
9194
},
9295
toolbars: [Breadcrumb, Media, Lang]
9396
}

packages/plugins/block/src/BlockSetting.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ export default {
252252
page_content: item.content,
253253
id: item.blockId || item.block_id,
254254
history: item.id,
255-
name: item.label
255+
name: item.label,
256+
previewType: 'page'
256257
},
257258
true
258259
)

packages/plugins/page/src/PageHistory.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export default {
5757
const params = {
5858
...item,
5959
id: Number(item.page),
60-
history: item.id
60+
history: item.id,
61+
previewType: 'page'
6162
}
6263
params.ancestors = await getFamily(params)
6364
previewPage(params, true)

packages/workspace/application-center/src/Main.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,18 @@ export default {
208208
209209
const openApplication = (template) => {
210210
const href = window.location.href.split('?')[0] || './'
211-
window.open(`${href}?type=app&id=${template.id}&tenant=${template.tenantId || queryParams.get('tenant')}`)
211+
const newUrl = `${href}?type=app&id=${template.id}&tenant=${template.tenantId || queryParams.get('tenant')}`
212+
if (window.self !== window.top) {
213+
window.parent.postMessage(
214+
{
215+
type: 'openNewTab',
216+
url: newUrl
217+
},
218+
'*'
219+
)
220+
} else {
221+
window.open(newUrl)
222+
}
212223
}
213224
214225
const typeClick = (type) => {

0 commit comments

Comments
 (0)