新增 pc-client:畅联 PC 端工程(Electron+React,按确认效果图改造,B-59)
- 基于 openim-electron-demo 改造:工号+密码登录(自研账号服务)、会话列表/聊天窗/通讯录界面重做
- 文字/语音/文件/图片消息、文件拖拽发送、表情面板、一对一语音通话(LiveKit)
- RTC 令牌对接账号服务带鉴权版 /api/rtc_token(Bearer imToken + {room,identity})
- account-service: CORS Allow-Headers 补 authorization(浏览器/渲染进程跨域调 rtc_token 需要)
- 附本地 mock 账号服务(scripts/mock-account-server.js)与截图联调脚本
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const contactRoutes = [
|
||||
{
|
||||
path: "groupNotifications",
|
||||
async lazy() {
|
||||
const { GroupNotifications } = await import("@/pages/contact/groupNotifications");
|
||||
return { Component: GroupNotifications };
|
||||
},
|
||||
},
|
||||
{
|
||||
index: true,
|
||||
async lazy() {
|
||||
const { MyFriends } = await import("@/pages/contact/myFriends");
|
||||
return { Component: MyFriends };
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "myGroups",
|
||||
async lazy() {
|
||||
const { MyGroups } = await import("@/pages/contact/myGroups");
|
||||
return { Component: MyGroups };
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "newFriends",
|
||||
async lazy() {
|
||||
const { NewFriends } = await import("@/pages/contact/newFriends");
|
||||
return { Component: NewFriends };
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default contactRoutes;
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Button, Result } from "antd";
|
||||
import { t } from "i18next";
|
||||
import { useRouteError } from "react-router-dom";
|
||||
|
||||
const GlobalErrorElement = () => {
|
||||
const error = useRouteError();
|
||||
|
||||
const reload = () => {
|
||||
window.location.reload();
|
||||
};
|
||||
|
||||
console.error("GlobalErrorElement");
|
||||
console.error(error);
|
||||
|
||||
return (
|
||||
<div className="flex h-full w-full items-center justify-center">
|
||||
<Result
|
||||
status="404"
|
||||
subTitle={t("toast.somethingError")}
|
||||
extra={
|
||||
<Button type="primary" onClick={reload}>
|
||||
{t("placeholder.recover")}
|
||||
</Button>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default GlobalErrorElement;
|
||||
@@ -0,0 +1,59 @@
|
||||
import { createHashRouter } from "react-router-dom";
|
||||
|
||||
import { MainContentLayout } from "@/layout/MainContentLayout";
|
||||
import { MainContentWrap } from "@/layout/MainContentWrap";
|
||||
import { EmptyChat } from "@/pages/chat/EmptyChat";
|
||||
import { QueryChat } from "@/pages/chat/queryChat";
|
||||
|
||||
import contactRoutes from "./ContactRoutes";
|
||||
import GlobalErrorElement from "./GlobalErrorElement";
|
||||
|
||||
const router = createHashRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <MainContentWrap />,
|
||||
errorElement: <GlobalErrorElement />,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
element: <MainContentLayout />,
|
||||
children: [
|
||||
{
|
||||
path: "/chat",
|
||||
async lazy() {
|
||||
const { Chat } = await import("@/pages/chat");
|
||||
return { Component: Chat };
|
||||
},
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <EmptyChat />,
|
||||
},
|
||||
{
|
||||
path: ":conversationID",
|
||||
element: <QueryChat />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "contact",
|
||||
async lazy() {
|
||||
const { Contact } = await import("@/pages/contact");
|
||||
return { Component: Contact };
|
||||
},
|
||||
children: contactRoutes,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "login",
|
||||
async lazy() {
|
||||
const { Login } = await import("@/pages/login");
|
||||
return { Component: Login };
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user