sumba 2.33.5 → 2.34.0
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/extend/bajo/hook.js +1 -0
- package/index.js +10 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +2 -0
package/extend/bajo/hook.js
CHANGED
package/index.js
CHANGED
|
@@ -810,6 +810,16 @@ async function factory (pkgName) {
|
|
|
810
810
|
if (!get(req, 'user.isXSiteAdmin')) throw this.error('accessDenied', { statusCode: 403 })
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
+
checkRoute = async (req) => {
|
|
814
|
+
const { routePath } = this.app.waibu
|
|
815
|
+
const { outmatch } = this.app.lib
|
|
816
|
+
const routes = req.getSetting('waibu:route.disabled', []).map(item => routePath(item, false))
|
|
817
|
+
if (routes.length === 0) return
|
|
818
|
+
const isMatch = outmatch(routes)
|
|
819
|
+
const paths = this.pathsToCheck(req)
|
|
820
|
+
if (paths.find(isMatch)) throw this.error('_notFound')
|
|
821
|
+
}
|
|
822
|
+
|
|
813
823
|
parseNsSettings = (ns, setting, items) => {
|
|
814
824
|
const { trim, set, isPlainObject, isArray, isEmpty, find } = this.app.lib._
|
|
815
825
|
const { parseObject, dayjs } = this.app.lib
|
|
@@ -828,7 +838,6 @@ async function factory (pkgName) {
|
|
|
828
838
|
} catch (err) {}
|
|
829
839
|
} else if (Number(value)) value = Number(value)
|
|
830
840
|
else if (['true', 'false'].includes(value)) value = value === 'true'
|
|
831
|
-
else if (item.key.endsWith('$in')) value = value.split('\n').map(v => v.trim())
|
|
832
841
|
else {
|
|
833
842
|
const dt = dayjs(value)
|
|
834
843
|
if (dt.isValid()) value = dt.toDate()
|
package/package.json
CHANGED