mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-04-24 23:47:17 +08:00
24 lines
511 B
TypeScript
24 lines
511 B
TypeScript
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[];
|