This commit is contained in:
陆柯 2023-02-05 12:18:25 +08:00
parent 5b3008b601
commit f49f9c6685

View File

@ -218,15 +218,22 @@ export default {
// 注意1resultServer 和 resultCloud 推荐遵循同样的格式 { _state, error | data },这样方便前端做统一判断。 // 注意1resultServer 和 resultCloud 推荐遵循同样的格式 { _state, error | data },这样方便前端做统一判断。
// 注意2虽然预设了 resultServer 和 resultCloud = {},但如果后台返回了 null那么 resultServer/resultCloud 也是 null。 // 注意2虽然预设了 resultServer 和 resultCloud = {},但如果后台返回了 null那么 resultServer/resultCloud 也是 null。
if (process.env.NODE_ENV !== 'production') { 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(
console.log(`%c(IN) ${startTime}`, 'background: #87cefa; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', { `%c(IN) ${startTime} ${thisRoute} :: ${apiTodo}`,
baseType, 'background: #87cefa; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;',
apiWho, {
apiTodo, baseType,
apiWhat, apiWho,
url, apiTodo,
}) apiWhat,
console.log(`%c(OUT) ${new Date().toJSON()}`, 'background: #4169e1; border-radius: 0.5em;color: white; font-weight: bold; padding: 2px 0.5em;', result) 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 return result
}, },