瀏覽代碼

兼容NGINX

liushengqiang 2 年之前
父節點
當前提交
4e4de9a127
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/page-instrument/router.ts
  2. 1 1
      src/page-instrument/view-figner/index.tsx

+ 1 - 1
src/page-instrument/router.ts

@@ -34,7 +34,7 @@ const routes: RouteRecordRaw[] = [
 ];
 
 const router = createRouter({
-	history: createWebHashHistory('/notation/'),
+	history: createWebHashHistory(),
 	routes,
 });
 

+ 1 - 1
src/page-instrument/view-figner/index.tsx

@@ -53,7 +53,7 @@ export default defineComponent({
 				// console.log("🚀 ~ note:", note)
 				// console.log(`/soundfonts/${data.subject}/${note.name}${note.octave}.mp3`)
 				const noteAudio = new Howl({
-					src: `/soundfonts/${data.subject}/${note.name}${note.octave}.mp3`,
+					src: `${location.pathname.replace('.html', '/')}/soundfonts/${data.subject}/${note.name}${note.octave}.mp3`,
 					loop: true,
 				});
 				data.soundFonts[note.realKey] = noteAudio;