fix: 修改状态导致 method 被修改为get bug 和 opti mock-extra regex 不区分大小写

This commit is contained in:
suxiaoxin 2017-10-11 17:27:01 +08:00
parent 3b0d91e3cd
commit c25cd4c890
2 changed files with 5 additions and 2 deletions

View File

@ -25,6 +25,7 @@ function mock(mockJSON, context) {
c[i] = p[i];
if (filters.length > 1) {
for (var f = 1, l = filters.length, index; f < l; f++) {
filters[f] = filters[f].toLowerCase();
if (filters[f] in filtersMap) {
if ((index = newFilters.indexOf(filters[f])) !== -1) {
newFilters.splice(index, 1);

View File

@ -360,8 +360,10 @@ class interfaceController extends baseController {
catid: 'number'
});
params.method = params.method || 'GET';
params.method = params.method.toUpperCase();
if (!_.isUndefined(params.method)) {
params.method = params.method || 'GET';
params.method = params.method.toUpperCase();
}
let id = ctx.request.body.id;