Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
31663761
authored
Jun 20, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: template
parent
a02a5287
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
37 deletions
+12
-37
client/.env.template
+2
-1
client/src/pages/_app.tsx
+2
-2
client/src/pages/api/system/getInitData.ts
+3
-1
client/src/store/global.ts
+2
-1
docs/dev/.env.template
+0
-32
docs/dev/README.md
+3
-0
No files found.
client/.env.template
View file @
31663761
# 运行端口,如果不是 3000 口运行,需要改成其他的。注意:不是改了这个变量就会变成其他端口,而是因为改成其他端口,才用这个变量。
# 运行端口,如果不是 3000 口运行,需要改成其他的。注意:不是改了这个变量就会变成其他端口,而是因为改成其他端口,才用这个变量。
DB_MAX_LINK=15 # database max link
PORT=3000
PORT=3000
# database max link
DB_MAX_LINK=15
# 代理
# 代理
# AXIOS_PROXY_HOST=127.0.0.1
# AXIOS_PROXY_HOST=127.0.0.1
# AXIOS_PROXY_PORT=7890
# AXIOS_PROXY_PORT=7890
...
...
client/src/pages/_app.tsx
View file @
31663761
...
@@ -31,7 +31,7 @@ const queryClient = new QueryClient({
...
@@ -31,7 +31,7 @@ const queryClient = new QueryClient({
function
App
({
Component
,
pageProps
}:
AppProps
)
{
function
App
({
Component
,
pageProps
}:
AppProps
)
{
const
{
const
{
loadInitData
,
loadInitData
,
initData
:
{
googleVerKey
}
initData
:
{
googleVerKey
,
baiduTongji
}
}
=
useGlobalStore
();
}
=
useGlobalStore
();
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -52,7 +52,7 @@ function App({ Component, pageProps }: AppProps) {
...
@@ -52,7 +52,7 @@ function App({ Component, pageProps }: AppProps) {
<
Script
src=
"/js/qrcode.min.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/qrcode.min.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/pdf.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/pdf.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/html2pdf.bundle.min.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/html2pdf.bundle.min.js"
strategy=
"afterInteractive"
></
Script
>
<
Script
src=
"/js/baidutongji.js"
strategy=
"afterInteractive"
></
Script
>
{
baiduTongji
&&
<
Script
src=
"/js/baidutongji.js"
strategy=
"afterInteractive"
></
Script
>
}
{
googleVerKey
&&
(
{
googleVerKey
&&
(
<>
<>
<
Script
<
Script
...
...
client/src/pages/api/system/getInitData.ts
View file @
31663761
...
@@ -5,13 +5,15 @@ import { jsonRes } from '@/service/response';
...
@@ -5,13 +5,15 @@ import { jsonRes } from '@/service/response';
export
type
InitDateResponse
=
{
export
type
InitDateResponse
=
{
beianText
:
string
;
beianText
:
string
;
googleVerKey
:
string
;
googleVerKey
:
string
;
baiduTongji
:
boolean
;
};
};
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
jsonRes
<
InitDateResponse
>
(
res
,
{
jsonRes
<
InitDateResponse
>
(
res
,
{
data
:
{
data
:
{
beianText
:
process
.
env
.
SAFE_BEIAN_TEXT
||
''
,
beianText
:
process
.
env
.
SAFE_BEIAN_TEXT
||
''
,
googleVerKey
:
process
.
env
.
CLIENT_GOOGLE_VER_TOKEN
||
''
googleVerKey
:
process
.
env
.
CLIENT_GOOGLE_VER_TOKEN
||
''
,
baiduTongji
:
process
.
env
.
BAIDU_TONGJI
===
'1'
}
}
});
});
}
}
client/src/store/global.ts
View file @
31663761
...
@@ -19,7 +19,8 @@ export const useGlobalStore = create<State>()(
...
@@ -19,7 +19,8 @@ export const useGlobalStore = create<State>()(
immer
((
set
,
get
)
=>
({
immer
((
set
,
get
)
=>
({
initData
:
{
initData
:
{
beianText
:
''
,
beianText
:
''
,
googleVerKey
:
''
googleVerKey
:
''
,
baiduTongji
:
false
},
},
async
loadInitData
()
{
async
loadInitData
()
{
try
{
try
{
...
...
docs/dev/.env.template
deleted
100644 → 0
View file @
a02a5287
# 运行端口,如果不是 3000 口运行,需要改成其他的。注意:不是改了这个变量就会变成其他端口,而是因为改成其他端口,才用这个变量。
PORT=3000
# 代理
# AXIOS_PROXY_HOST=127.0.0.1
# AXIOS_PROXY_PORT=7890
# email
MY_MAIL=xxxx@qq.com
MAILE_CODE=xxxx
# ali ems
aliAccessKeyId=xxxx
aliAccessKeySecret=xxxx
aliSignName=xxxx
aliTemplateCode=xxxx
# token
TOKEN_KEY=dfdasfdas
# root key, 最高权限
ROOT_KEY=fdafasd
# openai
# OPENAI_BASE_URL=http://ai.openai.com/v1
# OPENAI_BASE_URL_AUTH=可选安全凭证,会放到 header.auth 里
OPENAIKEY=sk-xxx
OPENAI_TRAINING_KEY=sk-xxx
GPT4KEY=sk-xxx
# db
MONGODB_URI=mongodb://username:password@0.0.0.0:27017/?authSource=admin
MONGODB_NAME=fastgpt
PG_HOST=0.0.0.0
PG_PORT=8100
PG_USER=root
PG_PASSWORD=psw
PG_DB_NAME=dbname
\ No newline at end of file
docs/dev/README.md
View file @
31663761
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
第一次开发,请先
[
部署教程
](
../deploy/docker.md
)
,需要部署数据库.
第一次开发,请先
[
部署教程
](
../deploy/docker.md
)
,需要部署数据库.
client: FastGpt 网页项目
admin: 管理端
## 环境变量配置 (可能更新不及时,以 docker-compose 里的变量为准)
## 环境变量配置 (可能更新不及时,以 docker-compose 里的变量为准)
复制.env.template 文件,生成一个.env.local 环境变量文件夹,修改.env.local 里内容。
复制.env.template 文件,生成一个.env.local 环境变量文件夹,修改.env.local 里内容。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment