فهرست منبع

review:API 加密的实现,补充注释为主

YunaiV 4 ماه پیش
والد
کامیت
68a6d6ac4f
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      src/http/http.ts
  2. 1 1
      src/http/interceptor.ts

+ 1 - 1
src/http/http.ts

@@ -23,7 +23,7 @@ export function http<T>(options: CustomRequestOptions) {
       // 响应成功
       success: async (res) => {
         let responseData = res.data as IResponse<T>
-        // 检查是否需要解密响应数据
+        // add by panda:检查是否需要解密响应数据
         const encryptHeader = ApiEncrypt.getEncryptHeader()
         const isEncryptResponse = res.header[encryptHeader] === 'true' || res.header[encryptHeader.toLowerCase()] === 'true'
         if (isEncryptResponse && typeof responseData === 'string') {

+ 1 - 1
src/http/interceptor.ts

@@ -75,7 +75,7 @@ const httpInterceptor = {
       }
     }
 
-    // 5. 是否 API 加密
+    // 5. add by panda:是否 API 加密
     if (options.isEncrypt) {
       try {
         // 加密请求数据