Commit 7e89d1e9 authored by 文旺-丰林-DEV's avatar 文旺-丰林-DEV

fixed ui and logo

parent 232e6205
...@@ -12,8 +12,8 @@ const Settings: LayoutSettings & { ...@@ -12,8 +12,8 @@ const Settings: LayoutSettings & {
fixSiderbar: true, fixSiderbar: true,
colorWeak: false, colorWeak: false,
pwa: false, pwa: false,
logo: '/logo.png', logo: 'https://baibaomen.oss-cn-hangzhou.aliyuncs.com/zhensheng/Logo.png',
title: '', title: '长沙振升集团后台系统',
iconfontUrl: '', iconfontUrl: '',
}; };
......
export default [ export default [
{
name: 'chat',
path: '/chat',
component: './Chat',
layout: false,
},
{ {
path: '/welcome', path: '/welcome',
name: 'welcome', name: 'welcome',
...@@ -12,20 +6,11 @@ ...@@ -12,20 +6,11 @@
component: './Welcome', component: './Welcome',
}, },
{ {
path: '/admin', name: 'user',
name: 'admin', path: '/user',
icon: 'crown', icon: 'UserOutlined',
component: './UserManage',
access: 'canAdmin', access: 'canAdmin',
routes: [
{
name: 'user',
path: '/admin/user',
component: './UserManage',
},
{
component: './404',
},
],
}, },
{ {
name: 'prompt', name: 'prompt',
...@@ -33,6 +18,13 @@ ...@@ -33,6 +18,13 @@
path: '/prompt', path: '/prompt',
component: './PromptWord', component: './PromptWord',
}, },
{
name: 'chat',
path: '/chat',
component: './Chat',
icon: 'RobotOutlined',
layout: false,
},
{ {
path: '/', path: '/',
redirect: '/welcome', redirect: '/welcome',
......
...@@ -14,7 +14,6 @@ export const initialStateConfig = { ...@@ -14,7 +14,6 @@ export const initialStateConfig = {
* @see https://umijs.org/zh-CN/plugins/plugin-initial-state * @see https://umijs.org/zh-CN/plugins/plugin-initial-state
* */ * */
export async function getInitialState() { export async function getInitialState() {
const userInfo = JSON.parse(localStorage.getItem('user') || '{}'); const userInfo = JSON.parse(localStorage.getItem('user') || '{}');
...@@ -48,8 +47,8 @@ export const layout = ({ initialState, setInitialState }) => { ...@@ -48,8 +47,8 @@ export const layout = ({ initialState, setInitialState }) => {
enableDarkTheme enableDarkTheme
settings={initialState?.settings} settings={initialState?.settings}
onSettingChange={(settings) => { onSettingChange={(settings) => {
setInitialState((preInitialState) => ({ setInitialState(() => ({
...preInitialState, ...initialState,
settings, settings,
})); }));
}} }}
......
...@@ -21,8 +21,8 @@ const GlobalHeaderRight: React.FC = () => { ...@@ -21,8 +21,8 @@ const GlobalHeaderRight: React.FC = () => {
} }
return ( return (
<Space className={className}> <Space className={className}>
<Avatar /> {/* <Avatar /> */}
<SelectLang className={styles.action} /> {/* <SelectLang className={styles.action} /> */}
</Space> </Space>
); );
}; };
......
...@@ -91,3 +91,9 @@ ol { ...@@ -91,3 +91,9 @@ ol {
background-color: #009b95 !important; background-color: #009b95 !important;
border-radius: 4px; border-radius: 4px;
} }
.ant-pro-sider-logo {
a h1 {
font-size: 12px !important;
}
}
export default { export default {
'menu.chat': 'ChatGLM', 'menu.chat': 'AI助手',
'menu.welcome': '欢迎', 'menu.welcome': '欢迎',
'menu.user': '用户管理',
'menu.more-blocks': '更多区块', 'menu.more-blocks': '更多区块',
'menu.home': '首页', 'menu.home': '首页',
'menu.admin': '账号管理', 'menu.admin': '账号管理',
......
...@@ -6,10 +6,10 @@ const NoFoundPage: React.FC = () => ( ...@@ -6,10 +6,10 @@ const NoFoundPage: React.FC = () => (
<Result <Result
status="404" status="404"
title="404" title="404"
subTitle="Sorry, the page you visited does not exist." subTitle="很抱歉,您访问的页面不存在。"
extra={ extra={
<Button type="primary" onClick={() => history.push('/')}> <Button type="primary" onClick={() => history.push('/')}>
Back Home 返回
</Button> </Button>
} }
/> />
......
import { Row, Col, Grid } from 'antd'; import { Row, Col } from 'antd';
import type { FC } from 'react'; import type { FC } from 'react';
import styles from './content.less'; import styles from './content.less';
import ProductionCard from './productionCard'; import ProductionCard from './productionCard';
import { IPromptWord } from '@/services/chatGLM/api'; import { IPromptWord } from '@/services/chatGLM/api';
const { useBreakpoint } = Grid;
interface ChatFirstContentProps { interface ChatFirstContentProps {
list: IPromptWord[]; list: IPromptWord[];
onChange?: (text: string) => void; onChange?: (text: string) => void;
...@@ -27,12 +25,12 @@ const ChatFirstContent: FC<ChatFirstContentProps> = (props) => { ...@@ -27,12 +25,12 @@ const ChatFirstContent: FC<ChatFirstContentProps> = (props) => {
sm={12} sm={12}
xl={8} xl={8}
xxl={8} xxl={8}
key={`${item.title}-card-${index}`} key={`${item.type}-card-${index}`}
> >
<Row justify={'start'} style={{ marginBottom: 16, minWidth: 306 }}> <Row justify={'start'} style={{ marginBottom: 16, minWidth: 306 }}>
<ProductionCard <ProductionCard
index={index} index={index}
title={item.title} title={item.type}
content={item.content} content={item.content}
onChange={() => { onChange={() => {
onChange && onChange(item.content); onChange && onChange(item.content);
......
import type { ReactNode } from 'react';
import styles from './productionCard.less'; import styles from './productionCard.less';
import classnames from 'classnames'; import classnames from 'classnames';
interface ProductionCardProps { interface ProductionCardProps {
index: number; index: number;
title?: string; title?: string;
content: ReactNode; content: string;
onChange: (content: string) => void; onChange: (content: string) => void;
} }
const ProductionCard = (props: ProductionCardProps) => { const ProductionCard = (props: ProductionCardProps) => {
const { index, title, content, onChange } = props; const { title, content, onChange } = props;
const handleClick = () => { const handleClick = () => {
onChange && onChange(content); onChange && onChange(content);
......
...@@ -4,13 +4,11 @@ import React, { useState, useEffect, useRef, useMemo } from 'react'; ...@@ -4,13 +4,11 @@ import React, { useState, useEffect, useRef, useMemo } from 'react';
import styles from './index.less'; import styles from './index.less';
import ChatFirstContent from './components/content'; import ChatFirstContent from './components/content';
import { import {
FieldTimeOutlined,
LoadingOutlined, LoadingOutlined,
MenuOutlined, MenuOutlined,
PlusOutlined, PlusOutlined,
SettingOutlined, SettingOutlined,
UserOutlined, UserOutlined,
WechatOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import classNames from 'classnames'; import classNames from 'classnames';
import { history } from 'umi'; import { history } from 'umi';
...@@ -81,6 +79,7 @@ const Chat: React.FC = () => { ...@@ -81,6 +79,7 @@ const Chat: React.FC = () => {
messageHistory.current.push({ prompt: chat, answer: '' }); messageHistory.current.push({ prompt: chat, answer: '' });
setLoading(true); setLoading(true);
sendMessage && sendMessage &&
glmToken &&
sendMessage( sendMessage(
JSON.stringify({ JSON.stringify({
prompt: chat, prompt: chat,
...@@ -131,7 +130,7 @@ const Chat: React.FC = () => { ...@@ -131,7 +130,7 @@ const Chat: React.FC = () => {
/> />
</Col> </Col>
<Col>AI改变世界</Col> <Col>AI改变世界</Col>
<Col pull={1}>{/* <FieldTimeOutlined /> */}</Col> <Col pull={1}></Col>
</Row> </Row>
); );
}; };
...@@ -164,7 +163,7 @@ const Chat: React.FC = () => { ...@@ -164,7 +163,7 @@ const Chat: React.FC = () => {
<Space <Space
wrap wrap
onClick={() => { onClick={() => {
history.push('/admin/user'); history.push('/');
}} }}
> >
<SettingOutlined /> <SettingOutlined />
...@@ -203,12 +202,12 @@ const Chat: React.FC = () => { ...@@ -203,12 +202,12 @@ const Chat: React.FC = () => {
<Row> <Row>
<Col span={24}> <Col span={24}>
<Title level={2} style={{ marginBottom: 8, fontSize: 32 }}> <Title level={2} style={{ marginBottom: 8, fontSize: 32 }}>
产品名称 长沙振升集团
</Title> </Title>
</Col> </Col>
<Col span={24}> <Col span={24}>
<Title level={5} className={styles.subTitle}> <Title level={5} className={styles.subTitle}>
AI改变世界 AI智能小助手
</Title> </Title>
</Col> </Col>
</Row> </Row>
......
...@@ -10,19 +10,7 @@ import { PlusOutlined } from '@ant-design/icons'; ...@@ -10,19 +10,7 @@ import { PlusOutlined } from '@ant-design/icons';
import type { ActionType } from '@ant-design/pro-components'; import type { ActionType } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-components'; import { PageContainer } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
import { import { Button, Col, Divider, Form, Input, Modal, Radio, Row, Switch, message } from 'antd';
Button,
Col,
Divider,
Form,
Input,
Modal,
Radio,
Row,
Select,
Switch,
message,
} from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import { useRef, useState } from 'react'; import { useRef, useState } from 'react';
......
...@@ -5,8 +5,6 @@ import { FormattedMessage, useIntl } from 'umi'; ...@@ -5,8 +5,6 @@ import { FormattedMessage, useIntl } from 'umi';
const { Content } = Layout; const { Content } = Layout;
const Welcome: React.FC = () => { const Welcome: React.FC = () => {
const intl = useIntl();
return ( return (
<Layout> <Layout>
<Content>欢迎进入后台管理页面</Content> <Content>欢迎进入后台管理页面</Content>
......
...@@ -42,7 +42,7 @@ export function loginChatGLM(options: ILoginParams) { ...@@ -42,7 +42,7 @@ export function loginChatGLM(options: ILoginParams) {
} }
export interface IPromptWord { export interface IPromptWord {
title: string; type: string;
content: string; content: string;
} }
export function GetChatGLMToken(): Promise<string> { export function GetChatGLMToken(): Promise<string> {
...@@ -106,7 +106,7 @@ export const postResetUser = (params?: any): Promise<string> => { ...@@ -106,7 +106,7 @@ export const postResetUser = (params?: any): Promise<string> => {
}); });
}; };
export const postEditUser = (params?: any): Promise<string> => { export const postEditUser = (params?: any): Promise<string> => {
return request('https://glm-mangement-api.baibaomen.com/User/update', { return request('https://glm-mangement-api.baibaomen.com/User/update', {
method: 'POST', method: 'POST',
body: JSON.stringify(params), body: JSON.stringify(params),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment