From 8209a314f21360e16419571286f3e316d3ad0765 Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Mon, 17 Feb 2025 18:54:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8B=AC=E7=AB=8B=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.vue | 2 + composables/useVideoSubtitleEmbedding.ts | 2 + layouts/authenticate.vue | 9 + layouts/default.vue | 109 +++-- pages/user/authenticate.vue | 571 +++++++++++++++++++++++ 5 files changed, 658 insertions(+), 35 deletions(-) create mode 100644 layouts/authenticate.vue create mode 100644 pages/user/authenticate.vue diff --git a/app.vue b/app.vue index d5a176a..b6f2e11 100644 --- a/app.vue +++ b/app.vue @@ -26,6 +26,8 @@ onMounted(() => { icon: 'i-tabler-alert-triangle', }) modal.open(ModalAuthentication) + } else if (!res && !loginState.token) { + router.replace('/user/authenticate') } }) }) diff --git a/composables/useVideoSubtitleEmbedding.ts b/composables/useVideoSubtitleEmbedding.ts index f38f4b4..4750925 100644 --- a/composables/useVideoSubtitleEmbedding.ts +++ b/composables/useVideoSubtitleEmbedding.ts @@ -39,6 +39,8 @@ export const useVideoSubtitleEmbedding = async ( }; } + console.log(`video clip: ${videoUrl}`) + const videoClip = new MP4Clip((await fetch(videoUrl)).body!) const videoSprite = new OffscreenSprite(videoClip) videoSprite.time = { duration: videoClip.meta.duration, offset: 0 } diff --git a/layouts/authenticate.vue b/layouts/authenticate.vue new file mode 100644 index 0000000..369acfc --- /dev/null +++ b/layouts/authenticate.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/layouts/default.vue b/layouts/default.vue index e87dde5..12d9bda 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -37,28 +37,40 @@ const links = [ label: 'AI 工具导航', icon: 'tabler:planet', to: '/aigc/navigation', - } + }, ] const items = [ - [{ - label: 'support@fenshenzhike.com', - slot: 'account', - disabled: true, - }], [{ - label: '账号管理', - icon: 'i-tabler-user-circle', - to: '/profile' - }], [{ - label: '注销登录', - icon: 'i-tabler-logout', - click: () => loginState.logout().then(() => toast.add({ - title: '退出登录', - description: `您已成功退出登录账号`, - color: 'indigo', - icon: 'i-tabler-logout-2', - })), - }], + [ + { + label: 'support@fenshenzhike.com', + slot: 'account', + disabled: true, + }, + ], + [ + { + label: '账号管理', + icon: 'i-tabler-user-circle', + to: '/profile', + }, + ], + [ + { + label: '注销登录', + icon: 'i-tabler-logout', + click: () => + loginState.logout().then(() => { + toast.add({ + title: '退出登录', + description: `您已成功退出登录账号`, + color: 'indigo', + icon: 'i-tabler-logout-2', + }) + router.push({ path: '/user/authenticate' }) + }), + }, + ], ] const open_login_modal = () => { @@ -70,23 +82,38 @@ const open_login_modal = () => {

- AIGC 微课视频研创平台 + + AIGC 微课视频研创平台 +

- + {

已登录为 - + OP

-

+

{{ loginState.user?.username }}

@@ -124,11 +161,13 @@ const open_login_modal = () => {
- +
-

© {{ dayjs().year() }} 重庆眩生花科技有限公司

+

+ © {{ dayjs().year() }} 重庆眩生花科技有限公司 +

@@ -136,25 +175,25 @@ const open_login_modal = () => { \ No newline at end of file + diff --git a/pages/user/authenticate.vue b/pages/user/authenticate.vue new file mode 100644 index 0000000..d8ff52e --- /dev/null +++ b/pages/user/authenticate.vue @@ -0,0 +1,571 @@ + + + + +