Skip to content

Commit 1b6ebd9

Browse files
committed
✨ feat: 支持解锁配置
1 parent 7721251 commit 1b6ebd9

15 files changed

Lines changed: 283 additions & 51 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@
3232

3333
## 💬 交流群
3434

35+
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=2-cVSf1bE0AvAehCib00qFEFdUvPaJ_k&jump_from=webapi&authKey=1NEhib9+GsmsXVo2rCc0IbRaVHeeRXJJ0gbsyKDcIwDdAzYySOubkFCvkV32+7Cw" target="_blank">
36+
3537
![交流群](/screenshots/welcome.png)
3638

39+
</a>
40+
3741
## 👀 Demo
3842

3943
- [SPlayer](https://music.imsyy.top/)

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ declare module 'vue' {
146146
SongList: typeof import('./src/components/List/SongList.vue')['default']
147147
SongListCard: typeof import('./src/components/Card/SongListCard.vue')['default']
148148
SongListMenu: typeof import('./src/components/Menu/SongListMenu.vue')['default']
149+
SongUnlockManager: typeof import('./src/components/Modal/SongUnlockManager.vue')['default']
149150
SvgIcon: typeof import('./src/components/Global/SvgIcon.vue')['default']
150151
TextContainer: typeof import('./src/components/Global/TextContainer.vue')['default']
151152
UpdateApp: typeof import('./src/components/Modal/UpdateApp.vue')['default']

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@pixi/filter-color-matrix": "^7.4.3",
5050
"@pixi/sprite": "^7.4.3",
5151
"@vueuse/core": "^13.9.0",
52+
"@vueuse/integrations": "^14.0.0",
5253
"axios": "^1.13.2",
5354
"axios-retry": "^4.5.0",
5455
"change-case": "^5.4.4",
@@ -72,6 +73,7 @@
7273
"pinia": "^3.0.4",
7374
"pinia-plugin-persistedstate": "^4.7.1",
7475
"plyr": "^3.8.3",
76+
"sortablejs": "^1",
7577
"vue-virt-list": "^1.6.1"
7678
},
7779
"devDependencies": {

pnpm-lock.yaml

Lines changed: 91 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/song.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isElectron } from "@/utils/env";
22
import { songLevelData } from "@/utils/meta";
3+
import { SongUnlockServer } from "@/utils/songManager";
34
import request from "@/utils/request";
45

56
// 获取歌曲详情
@@ -47,16 +48,12 @@ export const songUrl = (
4748
};
4849

4950
// 获取解锁歌曲 URL
50-
export const unlockSongUrl = (
51-
id: number,
52-
keyword: string,
53-
server: "netease" | "kuwo" | "bodian",
54-
) => {
55-
const params = server === "netease" ? { id } : { keyword };
51+
export const unlockSongUrl = (id: number, keyword: string, server: SongUnlockServer) => {
52+
const params = server === SongUnlockServer.NETEASE ? { id } : { keyword };
5653
return request({
5754
baseURL: "/api/unblock",
5855
url: `/${server}`,
59-
params,
56+
params: { ...params, noCookie: true },
6057
});
6158
};
6259

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<template>
2+
<div class="song-unlock-manager">
3+
<n-alert title="免责声明" type="info">
4+
本功能仅作为测试使用,资源来自网络,若侵犯到您的权益,请及时联系我们删除
5+
</n-alert>
6+
<div ref="sortableRef" class="sortable-list">
7+
<n-card
8+
v-for="item in settingStore.songUnlockServer"
9+
:key="item.key"
10+
:content-style="{
11+
display: 'flex',
12+
alignItems: 'center',
13+
gap: '12px',
14+
padding: '16px',
15+
}"
16+
class="sortable-item"
17+
>
18+
<SvgIcon :depth="3" name="Menu" />
19+
<n-text class="name">{{ item.key }}</n-text>
20+
<n-switch v-model:value="item.enabled" :round="false" />
21+
</n-card>
22+
</div>
23+
</div>
24+
</template>
25+
26+
<script setup lang="ts">
27+
import { useSettingStore } from "@/stores";
28+
import { useSortable } from "@vueuse/integrations/useSortable";
29+
30+
const settingStore = useSettingStore();
31+
32+
const sortableRef = ref<HTMLElement | null>(null);
33+
34+
// 拖拽
35+
useSortable(sortableRef, settingStore.songUnlockServer, {
36+
animation: 150,
37+
handle: ".n-icon",
38+
});
39+
</script>
40+
41+
<style scoped lang="scss">
42+
.sortable-list {
43+
margin-top: 12px;
44+
display: flex;
45+
flex-direction: column;
46+
gap: 12px;
47+
.sortable-item {
48+
border-radius: 8px;
49+
.n-icon {
50+
font-size: 16px;
51+
cursor: move;
52+
}
53+
.name {
54+
font-size: 16px;
55+
line-height: normal;
56+
}
57+
.n-switch {
58+
margin-left: auto;
59+
}
60+
}
61+
}
62+
</style>

src/components/Player/MainAMLyric.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
<script setup lang="ts">
3636
import { LyricPlayer } from "@applemusic-like-lyrics/vue";
37-
import { LyricLine } from "@applemusic-like-lyrics/core";
37+
import { type LyricLine } from "@applemusic-like-lyrics/lyric";
3838
import { useMusicStore, useSettingStore, useStatusStore } from "@/stores";
3939
import { getLyricLanguage } from "@/utils/format";
4040
import { usePlayer } from "@/utils/player";

src/components/Setting/AboutSetting.vue

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
</n-card>
3737
</n-collapse-transition>
3838
</div>
39+
<div class="set-list">
40+
<n-h3 prefix="bar"> 社区与资讯 </n-h3>
41+
<n-flex class="link">
42+
<n-card
43+
v-for="(item, index) in communityData"
44+
:key="index"
45+
class="link-item"
46+
hoverable
47+
@click="openLink(item.url)"
48+
>
49+
<SvgIcon :name="item.icon" :size="26" />
50+
<n-text class="name"> {{ item.name }} </n-text>
51+
</n-card>
52+
</n-flex>
53+
</div>
3954
<div class="set-list">
4055
<n-h3 prefix="bar"> 历史版本 </n-h3>
4156
<n-collapse-transition :show="oldVersion?.length > 0">
@@ -59,21 +74,6 @@
5974
</n-collapse>
6075
</n-collapse-transition>
6176
</div>
62-
<div class="set-list">
63-
<n-h3 prefix="bar"> 社区与资讯 </n-h3>
64-
<n-flex class="link">
65-
<n-card
66-
v-for="(item, index) in communityData"
67-
:key="index"
68-
class="link-item"
69-
hoverable
70-
@click="openLink(item.url)"
71-
>
72-
<SvgIcon :name="item.icon" :size="26" />
73-
<n-text class="name"> {{ item.name }} </n-text>
74-
</n-card>
75-
</n-flex>
76-
</div>
7777
</div>
7878
</template>
7979

@@ -89,6 +89,11 @@ const statusStore = useStatusStore();
8989
9090
// 社区数据
9191
const communityData = [
92+
{
93+
name: "加入交流群",
94+
url: "https://qm.qq.com/cgi-bin/qm/qr?k=2-cVSf1bE0AvAehCib00qFEFdUvPaJ_k&jump_from=webapi&authKey=1NEhib9+GsmsXVo2rCc0IbRaVHeeRXJJ0gbsyKDcIwDdAzYySOubkFCvkV32+7Cw",
95+
icon: "QQ",
96+
},
9297
{
9398
name: "GitHub",
9499
url: packageJson.github,

src/components/Setting/LyricsSetting.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,7 @@
251251
<div class="label">
252252
<n-text class="name">
253253
启用在线 TTML 歌词
254-
<n-tag type="warning" size="small" round style="display: inline; vertical-align: middle"
255-
>Beta</n-tag
256-
>
254+
<n-tag type="warning" size="small" round> Beta </n-tag>
257255
</n-text>
258256
<n-text class="tip" :depth="3">
259257
是否从 AMLL TTML DB 获取歌词(如有),TTML

0 commit comments

Comments
 (0)