From 65702d3fef647494d2ae6ada8a4f0b154c48ab4f Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 28 Sep 2022 16:29:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=B6=E9=97=B4=E6=B5=8B?= =?UTF-8?q?=E7=AE=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/organization/index.js | 4 ---- api/app/lib/middlewares/authenticator.js | 5 ----- 2 files changed, 9 deletions(-) diff --git a/api/app/lib/controllers/organization/index.js b/api/app/lib/controllers/organization/index.js index 74fee26..7643065 100644 --- a/api/app/lib/controllers/organization/index.js +++ b/api/app/lib/controllers/organization/index.js @@ -7,14 +7,10 @@ async function allDeps (ctx) { const { redis } = ctx.app const start = moment() let depRes = await redis.get('allDepartments') - console.log(`DurationCalc: 1 用时 ${moment().diff(start, 'milliseconds')}`); if (depRes) { depRes = JSON.parse(depRes) - console.log(`DurationCalc: 2 用时 ${moment().diff(start, 'milliseconds')}`); depRes = depRes.departments - console.log(`DurationCalc: 3 用时 ${moment().diff(start, 'milliseconds')}`); } - console.log(`DurationCalc: 4 用时 ${moment().diff(start, 'milliseconds')}`); ctx.status = 200; ctx.body = depRes || [] } catch (error) { diff --git a/api/app/lib/middlewares/authenticator.js b/api/app/lib/middlewares/authenticator.js index 52e6a09..90000bf 100644 --- a/api/app/lib/middlewares/authenticator.js +++ b/api/app/lib/middlewares/authenticator.js @@ -71,8 +71,6 @@ let authorizeToken = async function (ctx, token) { const tokenFormatRegexp = /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/g; if (token && tokenFormatRegexp.test(token)) { try { - console.log(`DurationCalc: auth 1 用时 ${moment().diff(startTime, 'milliseconds')}`); - const expired = await ctx.redis.hget(token, 'expired'); // const authorizeRes = await ctx.app.fs.emisRequest.get('authorize', { @@ -80,7 +78,6 @@ let authorizeToken = async function (ctx, token) { // }) // const { userInfo, expired } = authorizeRes; - console.log(`DurationCalc: auth 2 用时 ${moment().diff(startTime, 'milliseconds')}`); // TODO 从项企 clickhouse 数据库中查 token 并更新 if (expired && moment().valueOf() <= moment(expired).valueOf()) { @@ -93,7 +90,6 @@ let authorizeToken = async function (ctx, token) { // } // }) || {} - console.log(`DurationCalc: auth 3 用时 ${moment().diff(startTime, 'milliseconds')}`); rslt = { 'authorized': userInfo.authorized, 'resources': (userInfo || {}).resources || [], @@ -104,7 +100,6 @@ let authorizeToken = async function (ctx, token) { ctx.fs.api.pepUserInfo = userInfo; ctx.fs.api.token = token; } - console.log(`DurationCalc: auth 4 用时 ${moment().diff(startTime, 'milliseconds')}`); } catch (err) { const { error } = err.response || {}; ctx.fs.logger.log('[anxinyun]', '[AUTH] failed', (error || {}).message || `cannot GET /users/${token}`);