diff --git a/src/api/track.js b/src/api/track.js index 0977a83..1bbcfe8 100644 --- a/src/api/track.js +++ b/src/api/track.js @@ -1,12 +1,18 @@ import request from "@/utils/request"; import { mapTrackPlayableStatus } from "@/utils/common"; +import store from "@/store"; export function getMP3(id) { + let br = + store.state.settings?.musicQuality !== undefined + ? store.state.settings.musicQuality + : 128000; return request({ url: "/song/url", method: "get", params: { id, + br, }, }); } diff --git a/src/store/mutations.js b/src/store/mutations.js index 428701a..0dde032 100644 --- a/src/store/mutations.js +++ b/src/store/mutations.js @@ -103,4 +103,7 @@ export default { changeLang(state, lang) { state.settings.lang = lang; }, + changeMusicQuality(state, value) { + state.settings.musicQuality = value; + }, };