mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2025-02-11 02:44:16 +08:00
35 lines
729 B
TypeScript
35 lines
729 B
TypeScript
import request from '@/web/utils/request'
|
|
import {
|
|
FetchAlbumParams,
|
|
FetchAlbumResponse,
|
|
LikeAAlbumParams,
|
|
LikeAAlbumResponse,
|
|
} from '@/shared/api/Album'
|
|
|
|
// 专辑详情
|
|
export function fetchAlbum(
|
|
params: FetchAlbumParams,
|
|
noCache: boolean
|
|
): Promise<FetchAlbumResponse> {
|
|
const otherParams: { timestamp?: number } = {}
|
|
if (noCache) otherParams.timestamp = new Date().getTime()
|
|
return request({
|
|
url: '/album',
|
|
method: 'get',
|
|
params: { ...params, ...otherParams },
|
|
})
|
|
}
|
|
|
|
export function likeAAlbum(
|
|
params: LikeAAlbumParams
|
|
): Promise<LikeAAlbumResponse> {
|
|
return request({
|
|
url: '/album/sub',
|
|
method: 'post',
|
|
params: {
|
|
...params,
|
|
timestamp: Date.now(),
|
|
},
|
|
})
|
|
}
|