feat: login

This commit is contained in:
2025-09-09 16:58:30 +08:00
parent d6457f59f7
commit f33f597a9a
41 changed files with 10998 additions and 3594 deletions

View File

@@ -1,11 +1,13 @@
import { UserVO } from "./services/login/types";
/**
* @see https://umijs.org/docs/max/access#access
* */
export default function access(
initialState: { currentUser?: API.CurrentUser } | undefined,
initialState: { currentUser?: UserVO } | undefined
) {
const { currentUser } = initialState ?? {};
return {
canAdmin: currentUser && currentUser.access === 'admin',
canAdmin: currentUser && currentUser.username === "admin",
};
}