From a472d4a026ee7143d6a5b5bef11a15de0466a08c Mon Sep 17 00:00:00 2001 From: xiejiahe Date: Wed, 20 Dec 2023 19:50:37 +0800 Subject: [PATCH] fix: middleware ts --- src/store/middlewares.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/middlewares.ts b/src/store/middlewares.ts index 743142d..f86f7f4 100644 --- a/src/store/middlewares.ts +++ b/src/store/middlewares.ts @@ -1,10 +1,10 @@ -import { Middleware, PayloadAction } from '@reduxjs/toolkit' +import { Middleware } from '@reduxjs/toolkit' import { SET_USER_INFO } from '@/store/userSlice' import { LOCAL_STORAGE } from '@/constants' import { RootState } from '@/store/index' export const authMiddleware: Middleware<{}, RootState> = - (storeApi) => (next) => (action: PayloadAction) => { + () => (next) => (action: unknown) => { if (SET_USER_INFO.match(action) && !!action.payload.token) { localStorage.setItem(LOCAL_STORAGE.USER, JSON.stringify(action.payload)) localStorage.setItem(LOCAL_STORAGE.LOGIN_NAME, action.payload.loginName)