优化认证

This commit is contained in:
sijinhui
2024-04-01 22:30:35 +08:00
parent 070f143541
commit f5874a4d3d
3 changed files with 14 additions and 21 deletions

View File

@@ -1,4 +1,3 @@
// "use client";
import { Button, Input, Space } from "antd";
import {
Dispatch,
@@ -41,7 +40,11 @@ export default function VoiceInput({
setAccessToken(result.result);
};
if (accessToken === "") {
get_access_token();
try {
get_access_token();
} catch (e) {
console.log("[get_access_token]", e);
}
}
}, [accessToken]);
@@ -61,15 +64,6 @@ export default function VoiceInput({
if (intentJson) {
setVoiceInputText(voiceInputText + `${intentJson}`);
}
// setTempUserInput("");
// if (result?.translations) {
// let resultJson = JSON.parse(result.json);
// resultJson['privTranslationPhrase']['Translation']['Translations'].forEach(
// function (translation: { Language: any; Text: any; }) {
// setVoiceInputText(voiceInputText + ` [${translation.Language}] ${translation.Text}\r\n`);
// });
// }
}
function onCanceled(
sender: Recognizer,
@@ -177,11 +171,3 @@ export default function VoiceInput({
</div>
);
}
// export const getServerSideProps: GetServerSideProps = async context => {
// const serverConfig = getServerSideConfig();
// console.log('66666', serverConfig, )
// return {
// props: {}
// };
// };