feat(web): Unified frontend code style (#1923)

Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
Co-authored-by: 谨欣 <echo.cmy@antgroup.com>
Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com>
Co-authored-by: yanzhiyong <932374019@qq.com>
This commit is contained in:
Dreammy23
2024-08-30 14:03:06 +08:00
committed by GitHub
parent f866580703
commit 471689ba20
247 changed files with 4960 additions and 4546 deletions

View File

@@ -1,11 +1,11 @@
import { apiInterceptors, getDialogueList, getUsableModels, queryAdminList } from '@/client/api';
import { apiInterceptors, getUsableModels, queryAdminList } from '@/client/api';
import { ChatHistoryResponse, DialogueListResponse, IChatDialogueSchema } from '@/types/chat';
import { UserInfoResponse } from '@/types/userinfo';
import { getUserId } from '@/utils';
import { STORAGE_THEME_KEY } from '@/utils/constants/index';
import { useRequest } from 'ahooks';
import { useSearchParams } from 'next/navigation';
import { createContext, useEffect, useMemo, useState } from 'react';
import { createContext, useEffect, useState } from 'react';
type ThemeMode = 'dark' | 'light';
@@ -109,7 +109,7 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
return res ?? [];
},
{
onSuccess: (data) => {
onSuccess: data => {
setAdminList(data);
},
manual: true,
@@ -120,7 +120,7 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
if (getUserId()) {
queryAdminListRun();
}
// eslint-disable-next-line react-hooks/exhaustive-deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [queryAdminListRun, getUserId()]);
useEffect(() => {
@@ -128,7 +128,7 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
try {
const dialogInfo = JSON.parse(localStorage.getItem('cur_dialog_info') || '');
setCurrentDialogInfo(dialogInfo);
} catch (error) {
} catch {
setCurrentDialogInfo({
chat_scene: '',
app_code: '',