q-koa 8.9.1 → 8.9.2

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.
@@ -26,6 +26,31 @@ exports.initData = async ({ includes, excludes, app, ctx }) => {
26
26
  excludeInclude,
27
27
  autoInclude = true,
28
28
  } = route
29
+
30
+ if (url.includes('http')) {
31
+ return axios
32
+ .post(url, {
33
+ ...data,
34
+ limit,
35
+ order,
36
+ })
37
+ .then((res) => {
38
+ if (res.data.code !== 200) {
39
+ console.log(`${item}请求失败,${res.data.message}`)
40
+ } else {
41
+ return {
42
+ [item]: res.data.data,
43
+ }
44
+ }
45
+ })
46
+ .catch((e) => {
47
+ console.log(`${item}请求失败,${e.message}`)
48
+ return {
49
+ [item]: [],
50
+ }
51
+ })
52
+ }
53
+
29
54
  const [model, fn] = url.split('/')
30
55
 
31
56
  let myInclude
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.9.1",
3
+ "version": "8.9.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {