刘嘉威
2022-10-17 e4bdfcb0571b51b4d1d55f99df1d1f8ed21c35e3
1
2
3
4
5
6
7
8
9
10
11
12
13
import Mock from 'mockjs'
import type { MockParams } from "./index.d";
import MockIndex from "./mock-index"
Mock.setup({
    timeout: "300",
});
const mocks = [...MockIndex];
export function mockXHR() {
    let i: MockParams;
    for (i of mocks) {
        Mock.mock(new RegExp(i.url), i.type || "get", i.response);
    }
}