Ai
1 Star 0 Fork 0

codingchengdu/egg-oauth2-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 927 Bytes
一键复制 编辑 原始数据 按行查看 历史
zemzheng 提交于 2018-07-07 13:10 +08:00 . fix #31 support app/extend/oauth.ts (#32)
'use strict';
const path = require('path');
const OAuth2Server = require('./lib/server');
module.exports = app => {
app.coreLogger.info('[egg-oauth2-server] egg-oauth2-server begin start');
const start = Date.now();
const config = app.config.oAuth2Server;
const model = app.loader.loadFile(path.join(app.config.baseDir, 'app/extend/oauth.js'))
// @see https://github.com/Azard/egg-oauth2-server/issues/31
|| app.loader.loadFile(path.join(app.config.baseDir, 'app/extend/oauth.ts'));
if (model === null) {
app.coreLogger.error('[egg-oauth2-server] not find app/extend/oauth.js, egg-oauth2-server start fail');
return;
}
try {
app.oAuth2Server = new OAuth2Server(config, model);
} catch (e) {
app.coreLogger.error('[egg-oauth2-server] start fail, %s', e);
return;
}
app.coreLogger.info('[egg-oauth2-server] egg-oauth2-server started use %d ms', Date.now() - start);
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/codingchengdu/egg-oauth2-server.git
git@gitee.com:codingchengdu/egg-oauth2-server.git
codingchengdu
egg-oauth2-server
egg-oauth2-server
master

搜索帮助