mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 05:19:51 +00:00
perf: init db and config
This commit is contained in:
@@ -90,7 +90,8 @@ const defaultVectorModels = [
|
||||
|
||||
export async function getInitConfig() {
|
||||
try {
|
||||
const res = JSON.parse(readFileSync('data/config.json', 'utf-8'));
|
||||
const filename = process.env.NODE_ENV === 'development' ? 'config.json.local' : 'config.json';
|
||||
const res = JSON.parse(readFileSync(`data/${filename}`, 'utf-8'));
|
||||
console.log(res);
|
||||
|
||||
global.systemEnv = res.SystemParams || defaultSystemEnv;
|
||||
|
@@ -60,15 +60,10 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
<form onSubmit={handleSubmit(onclickLogin)}>
|
||||
<FormControl mt={8} isInvalid={!!errors.username}>
|
||||
<Input
|
||||
placeholder="邮箱/手机号"
|
||||
placeholder="邮箱/手机号/用户名"
|
||||
size={['md', 'lg']}
|
||||
{...register('username', {
|
||||
required: '邮箱/手机号不能为空',
|
||||
pattern: {
|
||||
value:
|
||||
/(^1[3456789]\d{9}$)|(^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$)/,
|
||||
message: '邮箱/手机号格式错误'
|
||||
}
|
||||
required: '邮箱/手机号/用户名不能为空'
|
||||
})}
|
||||
></Input>
|
||||
<FormErrorMessage position={'absolute'} fontSize="xs">
|
||||
@@ -82,13 +77,9 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
placeholder="密码"
|
||||
{...register('password', {
|
||||
required: '密码不能为空',
|
||||
minLength: {
|
||||
value: 4,
|
||||
message: '密码最少4位最多12位'
|
||||
},
|
||||
maxLength: {
|
||||
value: 12,
|
||||
message: '密码最少4位最多12位'
|
||||
message: '密码最多12位'
|
||||
}
|
||||
})}
|
||||
></Input>
|
||||
|
@@ -65,7 +65,7 @@ const RegisterForm = ({ setPageType, loginSuccess }: Props) => {
|
||||
title: `注册成功`,
|
||||
status: 'success'
|
||||
});
|
||||
// aut register a model
|
||||
// auto register template app
|
||||
appTemplates.forEach((template) => {
|
||||
postCreateApp({
|
||||
avatar: template.avatar,
|
||||
|
Reference in New Issue
Block a user