From d009d59d69f54aa9bde99486e94068439c1e118b Mon Sep 17 00:00:00 2001 From: Bosn Ma Date: Thu, 10 Apr 2014 17:45:32 +0800 Subject: [PATCH] fix real data check info styles --- WebContent/stat/js/util/mock.plugin.js | 29 +++++++++++++++++++------- WebContent/tcom/const.inc.vm | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/WebContent/stat/js/util/mock.plugin.js b/WebContent/stat/js/util/mock.plugin.js index ce370dc13..55c9dc4f7 100644 --- a/WebContent/stat/js/util/mock.plugin.js +++ b/WebContent/stat/js/util/mock.plugin.js @@ -21,7 +21,8 @@ if (typeof window.console === 'undefined') { window.console = { log : function(){}, - warn : function(){} + warn : function(){}, + info : function(){} }; } @@ -88,7 +89,8 @@ oOptions.success = function() { var realData = arguments[0]; checkerOptions.context = { - data : realData + data : realData, + url : oOptions.url }; // perform real data check ajax.apply(jQuery, [checkerOptions]); @@ -141,7 +143,8 @@ oOptions.success = function() { var realData = arguments[0]; checkerOptions.context = { - data : realData + data : realData, + url : oOptions.url }; // perform real data check IO(checkerOptions); @@ -222,17 +225,29 @@ var realDataResult = result.left; var rapDataResult = result.right; var i; + var log = []; + var error = false; if (realDataResult.length === 0 && rapDataResult.length === 0) { - console.log('接口结构校验完毕,未发现问题。'); + log.push('接口结构校验完毕,未发现问题。'); } else { + error = true; + if (this.url) { + log.push('在校验接口' + this.url + '时发现错误:'); + } for (i = 0; i < realDataResult.length; i++) { - validatorResultLog(realDataResult[i]); + log.push(validatorResultLog(realDataResult[i])); } for (i = 0; i < rapDataResult.length; i++) { - validatorResultLog(rapDataResult[i], true); + log.push(validatorResultLog(rapDataResult[i], true)); } } + + console.info(log.join('\n')); + if (error === true) { + console.log('真实数据:'); + console.dir(this.data); + } } /** @@ -317,7 +332,7 @@ eventName = '数据类型与接口文档中的定义不符'; } - console.error('参数 ' + item.namespace + "." + item.property + ' ' + eventName); + return '参数 ' + item.namespace + "." + item.property + ' ' + eventName; } diff --git a/WebContent/tcom/const.inc.vm b/WebContent/tcom/const.inc.vm index 925d070b9..25a401596 100644 --- a/WebContent/tcom/const.inc.vm +++ b/WebContent/tcom/const.inc.vm @@ -14,7 +14,7 @@ #set($dateFormat = 'yyyy-MM-dd') ## 时间戳 -#set($timeStamp = '20140305.v0.8') +#set($timeStamp = '20140410.v0.8.1') ##----------------------页面请求action地址------------------------------- ## 配置工程的上下文路径