Skip to content

Commit 39f4954

Browse files
committed
join wasm base_path
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent 3901745 commit 39f4954

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pages/home/previews/pdf.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ import { Box, useColorMode } from "@hope-ui/solid"
44
import { onMount } from "solid-js"
55
import { currentLang } from "~/app/i18n"
66
import { objStore } from "~/store"
7+
import { base_path } from "~/utils"
78

89
const PDFViewer = () => {
910
const { colorMode } = useColorMode()
1011
let ref: HTMLDivElement | undefined
1112
onMount(() => {
1213
const src = objStore.raw_url
1314
// wasm url must be absolute
14-
const absolutePdfiumWasmUrl = new URL(pdfiumWasmUrl, location.href).href
15+
const absolutePdfiumWasmUrl = new URL(
16+
pdfiumWasmUrl,
17+
location.href + base_path,
18+
).href
1519
if (ref && src) {
1620
EmbedPDF.init({
1721
type: "container",

0 commit comments

Comments
 (0)