You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
511 B
23 lines
511 B
import { MockMethod } from "vite-plugin-mock";
|
|
|
|
export default [
|
|
{
|
|
url: "/login",
|
|
method: "post",
|
|
response: ({ body }) => {
|
|
if (body.username === "admin") {
|
|
return {
|
|
username: "admin",
|
|
expires: 24 * 60 * 60,
|
|
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin"
|
|
};
|
|
} else {
|
|
return {
|
|
username: "test",
|
|
expires: 24 * 60 * 60,
|
|
accessToken: "eyJhbGciOiJIUzUxMiJ9.test"
|
|
};
|
|
}
|
|
}
|
|
}
|
|
] as MockMethod[];
|