35 lines
729 B
TypeScript
Raw Normal View History

2022-05-12 02:45:43 +08:00
import request from '@/web/utils/request'
2022-04-16 21:14:03 +08:00
import {
FetchAlbumParams,
FetchAlbumResponse,
LikeAAlbumParams,
LikeAAlbumResponse,
} from '@/shared/api/Album'
2022-03-13 14:40:38 +08:00
// 专辑详情
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 },
})
}
2022-04-05 21:23:55 +08:00
export function likeAAlbum(
params: LikeAAlbumParams
): Promise<LikeAAlbumResponse> {
return request({
url: '/album/sub',
method: 'post',
params: {
...params,
timestamp: Date.now(),
},
})
}