Browse Source

fx

fanmiyou
nili 6 months ago
parent
commit
acb998f415
  1. 2
      src/access.ts
  2. 4
      src/app.tsx

2
src/access.ts

@ -1,7 +1,7 @@
/**
* @see https://umijs.org/docs/max/access#access
* */
export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
export default function access(initialState: { currentUser?: API.MatrixAdmin } | undefined) {
const { currentUser } = initialState ?? {};
let data = {
canAdmin: currentUser && currentUser.role && currentUser.role < 3

4
src/app.tsx

@ -1,4 +1,4 @@
import { AvatarDropdown, AvatarName, Footer, Question, SelectLang } from '@/components';
import { AvatarDropdown, AvatarName, Question, SelectLang } from '@/components';
import { current } from '@/services/matrix/admin';
import { LinkOutlined } from '@ant-design/icons';
import { SettingDrawer } from '@ant-design/pro-components';
@ -94,7 +94,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
links: isDev
? [
<Link key="openapi" to="/umi/plugin/openapi" target="_blank">
<LinkOutlined />
<LinkOutlined onPointerEnterCapture={undefined} onPointerLeaveCapture={undefined} />
<span>OpenAPI </span>
</Link>,
]

Loading…
Cancel
Save