From f49f9c66852738f39ca6db48dbf8d36bc07d14f8 Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Sun, 5 Feb 2023 12:18:25 +0800 Subject: [PATCH] u --- unitool.js | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/unitool.js b/unitool.js index 2589439..2237b7a 100644 --- a/unitool.js +++ b/unitool.js @@ -218,15 +218,22 @@ export default { // 注意1,resultServer 和 resultCloud 推荐遵循同样的格式 { _state, error | data },这样方便前端做统一判断。 // 注意2,虽然预设了 resultServer 和 resultCloud = {},但如果后台返回了 null,那么 resultServer/resultCloud 也是 null。 if (process.env.NODE_ENV !== 'production') { - console.log(`%c[FROM] ${thisRoute}`, 'background: #1e90ff; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;') - console.log(`%c(IN) ${startTime}`, 'background: #87cefa; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', { - baseType, - apiWho, - apiTodo, - apiWhat, - url, - }) - console.log(`%c(OUT) ${new Date().toJSON()}`, 'background: #4169e1; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', result) + console.log( + `%c(IN) ${startTime} ${thisRoute} :: ${apiTodo}`, + 'background: #87cefa; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', + { + baseType, + apiWho, + apiTodo, + apiWhat, + url, + } + ) + console.log( + `%c(OUT) ${new Date().toJSON()} ${thisRoute} :: ${apiTodo}`, + 'background: #4169e1; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', + result + ) } return result },