import HttpClient from '../Http' ; class AudioHttp { public static instance : AudioHttp = new AudioHttp ( ) ; constructor ( ) { } param id public async getMusicUrl ( id ) { const data = await HttpClient . init ( '/song/url?id=' + id , { method : "get" } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; return data ; } param key public async search ( key ) { return await HttpClient . init ( `/search?keywords=${ key }` , { method : 'get' } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; } } export default AudioHttp . instance ;