waibu 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/build-locals.js +1 -0
- package/package.json +1 -1
- package/plugin/factory.js +6 -9
package/lib/build-locals.js
CHANGED
|
@@ -18,6 +18,7 @@ function buildPagesMenu (req) {
|
|
|
18
18
|
const pages = this.app[ns].getConfig('waibuMpa.pages', { defValue: [] })
|
|
19
19
|
if (pages.length === 0) continue
|
|
20
20
|
for (const page of pages) {
|
|
21
|
+
page.level = page.level ?? 1000
|
|
21
22
|
if (page.visible === 'auth' && !req.user) continue
|
|
22
23
|
if (page.visible === 'anon' && req.user) continue
|
|
23
24
|
if (!page.children) {
|
package/package.json
CHANGED
package/plugin/factory.js
CHANGED
|
@@ -174,15 +174,12 @@ async function factory (pkgName) {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
getPluginByPrefix = (prefix) => {
|
|
177
|
-
const { get } = this.lib._
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return plugin
|
|
177
|
+
const { get, find } = this.lib._
|
|
178
|
+
const item = find(this.app.waibu.routes, r => {
|
|
179
|
+
return get(r, 'config.prefix') === prefix
|
|
180
|
+
})
|
|
181
|
+
const ns = get(item, 'config.ns')
|
|
182
|
+
if (ns) return this.app[ns]
|
|
186
183
|
}
|
|
187
184
|
|
|
188
185
|
getPluginPrefix = (base, webApp = 'waibuMpa') => {
|