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