Skip to content

Commit

Permalink
fix(cli): drop useless code in mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Genuifx committed Mar 11, 2020
1 parent 72999b6 commit 73e9f2b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/wxa-cli/lib/wxa/directive/mock/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function useMock(page) {
setInputData(page, target, bindVarName, mockResult);
});
});
} catch(e) {
} catch (e) {
console.warn('[wxa:mock runtime]: error', e);
}
}
Expand All @@ -39,21 +39,21 @@ function getMockResult(target) {
let mockResult = '';
let drcValuePrefix = mockDrc[0];

if (drcValuePrefix === '$') {
// wxa提供
try {
mockResult = wxaMock.mock(mockDrc);
} catch {
console.error(`[wxa:mock]: WXA规则占位符格式有误:[${mockDrc}]`);
}
} else {
// if (drcValuePrefix === '$') {
// // wxa提供
// try {
// mockResult = wxaMock.mock(mockDrc);
// } catch (e) {
// console.error(`[wxa:mock]: WXA规则占位符格式有误:[${mockDrc}]`);
// }
// } else {
// mock.js
try {
mockResult = Mock.mock(mockDrc);
} catch {
} catch (e) {
console.error(`[wxa:mock]: Mock.js规则占位符格式有误:[${mockDrc}]`);
}
}
// }
return mockResult;
}

Expand Down

0 comments on commit 73e9f2b

Please sign in to comment.