删除会话管理功能,修复会话id为空问题

This commit is contained in:
2025-06-04 19:50:00 +08:00
parent 52515df981
commit 18f3787b9c
2 changed files with 2 additions and 8 deletions

View File

@@ -188,12 +188,6 @@ const AdminDashboardPage = () => {
href="/admin/robots"
icon={<FiTerminal size={28}/>}
/>
<NavCard
title="会话管理"
description="查看所有充电会话记录、详情"
href="/admin/sessions"
icon={<FiList size={28}/>}
/>
<NavCard
title="用户管理"
description="查看和管理平台用户列表"

View File

@@ -68,10 +68,10 @@ export default function RequestChargingPage() {
// Corrected path
const response = await api.post('/session/request', { spotId: selectedSpotId });
if (response.data && response.data.code === 0) {
const newSession = response.data.data;
const sessionId = response.data.data;
// TODO: Navigate to a session status page or show success message
// For now, navigate to dashboard and show an alert
alert(`充电请求成功会话ID: ${newSession.id}. 机器人正在前往...`);
alert(`充电请求成功会话ID: ${sessionId}. 机器人正在前往...`);
router.push('/dashboard');
} else {
setError(response.data.message || '发起充电请求失败');