feat: add user manager
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useLayoutStore } from './store';
|
||||
import clsx from 'clsx';
|
||||
import { Button, Dropdown, message } from 'antd';
|
||||
import { Button, Dropdown } from 'antd';
|
||||
import { message } from '@/modules/message';
|
||||
import {
|
||||
CloseOutlined,
|
||||
CodeOutlined,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useShallow } from 'zustand/react/shallow';
|
||||
import { useLayoutStore } from './store';
|
||||
import clsx from 'clsx';
|
||||
import { Button, message } from 'antd';
|
||||
import { Button } from 'antd';
|
||||
import { message } from '@/modules/message';
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
CloseOutlined,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { query } from '@/modules/query';
|
||||
import { message } from 'antd';
|
||||
import { create } from 'zustand';
|
||||
import { message } from '@/modules/message';
|
||||
export const getIsMac = async () => {
|
||||
// @ts-ignore
|
||||
const userAgentData = navigator.userAgentData;
|
||||
@@ -37,7 +37,7 @@ export const usePlatformStore = create<PlatfromStore>((set) => {
|
||||
init: async () => {
|
||||
const mac = await getIsMac();
|
||||
// @ts-ignore
|
||||
const isElectron = getIsElectron()
|
||||
const isElectron = getIsElectron();
|
||||
set({ isMac: isElectron && mac, isElectron: isElectron, mount: true });
|
||||
},
|
||||
};
|
||||
|
||||
3
src/modules/message.ts
Normal file
3
src/modules/message.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { message } from '@kevisual/system-ui/dist/message';
|
||||
|
||||
export { message };
|
||||
@@ -1,7 +1,7 @@
|
||||
import { QueryClient } from '@kevisual/query';
|
||||
import { modal } from './redirect-to-login';
|
||||
import { create } from 'zustand';
|
||||
import { message } from 'antd';
|
||||
import { message } from './message';
|
||||
export const query = new QueryClient();
|
||||
query.beforeRequest = async (config) => {
|
||||
if (config.headers) {
|
||||
|
||||
Reference in New Issue
Block a user