feat: 添加设置页面 可配置代理开关

This commit is contained in:
alger
2023-12-28 10:45:11 +08:00
parent c7c1143cb4
commit a2c49d354e
12 changed files with 173 additions and 16 deletions
+11
View File
@@ -13,6 +13,7 @@ interface State {
user: any
playList: SongResult[]
playListIndex: number
setData: any
}
const state: State = {
@@ -24,8 +25,11 @@ const state: State = {
user: null,
playList: [],
playListIndex: 0,
setData: null,
}
const windowData = window as any
const mutations = {
setMenus(state: State, menus: any[]) {
state.menus = menus
@@ -62,6 +66,13 @@ const mutations = {
(state.playListIndex - 1 + state.playList.length) % state.playList.length
await updatePlayMusic(state)
},
async setSetData(state: State, setData: any) {
state.setData = setData
windowData.electron.ipcRenderer.setStoreValue(
'set',
JSON.parse(JSON.stringify(setData))
)
},
}
const getSongUrl = async (id: number) => {