feat: support music quality options #33

master
qier222 4 years ago
parent c042faa001
commit d5ef383999

@ -1,12 +1,18 @@
import request from "@/utils/request"; import request from "@/utils/request";
import { mapTrackPlayableStatus } from "@/utils/common"; import { mapTrackPlayableStatus } from "@/utils/common";
import store from "@/store";
export function getMP3(id) { export function getMP3(id) {
let br =
store.state.settings?.musicQuality !== undefined
? store.state.settings.musicQuality
: 128000;
return request({ return request({
url: "/song/url", url: "/song/url",
method: "get", method: "get",
params: { params: {
id, id,
br,
}, },
}); });
} }

@ -103,4 +103,7 @@ export default {
changeLang(state, lang) { changeLang(state, lang) {
state.settings.lang = lang; state.settings.lang = lang;
}, },
changeMusicQuality(state, value) {
state.settings.musicQuality = value;
},
}; };

Loading…
Cancel
Save