Commit 32dd4fc5 authored by 智勇's avatar 智勇

Merge branch 'master' of http://git.quantgroup.cn/QA/qaHome

parents a9fc98be ce427671
...@@ -197,33 +197,34 @@ app.use(async (ctx, next) => { ...@@ -197,33 +197,34 @@ app.use(async (ctx, next) => {
// filter // filter
ctx.logger = logger; ctx.logger = logger;
ctx.user = {}; ctx.user = {};
await next(); if (config.site.env !== 'development' && urlFilter(ctx.request.url)) {
// if (config.site.env !== 'development' && urlFilter(ctx.request.url)) { let token = ctx.header['x-token'];
// let token = ctx.header['x-token']; if (token) {
// if (token) { if (session[token] == undefined) {
// if (session[token] == undefined) { let info = await requestPromise({
// let info = await requestPromise({ url: `http://user.liangkebang.com/user/check_token?token=${token}`,
// url: `http://user.liangkebang.com/user/check_token?token=${token}`, method: "GET"
// method: "GET" })
// }) info = JSON.parse(info);
// info = JSON.parse(info); if (info.code == '0000') {
// if (info.code == '0000') { // 验证通过
// // 验证通过 ctx.user = JSON.stringify(info);
// ctx.user = JSON.stringify(info); session[token] = info;
// session[token] = info; await next();
// await next(); return;
// return; }
// } } else {
// } else { ctx.user = session[token];
// ctx.user = session[token]; await next();
// await next(); return;
// return; }
// } }
// } ctx.status = 401;
// ctx.status = 401; // await next();
// } else { return;
// await next(); } else {
// } await next();
}
} }
}) })
app.use(Middles.vhost(vhosts)); app.use(Middles.vhost(vhosts));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment