From 561ce68b7059ffa77545be0008c4dca80404ac6f Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Wed, 21 Jun 2023 19:28:22 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=8A=A0=E5=85=A5=E6=B3=A8=E9=87=8A=E5=8C=BA?= =?UTF-8?q?=E5=88=86=E8=BD=AC=E5=86=99=E7=B1=BB=E5=9E=8Btype.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MainPage.js | 9 +++++++-- src/business/recorderSlice.js | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/MainPage.js b/src/MainPage.js index eca4b49..f744a7d 100644 --- a/src/MainPage.js +++ b/src/MainPage.js @@ -46,7 +46,12 @@ function fetchRecord(accessToken, record) { blob => blob.text() ).then(text => { // console.log("type", record.type, text); - let payload = record.type === 1 ? JSON.parse(text) : text; + let payload = null; + if (record.type === 1 || record.type === 3) { + payload = JSON.parse(text) + } else { + payload = text; + } store.dispatch(setCurrentLyric(payload)); }); } @@ -136,7 +141,7 @@ export default function () { } const handleResize = () => { - console.log("innerWidth", document.documentElement.clientWidth, document.documentElement.clientWidth - (open ? 240 : 0) - 48) + // console.log("innerWidth", document.documentElement.clientWidth, document.documentElement.clientWidth - (open ? 240 : 0) - 48) setPlayerBarWidth(document.documentElement.clientWidth - (open ? 240 : 0) - 48); } diff --git a/src/business/recorderSlice.js b/src/business/recorderSlice.js index ab5f9ab..8b2dd10 100644 --- a/src/business/recorderSlice.js +++ b/src/business/recorderSlice.js @@ -1,5 +1,10 @@ import { createSlice } from '@reduxjs/toolkit' +// type: 0 --> 声文速记 纯文本,已适配 +// type: 1 --> 导入音频 +// type: 2 --> 同传翻译 纯文本,已适配 +// type: 3 --> 双语对话 + export const recorderSlice = createSlice({ name: 'recorder', initialState: {