refactor(mock): ♻️ 抽离公共代码

This commit is contained in:
cshaptx4869
2024-03-02 16:45:27 +08:00
parent f65e38b9bd
commit b30cfe0e67
7 changed files with 32 additions and 52 deletions

10
mock/base.ts Normal file
View File

@@ -0,0 +1,10 @@
import path from "path";
import { createDefineMock } from "vite-plugin-mock-dev-server";
export const defineMock = createDefineMock((mock) => {
// 拼接url
mock.url = path.join(
import.meta.env.VITE_APP_BASE_API + "/api/v1/",
mock.url
);
});