Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
pub
yapi
Commits
cc40c39a
Unverified
Commit
cc40c39a
authored
May 22, 2020
by
sean1025
Committed by
GitHub
May 22, 2020
Browse files
Revert "fix: use lodash compare json other than lib isDeepMatch"
parent
a063f382
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
exts/yapi-plugin-advanced-mock/server.js
exts/yapi-plugin-advanced-mock/server.js
+3
-3
No files found.
exts/yapi-plugin-advanced-mock/server.js
View file @
cc40c39a
...
@@ -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
(
"
lodash
"
);
const
_
=
require
(
'
underscore
'
);
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
&&
_
.
isEqual
(
reqParams
,
params
))
{
if
(
item
.
case_enable
&&
lib
.
isDeepMatch
(
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
&&
_
.
isEqual
(
reqParams
,
params
))
{
if
(
item
.
case_enable
&&
lib
.
isDeepMatch
(
reqParams
,
params
))
{
matchList
.
push
(
item
);
matchList
.
push
(
item
);
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment