瀏覽代碼

update Vben2/src/utils/http/axios/index.ts.
处理响应状态码

lpspig 3 年之前
父節點
當前提交
9be750ff2d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Vben2/src/utils/http/axios/index.ts

+ 1 - 0
Vben2/src/utils/http/axios/index.ts

@@ -153,6 +153,7 @@ const transform: AxiosTransform = {
    * @description: 响应拦截器处理
    */
   responseInterceptors: (res: AxiosResponse<any>) => {
+    checkStatus(res.data.code, res.data.message);
     return res;
   },