default config

This commit is contained in:
archer
2023-08-04 14:00:50 +08:00
parent 94a241bbb1
commit 6f37d7b460
5 changed files with 20 additions and 23 deletions

View File

@@ -1,18 +1,15 @@
{
"FeConfig": {
"show_emptyChat": true,
"show_register": true,
"show_register": false,
"show_appStore": false,
"show_userDetail": true,
"show_userDetail": false,
"show_git": true,
"systemTitle": "FastAI",
"authorText": "Made by FastAI Team."
},
"SystemParams": {
"beianText": "",
"baiduTongji": "",
"googleClientVerKey": "",
"googleServiceVerKey": "",
"vectorMaxProcess": 15,
"qaMaxProcess": 15,
"pgIvfflatProbe": 20,

View File

@@ -39,9 +39,9 @@ const defaultSystemEnv = {
};
const defaultFeConfigs = {
show_emptyChat: true,
show_register: true,
show_register: false,
show_appStore: false,
show_userDetail: true,
show_userDetail: false,
show_git: true,
systemTitle: 'FastAI',
authorText: 'Made by FastAI Team.'
@@ -90,8 +90,9 @@ const defaultVectorModels = [
export async function getInitConfig() {
try {
const filename = process.env.NODE_ENV === 'development' ? 'config.json.local' : 'config.json';
const res = JSON.parse(readFileSync(`data/${filename}`, 'utf-8'));
const filename =
process.env.NODE_ENV === 'development' ? 'data/config.json.local' : '/app/data/config.json';
const res = JSON.parse(readFileSync(filename, 'utf-8'));
console.log(res);
global.systemEnv = res.SystemParams || defaultSystemEnv;

View File

@@ -1,4 +1,3 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next';
import { jsonRes } from '@/service/response';
import { AuthCode } from '@/service/models/authCode';

View File

@@ -23,7 +23,7 @@ const SliderApps = ({ appId }: { appId: string }) => {
px={3}
borderRadius={'md'}
_hover={{ bg: 'myGray.200' }}
onClick={() => router.back()}
onClick={() => router.push('/app/list')}
>
<IconButton
mr={3}

View File

@@ -87,16 +87,16 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
{!!errors.password && errors.password.message}
</FormErrorMessage>
</FormControl>
<Flex align={'center'} justifyContent={'space-between'} mt={6} color={'myBlue.600'}>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('forgetPassword')}
fontSize="sm"
>
?
</Box>
{feConfigs?.show_register && (
{feConfigs?.show_register && (
<Flex align={'center'} justifyContent={'space-between'} mt={6} color={'myBlue.600'}>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('forgetPassword')}
fontSize="sm"
>
?
</Box>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
@@ -105,8 +105,8 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
>
</Box>
)}
</Flex>
</Flex>
)}
<Button
type="submit"
mt={8}