Commit 8c5001d5 authored by lijundong's avatar lijundong
Browse files

fix: use lodash compare json other than lib compare

parent 87e949b6
...@@ -3,7 +3,7 @@ const advModel = require('./advMockModel.js'); ...@@ -3,7 +3,7 @@ const advModel = require('./advMockModel.js');
const caseModel = require('./caseModel.js'); const caseModel = require('./caseModel.js');
const yapi = require('yapi.js'); const yapi = require('yapi.js');
const mongoose = require('mongoose'); const mongoose = require('mongoose');
const _ = require('underscore'); const _ = require("lodash");
const path = require('path'); const path = require('path');
const lib = require(path.resolve(yapi.WEBROOT, 'common/lib.js')); const lib = require(path.resolve(yapi.WEBROOT, 'common/lib.js'));
const Mock = require('mockjs'); const Mock = require('mockjs');
...@@ -59,7 +59,7 @@ module.exports = function() { ...@@ -59,7 +59,7 @@ module.exports = function() {
let matchList = []; let matchList = [];
listWithIp.forEach(item => { listWithIp.forEach(item => {
let params = item.params; let params = item.params;
if (item.case_enable && lib.isDeepMatch(reqParams, params)) { if (item.case_enable && _.isEqual(reqParams, params)) {
matchList.push(item); matchList.push(item);
} }
}); });
...@@ -74,7 +74,7 @@ module.exports = function() { ...@@ -74,7 +74,7 @@ module.exports = function() {
.select('_id params case_enable'); .select('_id params case_enable');
list.forEach(item => { list.forEach(item => {
let params = item.params; let params = item.params;
if (item.case_enable && lib.isDeepMatch(reqParams, params)) { if (item.case_enable && _.isEqual(reqParams, params)) {
matchList.push(item); matchList.push(item);
} }
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment