waibu 1.0.2 → 1.0.4

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.
@@ -5,7 +5,9 @@ function routeDir (ns, base) {
5
5
  const prefix = get(cfg, 'waibu.prefix', this.app[base].alias)
6
6
  const dir = prefix === '' ? '' : `/${prefix}`
7
7
  if (!ns) return dir
8
- if (ns === base || (ns === this.app.bajo.mainNs && cfg.mountMainAsRoot)) return dir
8
+ const cfgMpa = get(this, 'app.waibuMpa.config')
9
+ if (ns === this.app.bajo.mainNs && cfgMpa.mountMainAsRoot) return ''
10
+ if (ns === base) return dir
9
11
  return dir + `/${get(this.app[ns].config, 'waibu.prefix', this.app[ns].alias)}`
10
12
  }
11
13
 
@@ -6,6 +6,7 @@ function routePath (name = '', { query = {}, base = 'waibuMpa', params = {}, gue
6
6
  const plugin = getPlugin(base)
7
7
  const cfg = plugin.config ?? {}
8
8
  let info = {}
9
+ if (name.startsWith('mailto:')) return name
9
10
  if (['.', '/', '?', '#'].includes(name[0]) || name.slice(1, 2) === ':') info.path = name
10
11
  else if (['~'].includes(name[0])) info.path = name.slice(1)
11
12
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Web Framework for Bajo",
5
5
  "main": "index.js",
6
6
  "scripts": {