This commit is contained in:
yinjun.chen1
2024-06-30 16:33:50 +08:00
parent b5e15f10e3
commit e5ceb6d487
2 changed files with 1 additions and 1 deletions
-1
View File
@@ -15,7 +15,6 @@ export default function App(){
const reload=()=>{ const reload=()=>{
dispatch(fetchUsers()) dispatch(fetchUsers())
console.log(fetchUsers())
} }
return ( return (
<div> <div>
@@ -46,6 +46,7 @@ const _callQueryResult = () => {
}) })
} }
const fetchUsers = () => async (dispatch) => { const fetchUsers = () => async (dispatch) => {
console.log(dispatch)
// 发送异步请求 // 发送异步请求
const data = await _callQueryResult(); const data = await _callQueryResult();
// 派发action,更新state.list // 派发action,更新state.list