fix: 静态资源文件路径解析

This commit is contained in:
TsMask
2024-10-28 14:31:04 +08:00
parent 0a96fee6c3
commit 6e3ef7e56a
5 changed files with 37 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import { onBeforeUnmount, onMounted, reactive } from 'vue';
import { scriptUrl } from '@/assets/js/wiregasm_worker';
import { WK, OptionsType } from '@/plugins/wk-worker';
import { parseBasePath } from '@/plugins/file-static-url';
const wk = new WK();
export const NO_SELECTION = { id: '', idx: 0, start: 0, length: 0 };
@@ -201,7 +202,7 @@ export function usePCAP() {
/**本地示例文件 */
async function handleLoadExample() {
const name = 'test_ethernet.pcap';
const res = await fetch('/wiregasm/test_ethernet.pcap');
const res = await fetch(parseBasePath('/wiregasm/test_ethernet.pcap'));
const body = await res.arrayBuffer();
state.summary = {