xiaoxian521
3 years ago
8 changed files with 22 additions and 56 deletions
-
23mock/user.ts
-
4src/layout/components/navbar.vue
-
4src/layout/components/sidebar/horizontal.vue
-
4src/layout/components/sidebar/mixNav.vue
-
8src/layout/hooks/nav.ts
-
5src/store/modules/permission.ts
-
10src/store/modules/user.ts
-
14src/views/login.vue
@ -1,23 +0,0 @@ |
|||
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