正在显示
2 个修改的文件
包含
12 行增加
和
4 行删除
@@ -35,8 +35,8 @@ exports = module.exports = function (logger, settings) { | @@ -35,8 +35,8 @@ exports = module.exports = function (logger, settings) { | ||
35 | 'grant_type': 'refresh_token', | 35 | 'grant_type': 'refresh_token', |
36 | 'refresh_token': token.refresh_token | 36 | 'refresh_token': token.refresh_token |
37 | }; | 37 | }; |
38 | - if (token.tenant && token.tenant.tenant_id) { | ||
39 | - params['account'] = token.tenant.tenant_id; | 38 | + if (token.tenant && token.tenant.id) { |
39 | + params['account'] = token.tenant.id; | ||
40 | } | 40 | } |
41 | var options = { | 41 | var options = { |
42 | method: 'post', | 42 | method: 'post', |
@@ -2,6 +2,7 @@ var path = require('path'); | @@ -2,6 +2,7 @@ var path = require('path'); | ||
2 | var IoC = require('electrolyte'); | 2 | var IoC = require('electrolyte'); |
3 | var bootable = require('./bootable'); | 3 | var bootable = require('./bootable'); |
4 | var express = require('express'); | 4 | var express = require('express'); |
5 | +var Promise = require('bluebird'); | ||
5 | 6 | ||
6 | process.chdir(__dirname); | 7 | process.chdir(__dirname); |
7 | //依赖注入 | 8 | //依赖注入 |
@@ -11,8 +12,15 @@ IoC.use('igloo', require('./igloo')); | @@ -11,8 +12,15 @@ IoC.use('igloo', require('./igloo')); | ||
11 | 12 | ||
12 | var app = bootable(express()); | 13 | var app = bootable(express()); |
13 | 14 | ||
14 | -app.phase(bootable.di.initializers()); | ||
15 | -app.phase(bootable.di.routes('./routes')); | 15 | +app.pushPhase = function (phase) { |
16 | + new Promise(function (resolve, reject) { | ||
17 | + phase(resolve, reject) | ||
18 | + }).then(function (data) { | ||
19 | + app.phase(bootable.di.initializers()); | ||
20 | + app.phase(bootable.di.routes('./routes')); | ||
21 | + }); | ||
22 | +}; | ||
23 | + | ||
16 | 24 | ||
17 | IoC.create('igloo/server').then(function (server) { | 25 | IoC.create('igloo/server').then(function (server) { |
18 | app.phase(server); | 26 | app.phase(server); |
请
注册
或
登录
后发表评论