mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-22 02:16:30 +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 { lazy } from "react";
|
||||||
import { RouteObject } from "react-router-dom";
|
import { RouteObject } from "react-router-dom";
|
||||||
import { system } from "../api";
|
import { system } from "../api";
|
||||||
|
import { SystemConfigStoreInterface } from "../store/system/systemConfigSlice";
|
||||||
|
|
||||||
import { InitPage } from "../pages/init";
|
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 = {
|
let config: SystemConfigStoreInterface = {
|
||||||
systemApiUrl: "",
|
systemApiUrl: "",
|
||||||
@ -13,7 +17,7 @@ let config: SystemConfigStoreInterface = {
|
|||||||
systemName: "",
|
systemName: "",
|
||||||
pcIndexFooterMsg: "",
|
pcIndexFooterMsg: "",
|
||||||
playerPoster: "",
|
playerPoster: "",
|
||||||
playerIsEnabledBulletSecret: "",
|
playerIsEnabledBulletSecret: false,
|
||||||
playerBulletSecretText: "",
|
playerBulletSecretText: "",
|
||||||
playerBulletSecretColor: "",
|
playerBulletSecretColor: "",
|
||||||
playerBulletSecretOpacity: "",
|
playerBulletSecretOpacity: "",
|
||||||
@ -22,11 +26,25 @@ let config: SystemConfigStoreInterface = {
|
|||||||
const Init = lazy(async () => {
|
const Init = lazy(async () => {
|
||||||
return new Promise<any>((resolve) => {
|
return new Promise<any>((resolve) => {
|
||||||
system.config().then((res: any) => {
|
system.config().then((res: any) => {
|
||||||
|
//系统配置
|
||||||
config.systemApiUrl = res.data["system-api-url"];
|
config.systemApiUrl = res.data["system-api-url"];
|
||||||
config.systemH5Url = res.data["system-h5-url"];
|
config.systemH5Url = res.data["system-h5-url"];
|
||||||
config.systemLogo = res.data["system-logo"];
|
config.systemLogo = res.data["system-logo"];
|
||||||
config.systemName = res.data["system-name"];
|
config.systemName = res.data["system-name"];
|
||||||
config.systemPcUrl = res.data["system-pc-url"];
|
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({
|
resolve({
|
||||||
default: InitPage,
|
default: InitPage,
|
||||||
@ -36,10 +54,10 @@ const Init = lazy(async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 懒加载
|
// 懒加载
|
||||||
const LoginPage = lazy(() => import("../pages/login"));
|
// const LoginPage = lazy(() => import("../pages/login"));
|
||||||
const IndexPage = lazy(() => import("../pages/index"));
|
// const IndexPage = lazy(() => import("../pages/index"));
|
||||||
const CoursePage = lazy(() => import("../pages/course"));
|
// const CoursePage = lazy(() => import("../pages/course"));
|
||||||
const LatestLearnPage = lazy(() => import("../pages/latest-learn"));
|
// const LatestLearnPage = lazy(() => import("../pages/latest-learn"));
|
||||||
|
|
||||||
const routes: RouteObject[] = [
|
const routes: RouteObject[] = [
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@ type SystemConfigStoreInterface = {
|
|||||||
systemName: string;
|
systemName: string;
|
||||||
pcIndexFooterMsg: string;
|
pcIndexFooterMsg: string;
|
||||||
playerPoster: string;
|
playerPoster: string;
|
||||||
playerIsEnabledBulletSecret: string;
|
playerIsEnabledBulletSecret: boolean;
|
||||||
playerBulletSecretText: string;
|
playerBulletSecretText: string;
|
||||||
playerBulletSecretColor: string;
|
playerBulletSecretColor: string;
|
||||||
playerBulletSecretOpacity: string;
|
playerBulletSecretOpacity: string;
|
||||||
@ -22,7 +22,7 @@ let defaultValue: SystemConfigStoreInterface = {
|
|||||||
systemName: "",
|
systemName: "",
|
||||||
pcIndexFooterMsg: "",
|
pcIndexFooterMsg: "",
|
||||||
playerPoster: "",
|
playerPoster: "",
|
||||||
playerIsEnabledBulletSecret: "",
|
playerIsEnabledBulletSecret: false,
|
||||||
playerBulletSecretText: "",
|
playerBulletSecretText: "",
|
||||||
playerBulletSecretColor: "",
|
playerBulletSecretColor: "",
|
||||||
playerBulletSecretOpacity: "",
|
playerBulletSecretOpacity: "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user