Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chatGLM
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘坚-丰林-DEV
chatGLM
Commits
7e89d1e9
Commit
7e89d1e9
authored
Apr 17, 2023
by
文旺-丰林-DEV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ui and logo
parent
232e6205
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
40 additions
and
60 deletions
+40
-60
defaultSettings.ts
config/defaultSettings.ts
+2
-2
routes.ts
config/routes.ts
+11
-19
app.tsx
src/app.tsx
+2
-3
index.tsx
src/components/RightContent/index.tsx
+2
-2
global.less
src/global.less
+6
-0
menu.ts
src/locales/zh-CN/menu.ts
+2
-1
404.tsx
src/pages/404.tsx
+2
-2
content.tsx
src/pages/Chat/components/content.tsx
+3
-5
productionCard.tsx
src/pages/Chat/components/productionCard.tsx
+2
-3
index.tsx
src/pages/Chat/index.tsx
+5
-6
index.tsx
src/pages/UserManage/index.tsx
+1
-13
Welcome.tsx
src/pages/Welcome.tsx
+0
-2
api.ts
src/services/chatGLM/api.ts
+2
-2
No files found.
config/defaultSettings.ts
View file @
7e89d1e9
...
...
@@ -12,8 +12,8 @@ const Settings: LayoutSettings & {
fixSiderbar
:
true
,
colorWeak
:
false
,
pwa
:
false
,
logo
:
'
/l
ogo.png'
,
title
:
''
,
logo
:
'
https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/L
ogo.png'
,
title
:
'
长沙振升集团后台系统
'
,
iconfontUrl
:
''
,
};
...
...
config/routes.ts
View file @
7e89d1e9
export
default
[
{
name
:
'chat'
,
path
:
'/chat'
,
component
:
'./Chat'
,
layout
:
false
,
},
{
path
:
'/welcome'
,
name
:
'welcome'
,
icon
:
'smile'
,
component
:
'./Welcome'
,
},
{
path
:
'/admin'
,
name
:
'admin'
,
icon
:
'crown'
,
access
:
'canAdmin'
,
routes
:
[
{
name
:
'user'
,
path
:
'/admin/user'
,
path
:
'/user'
,
icon
:
'UserOutlined'
,
component
:
'./UserManage'
,
},
{
component
:
'./404'
,
},
],
access
:
'canAdmin'
,
},
{
name
:
'prompt'
,
...
...
@@ -33,6 +18,13 @@
path
:
'/prompt'
,
component
:
'./PromptWord'
,
},
{
name
:
'chat'
,
path
:
'/chat'
,
component
:
'./Chat'
,
icon
:
'RobotOutlined'
,
layout
:
false
,
},
{
path
:
'/'
,
redirect
:
'/welcome'
,
...
...
src/app.tsx
View file @
7e89d1e9
...
...
@@ -14,7 +14,6 @@ export const initialStateConfig = {
* @see https://umijs.org/zh-CN/plugins/plugin-initial-state
* */
export
async
function
getInitialState
()
{
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'user'
)
||
'{}'
);
...
...
@@ -48,8 +47,8 @@ export const layout = ({ initialState, setInitialState }) => {
enableDarkTheme
settings=
{
initialState
?.
settings
}
onSettingChange=
{
(
settings
)
=>
{
setInitialState
((
preInitialState
)
=>
({
...
preI
nitialState
,
setInitialState
(()
=>
({
...
i
nitialState
,
settings
,
}));
}
}
...
...
src/components/RightContent/index.tsx
View file @
7e89d1e9
...
...
@@ -21,8 +21,8 @@ const GlobalHeaderRight: React.FC = () => {
}
return
(
<
Space
className=
{
className
}
>
<
Avatar
/>
<
SelectLang
className=
{
styles
.
action
}
/>
{
/* <Avatar /> */
}
{
/* <SelectLang className={styles.action} /> */
}
</
Space
>
);
};
...
...
src/global.less
View file @
7e89d1e9
...
...
@@ -91,3 +91,9 @@ ol {
background-color: #009b95 !important;
border-radius: 4px;
}
.ant-pro-sider-logo {
a h1 {
font-size: 12px !important;
}
}
src/locales/zh-CN/menu.ts
View file @
7e89d1e9
export
default
{
'menu.chat'
:
'
ChatGLM
'
,
'menu.chat'
:
'
AI助手
'
,
'menu.welcome'
:
'欢迎'
,
'menu.user'
:
'用户管理'
,
'menu.more-blocks'
:
'更多区块'
,
'menu.home'
:
'首页'
,
'menu.admin'
:
'账号管理'
,
...
...
src/pages/404.tsx
View file @
7e89d1e9
...
...
@@ -6,10 +6,10 @@ const NoFoundPage: React.FC = () => (
<
Result
status=
"404"
title=
"404"
subTitle=
"
Sorry, the page you visited does not exist.
"
subTitle=
"
很抱歉,您访问的页面不存在。
"
extra=
{
<
Button
type=
"primary"
onClick=
{
()
=>
history
.
push
(
'/'
)
}
>
Back Home
返回
</
Button
>
}
/>
...
...
src/pages/Chat/components/content.tsx
View file @
7e89d1e9
import
{
Row
,
Col
,
Grid
}
from
'antd'
;
import
{
Row
,
Col
}
from
'antd'
;
import
type
{
FC
}
from
'react'
;
import
styles
from
'./content.less'
;
import
ProductionCard
from
'./productionCard'
;
import
{
IPromptWord
}
from
'@/services/chatGLM/api'
;
const
{
useBreakpoint
}
=
Grid
;
interface
ChatFirstContentProps
{
list
:
IPromptWord
[];
onChange
?:
(
text
:
string
)
=>
void
;
...
...
@@ -27,12 +25,12 @@ const ChatFirstContent: FC<ChatFirstContentProps> = (props) => {
sm=
{
12
}
xl=
{
8
}
xxl=
{
8
}
key=
{
`${item.t
itl
e}-card-${index}`
}
key=
{
`${item.t
yp
e}-card-${index}`
}
>
<
Row
justify=
{
'start'
}
style=
{
{
marginBottom
:
16
,
minWidth
:
306
}
}
>
<
ProductionCard
index=
{
index
}
title=
{
item
.
t
itl
e
}
title=
{
item
.
t
yp
e
}
content=
{
item
.
content
}
onChange=
{
()
=>
{
onChange
&&
onChange
(
item
.
content
);
...
...
src/pages/Chat/components/productionCard.tsx
View file @
7e89d1e9
import
type
{
ReactNode
}
from
'react'
;
import
styles
from
'./productionCard.less'
;
import
classnames
from
'classnames'
;
interface
ProductionCardProps
{
index
:
number
;
title
?:
string
;
content
:
ReactNode
;
content
:
string
;
onChange
:
(
content
:
string
)
=>
void
;
}
const
ProductionCard
=
(
props
:
ProductionCardProps
)
=>
{
const
{
index
,
title
,
content
,
onChange
}
=
props
;
const
{
title
,
content
,
onChange
}
=
props
;
const
handleClick
=
()
=>
{
onChange
&&
onChange
(
content
);
...
...
src/pages/Chat/index.tsx
View file @
7e89d1e9
...
...
@@ -4,13 +4,11 @@ import React, { useState, useEffect, useRef, useMemo } from 'react';
import
styles
from
'./index.less'
;
import
ChatFirstContent
from
'./components/content'
;
import
{
FieldTimeOutlined
,
LoadingOutlined
,
MenuOutlined
,
PlusOutlined
,
SettingOutlined
,
UserOutlined
,
WechatOutlined
,
}
from
'@ant-design/icons'
;
import
classNames
from
'classnames'
;
import
{
history
}
from
'umi'
;
...
...
@@ -81,6 +79,7 @@ const Chat: React.FC = () => {
messageHistory
.
current
.
push
({
prompt
:
chat
,
answer
:
''
});
setLoading
(
true
);
sendMessage
&&
glmToken
&&
sendMessage
(
JSON
.
stringify
({
prompt
:
chat
,
...
...
@@ -131,7 +130,7 @@ const Chat: React.FC = () => {
/>
</
Col
>
<
Col
>
AI改变世界
</
Col
>
<
Col
pull=
{
1
}
>
{
/* <FieldTimeOutlined /> */
}
</
Col
>
<
Col
pull=
{
1
}
></
Col
>
</
Row
>
);
};
...
...
@@ -164,7 +163,7 @@ const Chat: React.FC = () => {
<
Space
wrap
onClick=
{
()
=>
{
history
.
push
(
'/
admin/user
'
);
history
.
push
(
'/'
);
}
}
>
<
SettingOutlined
/>
...
...
@@ -203,12 +202,12 @@ const Chat: React.FC = () => {
<
Row
>
<
Col
span=
{
24
}
>
<
Title
level=
{
2
}
style=
{
{
marginBottom
:
8
,
fontSize
:
32
}
}
>
产品名称
长沙振升集团
</
Title
>
</
Col
>
<
Col
span=
{
24
}
>
<
Title
level=
{
5
}
className=
{
styles
.
subTitle
}
>
AI
改变世界
AI
智能小助手
</
Title
>
</
Col
>
</
Row
>
...
...
src/pages/UserManage/index.tsx
View file @
7e89d1e9
...
...
@@ -10,19 +10,7 @@ import { PlusOutlined } from '@ant-design/icons';
import
type
{
ActionType
}
from
'@ant-design/pro-components'
;
import
{
PageContainer
}
from
'@ant-design/pro-components'
;
import
{
ProTable
}
from
'@ant-design/pro-components'
;
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
Modal
,
Radio
,
Row
,
Select
,
Switch
,
message
,
}
from
'antd'
;
import
{
Button
,
Col
,
Divider
,
Form
,
Input
,
Modal
,
Radio
,
Row
,
Switch
,
message
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
isEmpty
}
from
'lodash'
;
import
{
useRef
,
useState
}
from
'react'
;
...
...
src/pages/Welcome.tsx
View file @
7e89d1e9
...
...
@@ -5,8 +5,6 @@ import { FormattedMessage, useIntl } from 'umi';
const
{
Content
}
=
Layout
;
const
Welcome
:
React
.
FC
=
()
=>
{
const
intl
=
useIntl
();
return
(
<
Layout
>
<
Content
>
欢迎进入后台管理页面
</
Content
>
...
...
src/services/chatGLM/api.ts
View file @
7e89d1e9
...
...
@@ -42,7 +42,7 @@ export function loginChatGLM(options: ILoginParams) {
}
export
interface
IPromptWord
{
t
itl
e
:
string
;
t
yp
e
:
string
;
content
:
string
;
}
export
function
GetChatGLMToken
():
Promise
<
string
>
{
...
...
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