4.7.1 production (#1173)

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-04-11 16:30:17 +08:00
committed by GitHub
parent db2dd91f03
commit c314312a57
19 changed files with 199 additions and 120 deletions

View File

@@ -0,0 +1,20 @@
import { getToken } from '@/web/support/user/auth';
export const xmlDownloadFetch = ({ url, filename }: { url: string; filename: string }) => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.setRequestHeader('token', getToken());
xhr.responseType = 'blob';
xhr.onload = function (e) {
if (this.status == 200) {
const blob = this.response;
const a = document.createElement('a');
const url = URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
}
};
xhr.send();
};

View File

@@ -121,6 +121,9 @@ export const useSpeech = (props?: OutLinkChatAuthProps & { appId?: string }) =>
}
}
// close media stream
stream.getTracks().forEach((track) => track.stop());
setIsTransCription(false);
setIsSpeaking(false);
};