This commit is contained in:
root 2025-07-11 11:25:56 +08:00
parent 766d59cdf0
commit 6e62d72ff6
3 changed files with 11 additions and 3 deletions

View File

@ -25,7 +25,11 @@
}
],
"security": {
"csp": null
"csp": "default-src 'self' ipc: http://ipc.localhost; img-src 'self' asset: http://asset.localhost data:; media-src 'self' asset: http://asset.localhost; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'",
"assetProtocol": {
"enable": true,
"scope": ["**"]
}
}
},
"bundle": {

View File

@ -1,4 +1,4 @@
import React from 'react'
import React, { useEffect } from 'react'
import { Routes, Route } from 'react-router-dom'
import Layout from './components/Layout'
import HomePage from './pages/HomePage'
@ -13,8 +13,11 @@ import ModelManagePage from './pages/ModelManagePage'
import AudioLibraryPage from './pages/AudioLibraryPage'
import MediaLibraryPage from './pages/MediaLibraryPage'
import KVTestPage from './pages/KVTestPage'
import { appDataDir } from '@tauri-apps/api/path'
function App() {
useEffect(() => {
console.log(appDataDir())
}, [])
return (
<Layout>
<Routes>

View File

@ -28,6 +28,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
if (isOpen && videoPath) {
// 使用Tauri的convertFileSrc来获取安全的文件URL
const src = convertFileSrc(videoPath)
console.log({ src })
setVideoSrc(src)
}
}, [isOpen, videoPath])