q-koa 10.8.4 → 10.8.5
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/core/app.js +14 -2
- package/package.json +1 -1
package/core/app.js
CHANGED
|
@@ -340,7 +340,17 @@ class APP {
|
|
|
340
340
|
let dirList = await fsPromise.readdir(
|
|
341
341
|
path.resolve(__dirname, `${rootDirectory}/${APP_DIR}`)
|
|
342
342
|
)
|
|
343
|
-
|
|
343
|
+
const includeList = this.config.includes.filter(Boolean).map((item) => {
|
|
344
|
+
if (typeof item === 'string') {
|
|
345
|
+
return {
|
|
346
|
+
app: item,
|
|
347
|
+
db: item,
|
|
348
|
+
}
|
|
349
|
+
} else {
|
|
350
|
+
return item
|
|
351
|
+
}
|
|
352
|
+
})
|
|
353
|
+
dirList = dirList.filter((item) => includeList.some((i) => i.app === item))
|
|
344
354
|
|
|
345
355
|
let dbFlag = false
|
|
346
356
|
for (let i = 0; i < dirList.length; i++) {
|
|
@@ -362,7 +372,9 @@ class APP {
|
|
|
362
372
|
)
|
|
363
373
|
|
|
364
374
|
try {
|
|
365
|
-
const
|
|
375
|
+
const target = includeList.find((i) => i.app === appName)
|
|
376
|
+
const dbName =
|
|
377
|
+
(target ? target.db : '') || this.config.db.name || appName
|
|
366
378
|
const db = connectDatabase(dbName)(this.config.db)
|
|
367
379
|
if (!is_dev) {
|
|
368
380
|
if (!dbFlag) {
|