hooks.9e5ee122.js 1.5 KB

1
  1. import{w as n,n as a}from"./index.394decd7.js";const E={SEARCH:"music-songbook-subject",ALBUM:"music-album-subject",MUSIC:"music-subject",LIVE:"live-subject",VIDEO:"video-subject",ELEGANT:"elegant-subject",MUSIC_FREE:"music-list-free"},r=(e,u,l="get")=>{if(!e)return"";if(l==="get"){let t=localStorage.getItem(e);return t=t?JSON.parse(t):{name:"",id:""},t}else return localStorage.setItem(e,u),""};let o=!1;const g=async(e,u,l="POST")=>{try{if(o)return u;o=!0;const t=l==="POST"?await n.post(e,{requestType:u.requestType||"json",data:{...u.params}}):await n.get(e,{requestType:u.requestType||"json",params:{...u.params}});u.loading=!1;const s=t.data||{};u.list=u.list.concat(s.rows||[]),u.finished=s.pageNo>=s.totalPage,u.params.page=s.pageNo+1,u.dataShow=u.list.length>0}catch{u.dataShow=!1,u.finished=!0}return o=!1,u},c={\u4E13\u8F91:"klx_album",\u89C6\u9891\u8BFE:"klx_videoClass",\u76F4\u64AD\u8BFE:"klx_liveClass",\u8FBE\u4EBA\u98CE\u91C7:"klx_talentElegant",\u70ED\u95E8\u8D44\u8BAF:"klx_hotInformation",\u5C0F\u9177AI\u529F\u80FD\u57CB\u70B9:"klx_xiaokuAI",\u6211\u7684\u4E50\u8C31:"klx_myMusic",\u8BC4\u6D4B\u8BB0\u5F55:"klx_myEvaluation",\u8BA2\u5355:"klx_myOrder",\u4EA4\u6613\u8BB0\u5F55:"klx_myTrade",\u4F18\u60E0\u5238:"klx_myCoupon",\u5E2E\u52A9\u4E2D\u5FC3:"klx_helpCenter",\u5546\u54C1\u5217\u8868:"klx_goods",\u5546\u54C1\u8BE6\u60C5:"klx_goodDetail",\u8D2D\u4E70\u652F\u4ED8:"klx_payment",\u53D6\u6D88\u652F\u4ED8:"klx_cancelPayment"},k=e=>{a({api:"setEventTracking",content:{type:c[e]}})};export{E as S,r as a,g as b,k as u};