Browse Source

feat: 平台、机构逻辑修改

TIANYONG 3 months ago
parent
commit
dc2d992b40
3 changed files with 7 additions and 1 deletions
  1. 1 0
      src/page-instrument/view-detail/index.tsx
  2. 2 0
      src/state.ts
  3. 4 1
      src/utils/baseApi.ts

+ 1 - 0
src/page-instrument/view-detail/index.tsx

@@ -162,6 +162,7 @@ export default defineComponent({
       state.isPreView = query.isPreView;
       state.isWeb = query.systemType === 'web';
       state.tenantAlbumId = query.albumId;
+      state.providerType = query.providerType || state.providerType;
       if (state.isPreView) {
         state.zoom = query.zoom  || 0.65
       }

+ 2 - 0
src/state.ts

@@ -612,6 +612,8 @@ const state = reactive({
   musicPrice: 0,
   /** 专辑id */
   tenantAlbumId: '',
+  /** 平台或者机构 */
+  providerType: "PLATFORM" as "PLATFORM" | "TENANT",
 });
 const browserInfo = browser();
 let offset_duration = 0;

+ 4 - 1
src/utils/baseApi.ts

@@ -10,7 +10,10 @@ import state from "/src/state";
 
 /** 获取内容平台的曲谱详情 */
 export const getMusicSheetDetail = (sysMusicScoreId: string, type?: string, musicId?: string) => {
-  const url = type === 'open' ? `/open/musicSheet/cbsDetail/${sysMusicScoreId}?userMusicId=${musicId}` : `/musicSheet/cbsDetail/${sysMusicScoreId}?tenantAlbumId=${state.tenantAlbumId}`;
+  let url = type === 'open' ? `/open/musicSheet/cbsDetail/${sysMusicScoreId}?userMusicId=${musicId}` : `/musicSheet/cbsDetail/${sysMusicScoreId}?tenantAlbumId=${state.tenantAlbumId}`;
+  if (state.systemType === 'web') {
+    url += `&providerType=${state.providerType}`
+  }
   return request.get(url, { noToken: type === 'open' ? true : false });
 };