From 107838ae97654ea0a2a48027bda4d024ae21fc57 Mon Sep 17 00:00:00 2001 From: suhaotian Date: Thu, 25 Jul 2024 15:32:59 +1000 Subject: [PATCH] Update Readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 2b89bfd..6409108 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,12 @@ http.interceptors.request.use((config) => { http.interceptors.request.use((config) => { return config; }); + +async function getData() { + const { data } = await http.get('/'); + console.log(data); + return data; +} ``` Response interceptors: @@ -296,6 +302,12 @@ http.interceptors.response.use( return Promise.reject(error); } ); + +async function getData() { + const { data } = await http.get('/'); + console.log(data); + return data; +} ``` ### Cleanup interceptors