Install dependencies,
$ yarn
Start the dev server,
$ yarn start
umi has provided mock function, we can use it refer to https://umijs.org/zh-CN/docs/mock
We provided two methods to initiate a http request
-
use src/utils/request This method we use
umi-request
and add someinterceptors
to suite our json data and handle errors. -
use ahook's useRequest hook
ahook
is a library fromalibaba
, you can find more details from https://ahooks.js.org/zh-CN/hooks/async
We provided two demo pages to show how to interact with backend. You can visit /hooks-page to find development method without dva.
You also can visit /model-page to find development method with dva.