|
|
|
@ -3,12 +3,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
|
|
import { create } from 'zustand';
|
|
|
|
|
import { devtools, persist, createJSONStorage } from 'zustand/middleware';
|
|
|
|
|
|
|
|
|
|
import { openLogin } from '@/components/Login/loginContext';
|
|
|
|
|
|
|
|
|
|
import { checkAuthOffline } from '@/utils/auth';
|
|
|
|
|
|
|
|
|
|
import { apiGetSongRandom } from '@/services';
|
|
|
|
|
import { logout } from '@/utils';
|
|
|
|
|
|
|
|
|
|
interface AuioState {
|
|
|
|
|
/** 播放状态 true: 播放 false: 暂停 */
|
|
|
|
@ -239,12 +234,6 @@ const useAudioState = create<AuioState>()(
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
setPlayListInfo: (list) => {
|
|
|
|
|
if (!checkAuthOffline()) {
|
|
|
|
|
localStorage.clear();
|
|
|
|
|
openLogin();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set(
|
|
|
|
|
produce((state) => {
|
|
|
|
|
state.playListInfo = list;
|
|
|
|
|