Browse Source

Merge branch 'feature-tianyong'

TIANYONG 8 months ago
parent
commit
2e69604478
1 changed files with 23 additions and 4 deletions
  1. 23 4
      src/views/music/music-detail/index.tsx

+ 23 - 4
src/views/music/music-detail/index.tsx

@@ -329,8 +329,23 @@ export default defineComponent({
     })
 
     const toggleFavorite = async () => {
+      /**
+       * 酷乐秀老师端 收藏曲目 music/sheet/favorite/id?providerType=?? 添加参数
+       * @ApiModelProperty("曲目评测来源 TENANT 机构 PLATFORM 平台")
+       * private String providerType;
+       * 表示收藏的是机构曲目,还是平台曲目,
+       */
+      let apiUrl = '', providerType = ''
+      if (browser().isTeacher) {
+        providerType = state.projectType === 'tenant' ? 'TENANT' : 'PLATFORM'
+      }
+      apiUrl = `/music/sheet/favorite/${musicDetail.value?.id}`
       try {
-        await request.post('/music/sheet/favorite/' + musicDetail.value?.id, {
+        await request.post(apiUrl, {
+          requestType: 'form',
+          data: {
+            providerType
+          },
           prefix:
             state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
         })
@@ -1147,10 +1162,14 @@ export default defineComponent({
                         // )
                         // 新版云教练的谱面类型使用musicRenderType字段
                         const musicRenderType = staff.radio === 'staff' ? 'staff' : staff.radio === 'first' ? 'firstTone' :  staff.radio === 'fixed' ? 'fixedTone' : '';
-                        musicBuy(musicDetail.value, () => {}, {
+                        let extraParam = {
                           'part-index': item?.xmlValue || 0,
-                          musicRenderType
-                        })
+                          musicRenderType,
+                        }
+                        if (route.query.tenantAlbumId) {
+                          extraParam.albumId = route.query.tenantAlbumId
+                        }
+                        musicBuy(musicDetail.value, () => {}, extraParam)
                       }, 500)
 
                       throttleFn()