-
} onClick={onBack}>
- 返回列表
-
+
+ {/* 顶部标签栏 */}
+
+
+ }
+ onClick={() => setActiveTab('link')}
+ style={{ minWidth: 250 }}
+ >
+ 链接实例
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* 左侧测试用例列表 */}
+
+
+ 测试用例
+
+
+
+ }>
+
+
+
+
视频回调jck|ssss
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* 中间流程图区域 */}
+
+
+ {/* 开始节点 */}
+
+
+ {/* 组件节点 */}
+
+
+
+ ⭐
+ 计算组件#1
+
+
+
lineMove
+
circleMove
+
+
+
+ input
+
+
+
+ strpos ARR
+
+
+
+ ufNum INT
+
+
+
+ ufNum INT
+
+
+
+ output
+
+
+
+
+
+
+
+ {/* 结束节点 */}
+
+
+
+
+ {/* 右侧运行日志 */}
+
+
+
运行日志
+
+ 📋
+ 📁
+ 💾
+ 📊
+ 🗑️
+
+
+
+
+
连接信息:连接成功!
+
未启动任务或任务已完成
+
+
+
-
测试实例: {instance?.name}
-
实例标识: {instance?.identifier}
-
运行状态: {instance?.runStatus}
-
运行类型: {instance?.runType}
- {/* 这里添加你的测试实例内容 */}
);
};
diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx
index 85303c1..20dffff 100644
--- a/src/pages/login/index.tsx
+++ b/src/pages/login/index.tsx
@@ -11,7 +11,11 @@ import { localGet, localRemove, openWindow } from '@/utils/common';
import logoImage from '@/public/assets/logo.png';
import store from '@/store';
import { updateUserInfo } from '@/store/user';
-import { getMyComponents, getPubComponents, getTeamComponents } from '@/api/components';
+import {
+ getMyComponents,
+ getPubComponents,
+ getTeamComponents,
+} from '@/api/components';
import { getPublishPage } from '@/api/flow';
import dayjs from 'dayjs';
@@ -33,7 +37,7 @@ function Login() {
{ promise: getMyComponents(), key: 'myLibs' },
{ promise: getPubComponents(), key: 'pubLibs' },
{ promise: getTeamComponents(), key: 'teamLibs' },
- { promise: getPublishPage(), key: 'pubFlow' }
+ { promise: getPublishPage(), key: 'pubFlow' },
// {promise: appId ? getMineSubs({id: appId}) : Promise.resolve(null), key: 'myFlow'},
// {promise: getEventList(), key: 'eventList'}
];
@@ -44,7 +48,7 @@ function Login() {
teamLibs: null,
pubFlow: null,
// myFlow: null,
- updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss')
+ updateTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
};
const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || '{}');
@@ -79,7 +83,10 @@ function Login() {
// 更新本地存储数据
obj[key] = res?.data || null;
- sessionStorage.setItem(`compLibs${userInfo.userId}`, JSON.stringify(obj));
+ sessionStorage.setItem(
+ `compLibs${userInfo.userId}`,
+ JSON.stringify(obj)
+ );
} catch (error) {
console.error(`加载${key}失败:`, error);
}
@@ -92,9 +99,31 @@ function Login() {
const handleLogin = async () => {
const url = new URL(window.location.href);
const code = url.searchParams.get('code');
+ const token = url.searchParams.get('token');
const { origin, pathname } = window.location;
- setIsNeedLogin(code === null);
+ setIsNeedLogin(code === null && token === null);
+
+ // 处理 URL 中的 token 参数
+ if (token) {
+ try {
+ // 记录登录状态
+ localStorage.setItem('userStatus', 'login');
+ // 保存 Token
+ setToken(token);
+ // 获取用户信息
+ // await fetchUserInfo();
+
+ // 清除 URL 中的 token 参数
+ url.searchParams.delete('token');
+ window.history.replaceState({}, '', url.pathname + url.search);
+ // 跳转首页
+ window.location.href = '/dashboard/workplace';
+ return;
+ } catch (error) {
+ console.error('Token login error:', error);
+ }
+ }
if (code) {
const callbackUrl = `${origin}/`;
@@ -102,7 +131,7 @@ function Login() {
// 根据code向后端获取token
const res: any = await getToken({
authCode: code,
- callbackUrl
+ callbackUrl,
} as any);
if (res && res.code === 200) {
@@ -112,13 +141,15 @@ function Login() {
// await userStore.info(); // 如果有对应的Redux操作,可以在这里dispatch
if (localGet('system_name') === 'pc') {
- openWindow(`${window.location.protocol}//${window.location.hostname}:${window.location.port}/isdp/`, {
- target: '_self'
- });
+ openWindow(
+ `${window.location.protocol}//${window.location.hostname}:${window.location.port}/isdp/`,
+ {
+ target: '_self',
+ }
+ );
localRemove('system_name');
return;
- }
- else {
+ } else {
fetchUserInfo();
router.push('/dashboard/workplace');
}
@@ -139,12 +170,10 @@ function Login() {
<>
-

-
工业软件组件化构建开发与运行支撑环境
+

+
+ 工业软件组件化构建开发与运行支撑环境
+
@@ -159,8 +188,12 @@ function Login() {
获取授权中...
-
-
+
+
@@ -182,4 +215,4 @@ function Login() {
Login.displayName = 'LoginPage';
-export default Login;
\ No newline at end of file
+export default Login;