mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Make the app name configurable even after the project is built (#731)
### What problem does this PR solve? Make the app name configurable even after the project is built #730 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -3,7 +3,8 @@ import { Pagination } from '@/interfaces/common';
|
||||
import { IKnowledgeFile } from '@/interfaces/database/knowledge';
|
||||
import { IChangeParserConfigRequestBody } from '@/interfaces/request/document';
|
||||
import { PaginationProps } from 'antd';
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
import axios from 'axios';
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDispatch } from 'umi';
|
||||
import { useSetModalState, useTranslate } from './commonHooks';
|
||||
@ -113,3 +114,22 @@ export const useSetPagination = (namespace: string) => {
|
||||
|
||||
return setPagination;
|
||||
};
|
||||
|
||||
export interface AppConf {
|
||||
appName: string;
|
||||
}
|
||||
|
||||
export const useFetchAppConf = () => {
|
||||
const [appConf, setAppConf] = useState<AppConf>({} as AppConf);
|
||||
const fetchAppConf = useCallback(async () => {
|
||||
const ret = await axios.get('/conf.json');
|
||||
|
||||
setAppConf(ret.data);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
fetchAppConf();
|
||||
}, [fetchAppConf]);
|
||||
|
||||
return appConf;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user