Fix(Huya): refactor anticode generation using getCdnTokenInfoEx API (#1575)
* Fix(Huya): refactor anticode generation using getCdnTokenInfoEx API * chore: cleanup * chore: get random sHuYaUA * chore: 代码复用
This commit is contained in:
1 parent
218b8bd127
commit
caf106c3f8
20 files changed
+2801
-1991
No files matched your search
@@ -191,7 +191,7 @@ const Dashboard: React.FC = () => {
|
||||
{Object.entries(plugins)
|
||||
.filter(([key]) => key !== 'Cookie')
|
||||
.map(([key, Plugin]) => (
|
||||
<Plugin entity={entity} list={list} />
|
||||
<Plugin key={key} entity={entity} list={list} />
|
||||
))}
|
||||
<plugins.Cookie entity={entity} list={list} />
|
||||
</Collapse>
|
||||
|
||||
@@ -17,14 +17,6 @@ interface LogContentProps {
|
||||
}
|
||||
|
||||
const LogContent = ({ logs, logContainerRef, isLoading }: LogContentProps) => {
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }}>
|
||||
<Spin size="large" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// 判断滚动条是否接近底部
|
||||
const isScrolledToBottom = () => {
|
||||
const containers = document.getElementsByClassName('log-container');
|
||||
@@ -53,6 +45,14 @@ const LogContent = ({ logs, logContainerRef, isLoading }: LogContentProps) => {
|
||||
}
|
||||
}, [logs]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%' }}>
|
||||
<Spin size="large" />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className="log-container"
|
||||
@@ -151,6 +151,7 @@ export default function LogViewer() {
|
||||
wsRef.current.close()
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeTab])
|
||||
|
||||
const handleFileChange = (value: string) => {
|
||||
@@ -211,7 +212,7 @@ export default function LogViewer() {
|
||||
activeKey={activeTab}
|
||||
onChange={handleFileChange}
|
||||
tabBarExtraContent={
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center'}}>
|
||||
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
|
||||
<Button
|
||||
icon={<IconSave />}
|
||||
onClick={() => (window.location.href = `/static/${activeTab}.log`)}
|
||||
|
||||
+8
-7
@@ -12,9 +12,10 @@ interface PlayerConfig {
|
||||
|
||||
function playFlv(video: HTMLVideoElement, url: string, art: Artplayer) {
|
||||
if (mpegts.isSupported()) {
|
||||
if (art.flv) {
|
||||
art.flv.destroy()
|
||||
art.flv = null
|
||||
const artWithFlv = art as Artplayer & { flv?: mpegts.Player | null }
|
||||
if (artWithFlv.flv) {
|
||||
artWithFlv.flv.destroy()
|
||||
artWithFlv.flv = null
|
||||
}
|
||||
|
||||
const flv = mpegts.createPlayer({
|
||||
@@ -22,11 +23,11 @@ function playFlv(video: HTMLVideoElement, url: string, art: Artplayer) {
|
||||
url: url,
|
||||
})
|
||||
|
||||
art.flv = flv
|
||||
artWithFlv.flv = flv
|
||||
art.on('destroy', () => {
|
||||
if (art.flv) {
|
||||
art.flv.destroy()
|
||||
art.flv = null
|
||||
if (artWithFlv.flv) {
|
||||
artWithFlv.flv.destroy()
|
||||
artWithFlv.flv = null
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user