xiaoxian521
3 years ago
10 changed files with 59 additions and 29 deletions
-
23mock/user.ts
-
6src/layout/components/panel/index.vue
-
3src/layout/components/setting/index.vue
-
7src/layout/components/sidebar/horizontal.vue
-
1src/layout/components/sidebar/vertical.vue
-
4src/layout/hooks/nav.ts
-
6src/router/utils.ts
-
5src/store/modules/permission.ts
-
13src/store/modules/user.ts
-
14src/views/login.vue
@ -0,0 +1,23 @@ |
|||
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[]; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue