diff --git a/live.html b/live.html new file mode 100644 index 0000000..b0fc2be --- /dev/null +++ b/live.html @@ -0,0 +1,52 @@ + + + + + + + 数字人直播 + + + + +
+ +
+ + + + + \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 4f55fc6..3d6f3ee 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,15 +1,16 @@ import AppRouter from "@/routes"; import {ConfigProvider} from "@/contexts/config"; import {AuthProvider} from "@/contexts/auth"; +import LivePlayer from "@/pages/live-player"; console.log(`APP-BUILD-AT: ${AppBuildVersion}`) function App() { return ( - + {AppConfig.ONLY_LIVE && AppConfig.ONLY_LIVE == 'yes'?: - + } ) } diff --git a/src/assets/core.scss b/src/assets/core.scss index 9467ea5..1068bb6 100644 --- a/src/assets/core.scss +++ b/src/assets/core.scss @@ -164,6 +164,7 @@ @apply text-sm; background: none; .col{ + @apply text-sm text-gray-800; height: 42px; } } diff --git a/src/assets/index.scss b/src/assets/index.scss index cafd4f3..e6a0658 100644 --- a/src/assets/index.scss +++ b/src/assets/index.scss @@ -15,7 +15,6 @@ body { font-size: 16px; font-family: -apple-system, "PingFang SC", 'Microsoft YaHei', sans-serif; background-color: var(--main-bg-color); - min-width: 1000px; } .dashboard-layout { diff --git a/src/pages/live-player/index.tsx b/src/pages/live-player/index.tsx new file mode 100644 index 0000000..de5f54d --- /dev/null +++ b/src/pages/live-player/index.tsx @@ -0,0 +1,17 @@ +import {useMount} from "ahooks"; +import {getLiveUrl} from "@/service/api/live.ts"; +import React, {useState} from "react"; +import {Player} from "@/components/video/player.tsx"; +import './style.scss' + +export default function LivePlayer() { + const [liveUrl, setLiveUrl] = useState('http://fm.live.starbitech.com/fm/prod_fm.flv') + useMount(async ()=>{ + getLiveUrl().then((ret)=>{ + setLiveUrl(ret.flv_url) + }) + }) + return
+ +
+} \ No newline at end of file diff --git a/src/pages/live-player/style.scss b/src/pages/live-player/style.scss new file mode 100644 index 0000000..8e2ae9e --- /dev/null +++ b/src/pages/live-player/style.scss @@ -0,0 +1,9 @@ +.live-player-wrapper { + @apply relative m-auto h-screen w-screen max-w-[480px] content-center relative; + .player-container{ + @apply bg-gray-500 w-full h-screen ; + } + video { + height: 100vh !important; + } +} \ No newline at end of file diff --git a/src/pages/live/index.tsx b/src/pages/live/index.tsx index c598cef..6eb385b 100644 --- a/src/pages/live/index.tsx +++ b/src/pages/live/index.tsx @@ -261,7 +261,7 @@ export default function LiveIndex() {
缩略图
标题
生成时间
-
+
操作
diff --git a/src/pages/news/components/style.module.scss b/src/pages/news/components/style.module.scss index 073e227..7efcc42 100644 --- a/src/pages/news/components/style.module.scss +++ b/src/pages/news/components/style.module.scss @@ -56,7 +56,7 @@ } } .title{ - @apply flex-1 pl-0 justify-start; + @apply flex-1 pl-0; &:after{ display: none; } diff --git a/src/pages/news/edit.tsx b/src/pages/news/edit.tsx index dba34fd..d6daea4 100644 --- a/src/pages/news/edit.tsx +++ b/src/pages/news/edit.tsx @@ -98,7 +98,7 @@ export default function NewEdit() {
标题
-
来源
+
来源
图片数
字数
时间
diff --git a/src/pages/video/index.tsx b/src/pages/video/index.tsx index f592dd1..41661c7 100644 --- a/src/pages/video/index.tsx +++ b/src/pages/video/index.tsx @@ -188,7 +188,7 @@ export default function VideoIndex() {
缩略图
标题
生成时间
-
+
操作
setState({showToTop: top > 30})}> diff --git a/src/service/api/live.ts b/src/service/api/live.ts index 23d14a3..735a3e5 100644 --- a/src/service/api/live.ts +++ b/src/service/api/live.ts @@ -1,4 +1,4 @@ -import {post} from "@/service/request.ts"; +import {get, post} from "@/service/request.ts"; export function playState() { return post({url: '/room/playing'}) @@ -14,4 +14,11 @@ export function modifyOrder(ids: Id[]) { export function deleteByIds(ids: Id[]) { return post('/room/remove', {ids}) +} + +export function getLiveUrl() { + return get<{flv_url:string}>({ + url: '/tencent/get_pull_url', + baseURL: '/api/v1' + }) } \ No newline at end of file diff --git a/src/service/api/video.ts b/src/service/api/video.ts index ff2b3b6..3101ad9 100644 --- a/src/service/api/video.ts +++ b/src/service/api/video.ts @@ -1,4 +1,4 @@ -import {post} from "@/service/request.ts"; +import {get, post} from "@/service/request.ts"; export function getList() { return post>('/video/list') diff --git a/src/service/request.ts b/src/service/request.ts index 5827749..a082ab7 100644 --- a/src/service/request.ts +++ b/src/service/request.ts @@ -71,12 +71,13 @@ export function post(params: RequestOption | string, _data?: AllType) { }) } -export function get(params: RequestOption) { - if (params.data) { - params.url += (params.url.indexOf('?') === -1 ? '?' : '&') + stringify(params.data) +export function get(params: RequestOption|string) { + const options = typeof params === 'string' ? {url: params} : params; + if (options.data) { + options.url += (options.url.indexOf('?') === -1 ? '?' : '&') + stringify(options.data) } return request({ - ...params, + ...options, method: 'get' }) } diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 6cd895b..7ce12cf 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -12,6 +12,7 @@ declare const AppConfig: { // 登录用户信息 key AUTHED_PERSON_DATA_KEY: string; API_PREFIX: string; + ONLY_LIVE: string; }; declare const AppMode: 'test' | 'production' | 'development'; diff --git a/vite.config.ts b/vite.config.ts index c0ec5ef..699d0a8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -21,6 +21,7 @@ export default defineConfig(({mode}) => { API_PREFIX: process.env.APP_API_PREFIX || '/mgmt/v1/metahuman', AUTH_TOKEN_KEY: process.env.AUTH_TOKEN_KEY || AUTH_TOKEN_KEY, AUTHED_PERSON_DATA_KEY: process.env.AUTHED_PERSON_DATA_KEY || 'digital-person-user-info', + ONLY_LIVE: process.env.ONLY_LIVE || 'no', }), AppMode: JSON.stringify(mode), AppBuildVersion: JSON.stringify(AppPackage.name + '-' + AppPackage.version + '-' + dayjs().format('YYYYMMDDHH_mmss')) @@ -46,7 +47,7 @@ export default defineConfig(({mode}) => { // rewrite: (path) => path.replace(/^\/api/, '') }, '/api': { - target: `http://${devServerHost}`, + target: `${devServerHost}`, changeOrigin: true, // rewrite: (path) => path.replace(/^\/api/, '') }