diff --git a/usertool.js b/usertool.js index a93838d..761874e 100644 --- a/usertool.js +++ b/usertool.js @@ -37,7 +37,7 @@ export default { console.error('%c ' + JSON.stringify({ time: new Date().toJSON(), page: pageName }), 'color:red', ...args) }, ccdebug (...args) { - if (process.env.NODE_ENV === 'development') { + if (process.env.NODE_ENV !== 'production') { const pageName = this.thisPage()?.route || 'VueApp' console.debug('%c ' + JSON.stringify({ time: new Date().toJSON(), page: pageName }), 'color:cyan', ...args) } @@ -229,7 +229,7 @@ export default { } // 注意1,resultServer 和 resultCloud 推荐遵循同样的格式 { _state, error | data },这样方便前端做统一判断。 // 注意2,虽然预设了 resultServer 和 resultCloud = {},但如果后台返回了 null,那么 resultServer/resultCloud 也是 null。 - if (process.env.NODE_ENV === 'development') { + if (process.env.NODE_ENV !== 'production') { console.log( '%c ' + JSON.stringify({ startTime: startTime, page: thisRoute, endTime: new Date().toJSON() }) + @@ -343,7 +343,7 @@ export default { return { _state: 'CLIENT_FAIL_UNKNOWN_MEDIA_TYPE' } } - if (process.env.NODE_ENV === 'development') { + if (process.env.NODE_ENV !== 'production') { cloudPath = 'dev_' + cloudPath }