Explorar o código

docs(http): 添加关于alova请求流程的注释说明

在拦截器文件中添加注释,说明当使用alova时的请求流程顺序
feige996 hai 7 meses
pai
achega
c6a685fa6c
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      src/http/interceptor.ts

+ 5 - 0
src/http/interceptor.ts

@@ -10,6 +10,11 @@ const baseUrl = getEnvBaseUrl()
 const httpInterceptor = {
   // 拦截前触发
   invoke(options: CustomRequestOptions) {
+    // 如果您使用了alova,则请把下面的代码放开注释
+    // alova 执行流程:alova beforeRequest --> 本拦截器 --> alova responded
+    // return options
+
+    // 非 alova 请求,正常执行
     // 接口请求支持通过 query 参数配置 queryString
     if (options.query) {
       const queryStr = stringifyQuery(options.query)