@gingkoo/base-server 0.0.2-alpha.33 → 0.0.2-alpha.35

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/app.js CHANGED
@@ -29,15 +29,14 @@ class App {
29
29
 
30
30
  this.connectDB();
31
31
  this.middleware();
32
- this.routes();
33
- this.schedule();
34
32
 
35
33
  if (!options.closeSocket) {
36
- setTimeout(() => {
37
- this.listenSocket();
38
- }, 10e3);
34
+ this.listenSocket();
39
35
  }
40
36
 
37
+ this.routes();
38
+ this.schedule();
39
+
41
40
  if (this.options.expandServer) {
42
41
  this.options.expandServer(this.httpServer, this.app, express);
43
42
  }
@@ -1,6 +1,7 @@
1
1
  var httpclient = require('node-httpclient');
2
2
  var util = require('../../../utils/util');
3
3
  const jwt = require('../../../utils/jwt');
4
+ const config = require('../../../config/index');
4
5
  const { logger } = require('../../logger');
5
6
  const userService = require('../../services/user');
6
7
  const configService = require('../../services/generalConfig');
@@ -16,7 +17,10 @@ const ginfoServices = require('../../ginfo/index');
16
17
  const getRedirectUrl = async (userAgent) => {
17
18
  let auth_redirect_url = '';
18
19
  let data = await configService.getFromConfig({ GROUP_ID: 'qywx' });
19
- let { qywx_AgentID, qywx_APPID, qywx_REDIRECT } = data;
20
+ let { qywx_AgentID, qywx_APPID } = data;
21
+
22
+ let qywx_REDIRECT = config.app.qywx_redirect_uri || data.qywx_REDIRECT;
23
+
20
24
  // qywx_REDIRECT = http://gingkoo.com/teams
21
25
  let redirect_uri = `${qywx_REDIRECT}/wechat/auth/oauth/qywx/callback`;
22
26
 
@@ -29,6 +29,7 @@ function gConfig() {
29
29
  app: {
30
30
  home: path.resolve('app_home'), // 资源存放的磁盘位置 (绝对路径)
31
31
  redirect_uri: '',
32
+ qywx_redirect_uri: '',
32
33
  },
33
34
 
34
35
  jwt: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gingkoo/base-server",
3
- "version": "0.0.2-alpha.33",
3
+ "version": "0.0.2-alpha.35",
4
4
  "description": "",
5
5
  "main": "app.js",
6
6
  "scripts": {