feat: generate select options for SystemModelSettingModal grouped by type and add llm icon and add upgrade button to UserSettingTeam and replace the icon in the sidebar of the user settings page (#128)

* feat: generate select options for SystemModelSettingModal grouped by type

* feat: add llm icon

* feat: add upgrade button to UserSettingTeam

* feat: replace the icon in the sidebar of the user settings page
This commit is contained in:
balibabu
2024-03-18 16:45:01 +08:00
committed by GitHub
parent a0f1e1fa95
commit 0e2aff2a48
22 changed files with 287 additions and 112 deletions

View File

@@ -1,7 +1,8 @@
import { ITenantInfo } from '@/interfaces/database/knowledge';
import { IUserInfo } from '@/interfaces/database/userSetting';
import authorizationUtil from '@/utils/authorizationUtil';
import { useCallback, useEffect, useMemo } from 'react';
import { useDispatch, useSelector } from 'umi';
import { history, useDispatch, useSelector } from 'umi';
export const useFetchUserInfo = () => {
const dispatch = useDispatch();
@@ -68,8 +69,12 @@ export const useSelectParserList = (): Array<{
export const useLogout = () => {
const dispatch = useDispatch(); // TODO: clear redux state
const logout = useCallback((): number => {
return dispatch<any>({ type: 'loginModel/logout' });
const logout = useCallback(async () => {
const retcode = await dispatch<any>({ type: 'loginModel/logout' });
if (retcode === 0) {
authorizationUtil.removeAll();
history.push('/login');
}
}, [dispatch]);
return logout;