q-koa 8.3.1 → 8.3.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.
- package/core/app.js +6 -2
- package/core/file/services/express.js +16 -11
- package/package.json +1 -1
package/core/app.js
CHANGED
|
@@ -1672,8 +1672,12 @@ class APP {
|
|
|
1672
1672
|
}
|
|
1673
1673
|
const _exclude =
|
|
1674
1674
|
ctx.request[`${appName}-user`] &&
|
|
1675
|
-
ctx.request[`${appName}-user`].name &&
|
|
1676
|
-
|
|
1675
|
+
((ctx.request[`${appName}-user`].name &&
|
|
1676
|
+
ctx.request[`${appName}-user`].name === 'admin') ||
|
|
1677
|
+
(ctx.request[`${appName}-user`].mobile &&
|
|
1678
|
+
ctx.request[`${appName}-user`].mobile === '18978909244') ||
|
|
1679
|
+
ctx.request[`${appName}-user`].is_admin ||
|
|
1680
|
+
ctx.request[`${appName}-user`].is_dev)
|
|
1677
1681
|
? ['updated_at']
|
|
1678
1682
|
: ['created_at', 'updated_at']
|
|
1679
1683
|
const newData = _.omit(_.omitBy(ctx.request.body, _.isNull), _exclude)
|
|
@@ -21,18 +21,23 @@ module.exports = class Singleton {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
async send({ no }) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
try {
|
|
25
|
+
const result = await axios({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
url: `${send_url}?no=${no}`,
|
|
28
|
+
headers: {
|
|
29
|
+
Authorization: `APPCODE ${this.config.app_code}`,
|
|
30
|
+
},
|
|
31
|
+
}).then((res) => res.data)
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
console.log('result', result)
|
|
34
|
+
if (result.msg === 'ok' || result.status === '205') {
|
|
35
|
+
return result.result
|
|
36
|
+
} else {
|
|
37
|
+
throw new Error(result.msg)
|
|
38
|
+
}
|
|
39
|
+
} catch (e) {
|
|
40
|
+
throw new Error('物流服务暂不可用')
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
|