|
@@ -110,15 +110,11 @@ export default defineComponent({
|
|
|
})
|
|
|
|
|
|
const toggleFavorite = async (id: number) => {
|
|
|
- // 如果是老师则不能收藏
|
|
|
- if (state.platformType === 'TEACHER') {
|
|
|
- return
|
|
|
- }
|
|
|
favoriteLoading.value = true
|
|
|
try {
|
|
|
- await request.post('/api-student/music/album/favorite/' + id, {
|
|
|
- // prefix:
|
|
|
- // state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
|
|
|
+ await request.post('/music/album/favorite/' + id, {
|
|
|
+ prefix:
|
|
|
+ state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
|
|
|
})
|
|
|
favorited.value = favorited.value === 1 ? 0 : 1
|
|
|
albumFavoriteCount.value += favorited.value ? 1 : -1
|
|
@@ -178,16 +174,14 @@ export default defineComponent({
|
|
|
</div>
|
|
|
<div class={styles.alumCollect}>
|
|
|
<img src={IconPan} />
|
|
|
- <span>共{albumDetail.value?.musicSheetCount}首曲目</span>
|
|
|
- {state.platformType === 'STUDENT' && (
|
|
|
- <div
|
|
|
+ <span>共{albumDetail.value?.musicSheetCount}首曲目{state.platformType}</span>
|
|
|
+ <div
|
|
|
class={styles.right}
|
|
|
onClick={() => toggleFavorite(albumDetail.value?.id)}
|
|
|
>
|
|
|
<img src={favorited.value ? iStart : oStart} />
|
|
|
<span>{albumFavoriteCount.value}人收藏</span>
|
|
|
</div>
|
|
|
- )}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class={styles.alumnContainer}>
|