diff --git a/react-ui/config/config.ts b/react-ui/config/config.ts index 04ab330d..f64c8c77 100644 --- a/react-ui/config/config.ts +++ b/react-ui/config/config.ts @@ -75,7 +75,7 @@ export default defineConfig({ * @name layout 插件 * @doc https://umijs.org/docs/max/layout-menu */ - title: '智能材料科研平台', + title: '复杂智能软件', layout: { ...defaultSettings, }, diff --git a/react-ui/config/defaultSettings.ts b/react-ui/config/defaultSettings.ts index c4c59d2f..306c89db 100644 --- a/react-ui/config/defaultSettings.ts +++ b/react-ui/config/defaultSettings.ts @@ -17,7 +17,7 @@ const Settings: ProLayoutProps & { fixSiderbar: false, splitMenus: false, colorWeak: false, - title: '智能材料科研平台', + title: '复杂智能软件', pwa: true, token: { // 参见ts声明,demo 见文档,通过token 修改样式 diff --git a/react-ui/config/routes.ts b/react-ui/config/routes.ts index 578d2474..eaddb001 100644 --- a/react-ui/config/routes.ts +++ b/react-ui/config/routes.ts @@ -44,7 +44,7 @@ export default [ { name: 'login', path: '/user/login', - component: './User/Login', + component: './User/Login/login', }, ], }, diff --git a/react-ui/public/CNAME b/react-ui/public/CNAME deleted file mode 100644 index 30c2d4d3..00000000 --- a/react-ui/public/CNAME +++ /dev/null @@ -1 +0,0 @@ -preview.pro.ant.design \ No newline at end of file diff --git a/react-ui/public/favicon-cl.ico b/react-ui/public/favicon-cl.ico new file mode 100644 index 00000000..408b8a23 Binary files /dev/null and b/react-ui/public/favicon-cl.ico differ diff --git a/react-ui/public/favicon.ico b/react-ui/public/favicon.ico index 408b8a23..4d544cb1 100644 Binary files a/react-ui/public/favicon.ico and b/react-ui/public/favicon.ico differ diff --git a/react-ui/public/logo.svg b/react-ui/public/logo.svg deleted file mode 100644 index 239bf69f..00000000 --- a/react-ui/public/logo.svg +++ /dev/null @@ -1 +0,0 @@ -Group 28 Copy 5Created with Sketch. \ No newline at end of file diff --git a/react-ui/public/pro_icon.svg b/react-ui/public/pro_icon.svg deleted file mode 100644 index e075b78d..00000000 --- a/react-ui/public/pro_icon.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/react-ui/src/assets/img/logo-cl.png b/react-ui/src/assets/img/logo-cl.png new file mode 100644 index 00000000..e2fbcfe5 Binary files /dev/null and b/react-ui/src/assets/img/logo-cl.png differ diff --git a/react-ui/src/assets/img/logo.png b/react-ui/src/assets/img/logo.png index e2fbcfe5..cae91fe5 100644 Binary files a/react-ui/src/assets/img/logo.png and b/react-ui/src/assets/img/logo.png differ diff --git a/react-ui/src/components/IFramePage/index.tsx b/react-ui/src/components/IFramePage/index.tsx index fab32ab2..9cce1a3b 100644 --- a/react-ui/src/components/IFramePage/index.tsx +++ b/react-ui/src/components/IFramePage/index.tsx @@ -1,6 +1,6 @@ import FullScreenFrame from '@/components/FullScreenFrame'; import KFSpin from '@/components/KFSpin'; -import { getLabelStudioUrl } from '@/services/developmentEnvironment'; +// import { getLabelStudioUrl } from '@/services/developmentEnvironment'; import { to } from '@/utils/promise'; import SessionStorage from '@/utils/sessionStorage'; import classNames from 'classnames'; @@ -18,7 +18,7 @@ export enum IframePageType { const getRequestAPI = (type: IframePageType): (() => Promise) => { switch (type) { case IframePageType.DatasetAnnotation: - return getLabelStudioUrl; + return () => Promise.resolve({ code: 200, data: 'http://172.20.32.181:18888/oauth/login' }); //getLabelStudioUrl; case IframePageType.AppDevelopment: return () => Promise.resolve({ code: 200, data: 'http://172.20.32.185:30080/' }); case IframePageType.DevEnv: diff --git a/react-ui/src/components/RightContent/AvatarDropdown.tsx b/react-ui/src/components/RightContent/AvatarDropdown.tsx index d93d4f74..9efc837a 100644 --- a/react-ui/src/components/RightContent/AvatarDropdown.tsx +++ b/react-ui/src/components/RightContent/AvatarDropdown.tsx @@ -1,8 +1,6 @@ import { clearSessionToken } from '@/access'; import { setRemoteMenu } from '@/services/session'; import { logout } from '@/services/system/auth'; -import { ClientInfo } from '@/types'; -import SessionStorage from '@/utils/sessionStorage'; import { gotoLoginPage } from '@/utils/ui'; import { LogoutOutlined, UserOutlined } from '@ant-design/icons'; import { setAlpha } from '@ant-design/pro-components'; @@ -66,11 +64,11 @@ const AvatarDropdown: React.FC = ({ menu }) => { clearSessionToken(); setRemoteMenu(null); gotoLoginPage(); - const clientInfo: ClientInfo = SessionStorage.getItem(SessionStorage.clientInfoKey, true); - if (clientInfo) { - const { logoutUri } = clientInfo; - location.replace(logoutUri); - } + // const clientInfo: ClientInfo = SessionStorage.getItem(SessionStorage.clientInfoKey, true); + // if (clientInfo) { + // const { logoutUri } = clientInfo; + // location.replace(logoutUri); + // } }; const actionClassName = useEmotionCss(({ token }) => { return { diff --git a/react-ui/src/pages/User/Login/index.tsx b/react-ui/src/pages/User/Login/index.tsx index 86d56ff6..e2df0693 100644 --- a/react-ui/src/pages/User/Login/index.tsx +++ b/react-ui/src/pages/User/Login/index.tsx @@ -1,57 +1,15 @@ -import { clearSessionToken, setSessionToken } from '@/access'; import { getClientInfoReq } from '@/services/auth'; -import { getCaptchaImg, login } from '@/services/system/auth'; -import LocalStorage from '@/utils/localStorage'; import { to } from '@/utils/promise'; import SessionStorage from '@/utils/sessionStorage'; import { gotoOAuth2 } from '@/utils/ui'; -import { history, useModel } from '@umijs/max'; -import { Form, message, type InputRef } from 'antd'; -import CryptoJS from 'crypto-js'; -import { useEffect, useRef, useState } from 'react'; -import { flushSync } from 'react-dom'; +import { useEffect } from 'react'; import styles from './login.less'; -const VERSION = 1; -const AESKEY = 'OPENSOURCETECHNOLOGYCENTER'; - -const LoginInputPrefix = ({ icon }: { icon: string }) => { - return ( -
- -
-
- ); -}; - const Login = () => { - const { initialState, setInitialState } = useModel('@@initialState'); - const [captchaCode, setCaptchaCode] = useState(''); - const [uuid, setUuid] = useState(''); - const [form] = Form.useForm(); - const captchaInputRef = useRef(null); - useEffect(() => { - // getCaptchaCode(); - // const autoLogin = LocalStorage.getItem(LocalStorage.rememberPasswordKey) ?? 'false'; - // if (autoLogin === 'true') { - // const userStorage = LocalStorage.getItem(LocalStorage.loginUserKey); - // const userJson = safeInvoke((text: string) => - // CryptoJS.AES.decrypt(text, AESKEY).toString(CryptoJS.enc.Utf8), - // )(userStorage); - // const user = safeInvoke(parseJsonText)(userJson); - // if (user && typeof user === 'object' && user.version === VERSION) { - // const { username, password } = user; - // form.setFieldsValue({ username: username, password: password, autoLogin: true }); - // } else { - // form.setFieldsValue({ username: '', password: '', autoLogin: true }); - // LocalStorage.removeItem(LocalStorage.loginUserKey); - // } - // } else { - // form.setFieldsValue({ username: '', password: '', autoLogin: false }); - // } getClientInfo(); }, []); + const getClientInfo = async () => { const [res] = await to(getClientInfoReq()); if (res && res.data) { @@ -61,180 +19,7 @@ const Login = () => { } }; - const getCaptchaCode = async () => { - const [res] = await to(getCaptchaImg()); - if (res) { - const imgdata = `data:image/png;base64,${res.img}`; - setCaptchaCode(imgdata); - setUuid(res.uuid); - } - }; - - const fetchUserInfo = async () => { - const userInfo = await initialState?.fetchUserInfo?.(); - if (userInfo) { - flushSync(() => { - setInitialState((s) => ({ - ...s, - currentUser: userInfo, - })); - }); - } - }; - - const handleSubmit2 = async (values: API.LoginParams) => { - const url = - 'http://172.20.32.106:8080/oauth/authorize?client_id=ci4s&response_type=code&grant_type=authorization_code'; - window.location.href = url; - }; - - // 登录 - const handleSubmit = async (values: API.LoginParams) => { - const [res, error] = await to(login({ ...values, uuid })); - if (res && res.data) { - const current = new Date(); - const expireTime = current.setTime(current.getTime() + 1000 * 12 * 60 * 60); - const { access_token } = res.data; - setSessionToken(access_token, access_token, expireTime); - message.success('登录成功!'); - - LocalStorage.setItem(LocalStorage.rememberPasswordKey, values.autoLogin ? 'true' : 'false'); - if (values.autoLogin) { - const user = { - username: values.username, - password: values.password, - version: VERSION, - }; - const encrypted = CryptoJS.AES.encrypt(JSON.stringify(user), AESKEY).toString(); - LocalStorage.setItem(LocalStorage.loginUserKey, encrypted); - } else { - LocalStorage.removeItem(LocalStorage.loginUserKey); - } - - await fetchUserInfo(); - const urlParams = new URL(window.location.href).searchParams; - history.push(urlParams.get('redirect') || '/'); - } else { - if (error?.data?.code === 500 && error?.data?.msg === '验证码错误') { - captchaInputRef.current?.focus({ - cursor: 'all', - }); - } - - clearSessionToken(); - getCaptchaCode(); - } - }; - return
; - - // return ( - //
- //
- //
- // - // 智能材料科研平台 - //
- //
- // 智能材料科研平台 - // - //
- //
- // 大语言模型运维 统一管理平台 - //
- // - //
- //
- //
- //
- // 欢迎登录 - // 智能材料科研平台 - //
- //
- //
账号登录
- //
- //
- // - // } - // allowClear - // /> - // - - // - // } - // allowClear - // /> - // - - // - //
- // - // - // } - // ref={captchaInputRef} - // allowClear - // /> - // - //
- // 验证码 getCaptchaCode()} - // /> - //
- - // - // 记住密码 - // - - // - // - // - //
- //
- //
- //
- //
- //
- // ); }; export default Login; diff --git a/react-ui/src/pages/User/Login/login.tsx b/react-ui/src/pages/User/Login/login.tsx index 9ef18148..c22f8be9 100644 --- a/react-ui/src/pages/User/Login/login.tsx +++ b/react-ui/src/pages/User/Login/login.tsx @@ -119,10 +119,10 @@ const Login = () => { draggable={false} alt="" /> - 智能材料科研平台 + 复杂智能软件
- 智能材料科研平台 + 复杂智能软件 {
欢迎登录 - 智能材料科研平台 + 复杂智能软件
账号登录
diff --git a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.less b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.less index 0b9a0ddf..59a0cb5b 100644 --- a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.less +++ b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.less @@ -37,7 +37,7 @@ } &__icon { - width: 363px; - height: 216px; + // width: 363px; + height: 176px; } } diff --git a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx index 81ab8f54..f3543705 100644 --- a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx +++ b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx @@ -1,16 +1,14 @@ -import { Button } from 'antd'; import styles from './index.less'; function WorkspaceIntro() { return (
-
自主实验平台
+
复杂智能软件
- 材料领域的自主实验系统是一种用于材料研究和开发的技术平台,它旨在提供实验数据收集、分析和可视化等功能, - 以支持材料工程师、科学家和研究人员在材料设计、性能评估和工艺优化方面的工作 + 复杂智能软件平台构建一套完整的版本迭代升级机制、开发与运行态版本依赖关系分析,以及整合开发部署和持续优化的一体化流程,涵盖数据管理、模型建模、服务开发和系统运行等关键环节,以实现高效、稳定的软件生命周期管理。
-
+ {/*
-
+
*/}