Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
46d3cada95 chore(deps): bump react-router from 6.3.0 to 6.30.2 in /web/berry
Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 6.3.0 to 6.30.2.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router@6.30.2/packages/react-router)

---
updated-dependencies:
- dependency-name: react-router
  dependency-version: 6.30.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-09 03:26:43 +00:00
4 changed files with 3 additions and 54 deletions

View File

@@ -31,7 +31,7 @@
"react-dom": "^18.2.0",
"react-perfect-scrollbar": "^1.5.8",
"react-redux": "^8.0.2",
"react-router": "6.3.0",
"react-router": "6.30.2",
"react-router-dom": "6.3.0",
"react-scripts": "^5.0.1",
"react-turnstile": "^1.1.2",

View File

@@ -8,12 +8,11 @@ import {
IconKey,
IconGardenCart,
IconUser,
IconUserScan,
IconFileTextAi
IconUserScan
} from '@tabler/icons-react';
// constant
const icons = { IconDashboard, IconSitemap, IconArticle, IconCoin, IconAdjustments, IconKey, IconGardenCart, IconUser, IconUserScan,IconFileTextAi };
const icons = { IconDashboard, IconSitemap, IconArticle, IconCoin, IconAdjustments, IconKey, IconGardenCart, IconUser, IconUserScan };
// ==============================|| DASHBOARD MENU ITEMS ||============================== //
@@ -30,14 +29,6 @@ const panel = {
breadcrumbs: false,
isAdmin: false
},
{
id: 'chat',
title: '聊天',
type: 'item',
url: '/panel/chat',
icon: icons.IconFileTextAi,
breadcrumbs: false
},
{
id: 'channel',
title: '渠道',

View File

@@ -9,7 +9,6 @@ const Log = Loadable(lazy(() => import('views/Log')));
const Redemption = Loadable(lazy(() => import('views/Redemption')));
const Setting = Loadable(lazy(() => import('views/Setting')));
const Token = Loadable(lazy(() => import('views/Token')));
const Chat = Loadable(lazy(() => import('views/Chat')));
const Topup = Loadable(lazy(() => import('views/Topup')));
const User = Loadable(lazy(() => import('views/User')));
const Profile = Loadable(lazy(() => import('views/Profile')));
@@ -40,10 +39,6 @@ const MainRoutes = {
path: 'log',
element: <Log />
},
{
path: 'chat',
element: <Chat />
},
{
path: 'redemption',
element: <Redemption />

View File

@@ -1,37 +0,0 @@
import React, { useEffect, useState } from "react";
import { API } from 'utils/api';
import { showError, showSuccess } from 'utils/common';
const Chat = () => {
const [value, setValue] = useState([]);
const [isLoading, setIsLoading] = useState(true); // 加载状态
const loadTokens = async () => {
setIsLoading(true); // 开始加载
const res = await API.get(`/api/token/?p=0`);
const { success, message, data } = res.data;
setValue(data);
setIsLoading(false); // 加载完成
};
useEffect(() => {
loadTokens();
}, []);
if (isLoading) {
return <div>Loading...</div>;
} else if (value.length) {
const siteInfo = JSON.parse(localStorage.getItem("siteInfo"));
const chatLink = siteInfo.chat_link + `#/?settings={"key":"sk-${value[0]?.key}","url":"${siteInfo.server_address}"}`;
return (
<iframe
src={chatLink}
style={{ width: "100%", height: "85vh", border: "none" }}
/>
);
} else {
showError("未找到可用令牌,请先创建令牌");
}
};
export default Chat;