Commit d31203f0 authored by Chunchi Che's avatar Chunchi Che

update

parent e7e8311d
Pipeline #22812 passed with stages
in 12 minutes and 59 seconds
/* /*
* Neos是基于[React](https://reactjs.org/)和[Babylon.js](https://www.babylonjs.com/)框架 * Neos是基于[React](https://reactjs.org/)框架
* 研发的Web版[Ygopro](https://github.com/Fluorohydride/ygopro),游戏王对战平台。 * 研发的Web版[Ygopro](https://github.com/Fluorohydride/ygopro),游戏王对战平台。
* *
* - 路由管理:[React Router](https://reactrouter.com/en/main) * - 路由管理:[React Router](https://reactrouter.com/en/main)
* - 状态管理:[Redux](https://redux.js.org/) * - 状态管理:[valtio](https://valtio.pmnd.rs/)
* - 3D渲染:[Babylon.js](https://www.babylonjs.com/)
* *
* 项目整体架构分为以下模块: * 项目整体架构分为以下模块:
* - UI模块:使用React组件和Babylon.js提供的渲染能力进行UI展示 * - UI模块:基于HTML+CSS进行UI渲染
* - Service模块:一些具体业务逻辑的实现,通常是一些事件处理函数; * - Service模块:一些具体业务逻辑的实现,通常是一些事件处理函数;
* - MiddleWare(中间件)模块:收敛Websocket长连接的处理逻辑; * - MiddleWare(中间件)模块:收敛Websocket长连接的处理逻辑;
* - Adapter模块:进行ygopro数据协议从二进制buffer到TypeScript结构体之间的转换; * - Adapter模块:进行ygopro数据协议从二进制buffer到TypeScript结构体之间的转换;
* - Api模块:提供长连接以外请求网络数据的接口,比如获取卡组数据; * - Api模块:提供长连接以外请求网络数据的接口,比如登录萌卡账号;
* - Reducer模块:进行全局的状态更新; * - Store模块:进行全局状态的管理。
* - Store模块:存储全局状态。
*
* 在设计上各个模块之间都是解耦的,模块之间的依赖应该通过调用接口,而非调用实例。
* 在进行代码开发的时候需要注意这点。
* *
* */ * */
import { ProConfigProvider } from "@ant-design/pro-provider"; import { ProConfigProvider } from "@ant-design/pro-provider";
......
...@@ -9,7 +9,7 @@ const WaitRoom = React.lazy(() => import("./WaitRoom")); ...@@ -9,7 +9,7 @@ const WaitRoom = React.lazy(() => import("./WaitRoom"));
const Mora = React.lazy(() => import("./Mora")); const Mora = React.lazy(() => import("./Mora"));
const NeosDuel = React.lazy(() => import("./Duel/Main")); const NeosDuel = React.lazy(() => import("./Duel/Main"));
const Replay = React.lazy(() => import("./Replay")); const Replay = React.lazy(() => import("./Replay"));
const SSO = React.lazy(() => import("./Sso")); const SSO = React.lazy(() => import("./SSO"));
export default function () { export default function () {
return ( return (
......
...@@ -5,7 +5,7 @@ import { accountStore, User } from "@/stores"; ...@@ -5,7 +5,7 @@ import { accountStore, User } from "@/stores";
const NeosConfig = useConfig(); const NeosConfig = useConfig();
const Sso: React.FC = () => { const SSO: React.FC = () => {
const sso = new URL(location.href).searchParams.get("sso"); const sso = new URL(location.href).searchParams.get("sso");
const user: User | undefined = sso const user: User | undefined = sso
? getSSOUser(new URLSearchParams(atob(sso))) ? getSSOUser(new URLSearchParams(atob(sso)))
...@@ -56,4 +56,4 @@ function getSSOUser(searchParams: URLSearchParams): User { ...@@ -56,4 +56,4 @@ function getSSOUser(searchParams: URLSearchParams): User {
return sso as any; return sso as any;
} }
export default Sso; export default SSO;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment