First look at the effect: ^_^

API

Example Convert the address of the back-end interface to an enumeration

ModelApi

Use declare Module to define a module

RequestParams:

Define the parameters of the request

BaseParams:

Wrap the parameters of the request, in this case axios, so the parameters are ** URL, and data**

BasePage:

Defines the uniform parameters for the list

Use:

Each parameter definition is separated by |!

RequestRes:

Interface return definition

BaseListRes:

Uniform return of the list of definitions (see interface definition)

Use:

Use in the POST method (same as get) :

axios

Use axios to request

Conclusion:

The point is to use the type keyword and/or operator “|” so that the corresponding field in data can be derived when the URL parameter is matched! ( ^o^ )