mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-08 12:07:42 +08:00
fix: allow open CLI from anywhere
This commit is contained in:
parent
a13879f2df
commit
7d9b34ecc9
@ -6,13 +6,11 @@ import routes from './scripts/route'
|
|||||||
|
|
||||||
Object.assign(window, { React, ReactDOM, $ })
|
Object.assign(window, { React, ReactDOM, $ })
|
||||||
|
|
||||||
if (blessing.route.startsWith('admin')) {
|
const entry = document.querySelector('[href="#launch-cli"]')
|
||||||
const entry = document.querySelector('[href="#launch-cli"]')
|
entry?.addEventListener('click', async () => {
|
||||||
entry?.addEventListener('click', async () => {
|
const { launch } = await import('./scripts/cli')
|
||||||
const { launch } = await import('./scripts/cli')
|
launch()
|
||||||
launch()
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const route = routes.find((route) =>
|
const route = routes.find((route) =>
|
||||||
new RegExp(`^${route.path}$`, 'i').test(blessing.route),
|
new RegExp(`^${route.path}$`, 'i').test(blessing.route),
|
||||||
|
Loading…
Reference in New Issue
Block a user