feat: updates

This commit is contained in:
qier222 2022-06-25 13:47:07 +08:00
parent f340a90117
commit cec4c5909d
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
50 changed files with 1304 additions and 207 deletions

View file

@ -1,4 +1,8 @@
import { FetchArtistAlbumsResponse, FetchArtistResponse } from './api/Artist'
import {
FetchArtistAlbumsResponse,
FetchArtistResponse,
FetchSimilarArtistsResponse,
} from './api/Artist'
import { FetchAlbumResponse } from './api/Album'
import {
FetchUserAccountResponse,
@ -32,6 +36,7 @@ export const enum APIs {
UserAlbums = 'album/sublist',
UserArtists = 'artist/sublist',
UserPlaylist = 'user/playlist',
SimilarArtist = 'simi/artist',
// not netease api
CoverColor = 'cover_color',
@ -53,6 +58,7 @@ export interface APIsParams {
[APIs.UserAlbums]: void
[APIs.UserArtists]: void
[APIs.UserPlaylist]: void
[APIs.SimilarArtist]: { id: number }
[APIs.CoverColor]: { id: number }
[APIs.VideoCover]: { id: number }
}
@ -72,6 +78,7 @@ export interface APIsResponse {
[APIs.UserAlbums]: FetchUserAlbumsResponse
[APIs.UserArtists]: FetchUserArtistsResponse
[APIs.UserPlaylist]: FetchUserPlaylistsResponse
[APIs.SimilarArtist]: FetchSimilarArtistsResponse
[APIs.CoverColor]: string | undefined
[APIs.VideoCover]: string | undefined
}

View file

@ -1,6 +1,7 @@
export enum ArtistApiNames {
FetchArtist = 'fetchArtist',
FetchArtistAlbums = 'fetchArtistAlbums',
FetchSimilarArtists = 'fetchSimilarArtists',
}
// 歌手详情
@ -26,3 +27,12 @@ export interface FetchArtistAlbumsResponse {
more: boolean
artist: Artist
}
// 获取相似歌手
export interface FetchSimilarArtistsParams {
id: number
}
export interface FetchSimilarArtistsResponse {
code: number
artists: Artist[]
}

View file

@ -1,7 +1,11 @@
export interface Store {
uiStates: {
loginPhoneCountryCode: string
showLyricPanel: boolean
showLoginPanel: boolean
}
persistedUiStates: {
loginPhoneCountryCode: string
loginType: 'phone' | 'email' | 'qrCode'
}
settings: {
showSidebar: boolean
@ -29,8 +33,12 @@ export interface Store {
export const initialState: Store = {
uiStates: {
loginPhoneCountryCode: '+86',
showLyricPanel: false,
showLoginPanel: false,
},
persistedUiStates: {
loginPhoneCountryCode: '+86',
loginType: 'qrCode',
},
settings: {
showSidebar: true,