@next-core/brick-kit 2.118.7 → 2.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -5792,11 +5792,14 @@ function registerMock(useMocks) {
|
|
|
5792
5792
|
var _useMocks$mockList;
|
|
5793
5793
|
|
|
5794
5794
|
if (useMocks) mocks = _objectSpread(_objectSpread({}, useMocks), {}, {
|
|
5795
|
-
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item =>
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5795
|
+
mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => {
|
|
5796
|
+
var isFlowAPi = isCustomApiProvider(item.provider);
|
|
5797
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
5798
|
+
uri: "".concat(isFlowAPi ? item.uri.replace(/(.+?)\/(.+)/, (_match, p1, p2) => {
|
|
5799
|
+
return "/".concat(p1, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p2, "$");
|
|
5800
|
+
}) : "/".concat(item.uri.split(".").slice(2).join("."), "$")).replace(/:\w+/g, "([^/]+)")
|
|
5801
|
+
});
|
|
5802
|
+
})
|
|
5800
5803
|
});
|
|
5801
5804
|
}
|
|
5802
5805
|
function getMockList() {
|
|
@@ -5816,6 +5819,7 @@ var getMockInfo = (requestUrl, method) => {
|
|
|
5816
5819
|
if (item) {
|
|
5817
5820
|
return {
|
|
5818
5821
|
url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
|
|
5822
|
+
// 忽略版本
|
|
5819
5823
|
return "".concat(p1, "/").concat(p3);
|
|
5820
5824
|
}).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
|
|
5821
5825
|
mockId: mocks.mockId
|