Server Strategy
Like using a component library, you can learn it when you need a specific request strategy!
The following is the specification of server hooks, which receives a method instance and returns a new method instance, so it is very convenient to combine multiple server hooks.
/**
* Server hook model, representing the types of all server hooks.
* Pass a method or hooked method instance, set options, and return a hooked method instance.
* You can continue to modify this method to achieve the effect of combining multiple server hooks.
*/
export interface AlovaServerHook<Options extends Record<string, any>> {
(method: Method, options: Options): Method;
}
Table of contents
📄️ Request retry strategy
server hook
📄️ Send Captcha
Send the captcha via SMS or email, and record the countdown time according to the key. If you send the captcha again within the countdown, an error will be reported.
📄️ Request Rate Limit
server hook