Selaa lähdekoodia

测试播放功能

zhangyujun 3 vuotta sitten
vanhempi
commit
c483731e02
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 3 3
      src/api/modules/lighting.ts
  2. 2 1
      src/hooks/light/audio.ts

+ 3 - 3
src/api/modules/lighting.ts

@@ -26,12 +26,12 @@ interface lightingCombinationIdRes {
         icon: string,
         voice: string,
         process: number,
-        isSelect?:Boolean
+        isSelect?: Boolean
     }]
 
 
 }
-export interface lightingItemListRes{
+interface lightingItemListRes {
     code: number,
     msg: string,
     rows: [{
@@ -54,7 +54,7 @@ export async function lightingCombinationList() {
     });
     return res.data;
 }
-export async function lightingCombinationId(id:number) {
+export async function lightingCombinationId(id: number) {
     let res: AxiosResponse<lightingCombinationIdRes> = await request({
         url: "/lighting/combination/" + id,
         method: "get",

+ 2 - 1
src/hooks/light/audio.ts

@@ -17,12 +17,13 @@ export function useAudio() {
     let playAudio = (url: string) => {
         stopAudio()
         sound = new Howl({
-            src: [url]
+            src: url
         });
         return new Promise((resolve, reject) => {
             sound.once("load", function () {
                 let id = sound.play();
                 if (id) {
+                    alert(id)
                     resolve(id)
                 }
                 else {