Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

egg报错:Please set config.keys first

$
0
0

我加了一个跨域中间件 middleware/cors.js module.exports = require(‘koa-cors’);

config.default.js module.exports = { // 配置需要的中间件,数组顺序即为中间件的加载顺序 middleware: [ ‘cors’ ],

}; 登录 http://127.0.0.1:7001/user/login?username=3

Error: Please set config.keys first at Application.get keys [as keys] (D:\lyq5655779.managementsystem\trunk\manage\node_modules\egg\lib\application.js:181:15) at Object.get cookies [as cookies] (D:\lyq5655779.managementsystem\trunk\manage\node_modules\egg\app\extend\context.js:17:65) at Object.get [egg-security#CSRF_SECRET] (D:\lyq5655779.managementsystem\trunk\manage\node_modules\egg-security\app\extend\context.js:76:32) at Object.ensureCsrfSecret (D:\lyq5655779.managementsystem\trunk\manage\node_modules\egg-security\app\extend\context.js:87:13) at Object.csrf (D:\lyq5655779.managementsystem\trunk\manage\node_modules\egg-security\lib\middlewares\csrf.js:13:10) at csrf.next (<anonymous>) at Object.<anonymous> (D:\lyq5655779.managementsystem\trunk\manage\node_modules\koa-compose\index.js:28:19) at Generator.next (<anonymous>) at onFulfilled (D:\lyq5655779.managementsystem\trunk\manage\node_modules\co\index.js:65:19) at D:\lyq5655779.managementsystem\trunk\manage\node_modules\co\index.js:54:5


Viewing all articles
Browse latest Browse all 14821

Trending Articles