cosey 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config/http.d.ts CHANGED
@@ -58,6 +58,10 @@ export declare const defaultHttpConfig: {
58
58
  * 错误提示显示时长
59
59
  */
60
60
  errorDuration: number;
61
+ /**
62
+ * 是否直接返回 AxiosResponse 对象
63
+ */
64
+ originalResponse: boolean;
61
65
  };
62
66
  export type HttpConfig = DeepPartial<typeof defaultHttpConfig>;
63
67
  export type RequiredHttpConfig = typeof defaultHttpConfig;
package/config/http.js CHANGED
@@ -53,7 +53,11 @@ const defaultHttpConfig = {
53
53
  /**
54
54
  * 错误提示显示时长
55
55
  */
56
- errorDuration: 3e3
56
+ errorDuration: 3e3,
57
+ /**
58
+ * 是否直接返回 AxiosResponse 对象
59
+ */
60
+ originalResponse: false
57
61
  };
58
62
 
59
63
  export { defaultHttpConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -60,6 +60,9 @@ function useRequest(config = {}, useHttpConfig) {
60
60
  );
61
61
  axiosIns.interceptors.response.use(
62
62
  (response) => {
63
+ if (mergedHttpConfig.originalResponse) {
64
+ return response;
65
+ }
63
66
  const { data: resData } = response;
64
67
  return handleError(resData, mergedHttpConfig);
65
68
  },