删除会话管理功能,修复会话id为空问题
This commit is contained in:
@@ -188,12 +188,6 @@ const AdminDashboardPage = () => {
|
|||||||
href="/admin/robots"
|
href="/admin/robots"
|
||||||
icon={<FiTerminal size={28}/>}
|
icon={<FiTerminal size={28}/>}
|
||||||
/>
|
/>
|
||||||
<NavCard
|
|
||||||
title="会话管理"
|
|
||||||
description="查看所有充电会话记录、详情"
|
|
||||||
href="/admin/sessions"
|
|
||||||
icon={<FiList size={28}/>}
|
|
||||||
/>
|
|
||||||
<NavCard
|
<NavCard
|
||||||
title="用户管理"
|
title="用户管理"
|
||||||
description="查看和管理平台用户列表"
|
description="查看和管理平台用户列表"
|
||||||
|
|||||||
@@ -68,10 +68,10 @@ export default function RequestChargingPage() {
|
|||||||
// Corrected path
|
// Corrected path
|
||||||
const response = await api.post('/session/request', { spotId: selectedSpotId });
|
const response = await api.post('/session/request', { spotId: selectedSpotId });
|
||||||
if (response.data && response.data.code === 0) {
|
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
|
// TODO: Navigate to a session status page or show success message
|
||||||
// For now, navigate to dashboard and show an alert
|
// For now, navigate to dashboard and show an alert
|
||||||
alert(`充电请求成功!会话ID: ${newSession.id}. 机器人正在前往...`);
|
alert(`充电请求成功!会话ID: ${sessionId}. 机器人正在前往...`);
|
||||||
router.push('/dashboard');
|
router.push('/dashboard');
|
||||||
} else {
|
} else {
|
||||||
setError(response.data.message || '发起充电请求失败');
|
setError(response.data.message || '发起充电请求失败');
|
||||||
|
|||||||
Reference in New Issue
Block a user