mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-21 19:08:47 +08:00
Merge branch 'dev' of https://gitee.com/playeduxyz/frontend into dev
This commit is contained in:
commit
3065d346ea
@ -1,9 +1,13 @@
|
||||
import { lazy } from "react";
|
||||
import { RouteObject } from "react-router-dom";
|
||||
import { system } from "../api";
|
||||
import { SystemConfigStoreInterface } from "../store/system/systemConfigSlice";
|
||||
|
||||
import { InitPage } from "../pages/init";
|
||||
import { SystemConfigStoreInterface } from "../store/system/systemConfigSlice";
|
||||
import CoursePage from "../pages/course";
|
||||
import IndexPage from "../pages/index";
|
||||
import LatestLearnPage from "../pages/latest-learn";
|
||||
import LoginPage from "../pages/login";
|
||||
|
||||
let config: SystemConfigStoreInterface = {
|
||||
systemApiUrl: "",
|
||||
@ -13,7 +17,7 @@ let config: SystemConfigStoreInterface = {
|
||||
systemName: "",
|
||||
pcIndexFooterMsg: "",
|
||||
playerPoster: "",
|
||||
playerIsEnabledBulletSecret: "",
|
||||
playerIsEnabledBulletSecret: false,
|
||||
playerBulletSecretText: "",
|
||||
playerBulletSecretColor: "",
|
||||
playerBulletSecretOpacity: "",
|
||||
@ -22,11 +26,25 @@ let config: SystemConfigStoreInterface = {
|
||||
const Init = lazy(async () => {
|
||||
return new Promise<any>((resolve) => {
|
||||
system.config().then((res: any) => {
|
||||
//系统配置
|
||||
config.systemApiUrl = res.data["system-api-url"];
|
||||
config.systemH5Url = res.data["system-h5-url"];
|
||||
config.systemLogo = res.data["system-logo"];
|
||||
config.systemName = res.data["system-name"];
|
||||
config.systemPcUrl = res.data["system-pc-url"];
|
||||
config.pcIndexFooterMsg = res.data["pc-index-footer-msg"];
|
||||
|
||||
//播放器配置
|
||||
config.playerPoster = res.data["player-poster"];
|
||||
config.playerIsEnabledBulletSecret =
|
||||
res.data["player-is-enabled-bullet-secret"] &&
|
||||
res.data["player-is-enabled-bullet-secret"] === "1"
|
||||
? true
|
||||
: false;
|
||||
config.playerBulletSecretText = res.data["player-bullet-secret-text"];
|
||||
config.playerBulletSecretColor = res.data["player-bullet-secret-color"];
|
||||
config.playerBulletSecretOpacity =
|
||||
res.data["player-bullet-secret-opacity"];
|
||||
|
||||
resolve({
|
||||
default: InitPage,
|
||||
@ -36,10 +54,10 @@ const Init = lazy(async () => {
|
||||
});
|
||||
|
||||
// 懒加载
|
||||
const LoginPage = lazy(() => import("../pages/login"));
|
||||
const IndexPage = lazy(() => import("../pages/index"));
|
||||
const CoursePage = lazy(() => import("../pages/course"));
|
||||
const LatestLearnPage = lazy(() => import("../pages/latest-learn"));
|
||||
// const LoginPage = lazy(() => import("../pages/login"));
|
||||
// const IndexPage = lazy(() => import("../pages/index"));
|
||||
// const CoursePage = lazy(() => import("../pages/course"));
|
||||
// const LatestLearnPage = lazy(() => import("../pages/latest-learn"));
|
||||
|
||||
const routes: RouteObject[] = [
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ type SystemConfigStoreInterface = {
|
||||
systemName: string;
|
||||
pcIndexFooterMsg: string;
|
||||
playerPoster: string;
|
||||
playerIsEnabledBulletSecret: string;
|
||||
playerIsEnabledBulletSecret: boolean;
|
||||
playerBulletSecretText: string;
|
||||
playerBulletSecretColor: string;
|
||||
playerBulletSecretOpacity: string;
|
||||
@ -22,7 +22,7 @@ let defaultValue: SystemConfigStoreInterface = {
|
||||
systemName: "",
|
||||
pcIndexFooterMsg: "",
|
||||
playerPoster: "",
|
||||
playerIsEnabledBulletSecret: "",
|
||||
playerIsEnabledBulletSecret: false,
|
||||
playerBulletSecretText: "",
|
||||
playerBulletSecretColor: "",
|
||||
playerBulletSecretOpacity: "",
|
||||
|
Loading…
x
Reference in New Issue
Block a user