Closed jeremy16601 closed 6 years ago
用 app.oAuth2Server.token()
之前的文章是 1.x 版本的,现在 2.x 了
app.oAuth2Server.token() 这个也一样的提示。 @Azard
TypeError: Cannot read property 'token' of undefined @Azard 变成这个了
D:\nodejs-Project\Exposure\node_modules\egg\lib\application.js:40 throw e; ^
TypeError: Cannot read property 'token' of undefined
at module.exports.app (D:\nodejs-Project\Exposure\app\router.js:6:44)
at AppWorkerLoader.loadFile (D:\nodejs-Project\Exposure\node_modules\egg-core\lib\loader\egg_loader.js:269:30)
at AppWorkerLoader.loadRouter (D:\nodejs-Project\Exposure\node_modules\egg-core\lib\loader\mixin\router.js:15:10)
at AppWorkerLoader.load (D:\nodejs-Project\Exposure\node_modules\egg\lib\loader\app_worker_loader.js:41:10)
at new Application (D:\nodejs-Project\Exposure\node_modules\egg\lib\application.js:36:19)
at Object.
你有创建 // {app_root}/app/extend/oauth.js
这个文件吗
恩,按照你教程,还有git上的demo试了。这个错误提示 @Azard
在 egg 初始化之后输出 app.oAuth2Server
看看输出,可能是初始化顺序的问题。
要不然回退到 1.x 版本,用法简单一些。
已解决,感谢作者。
集成后一直报这个错误,检查了下,没配置错啊,有知道怎么回事的吗