@pisell/core 1.0.3 → 1.0.4
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/es/request/index.js +3 -6
- package/lib/request/index.js +1 -5
- package/package.json +1 -1
package/es/request/index.js
CHANGED
|
@@ -10,17 +10,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
10
10
|
import { createSignal } from "./cancelToken";
|
|
11
11
|
import { axiosConfig } from "./constants";
|
|
12
12
|
import { cacheFn } from "./cache";
|
|
13
|
-
import { interceptorsResponse, interceptorsRequestError, interceptorsResponseError, requestCallback } from "./utils";
|
|
13
|
+
import { interceptorsRequest, interceptorsResponse, interceptorsRequestError, interceptorsResponseError, requestCallback } from "./utils";
|
|
14
14
|
import axios from "axios";
|
|
15
15
|
import { getConfig, setConfig } from "./config";
|
|
16
16
|
// 实例
|
|
17
17
|
var axiosInstance = axios.create(axiosConfig);
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
// 请求拦截器
|
|
20
|
-
axiosInstance.interceptors.request.use(
|
|
21
|
-
console.log('config11', config);
|
|
22
|
-
return config;
|
|
23
|
-
}, interceptorsRequestError);
|
|
20
|
+
axiosInstance.interceptors.request.use(interceptorsRequest, interceptorsRequestError);
|
|
24
21
|
|
|
25
22
|
// 响应拦截器
|
|
26
23
|
axiosInstance.interceptors.response.use(interceptorsResponse, interceptorsResponseError);
|
package/lib/request/index.js
CHANGED
|
@@ -48,11 +48,7 @@ var import_axios = __toESM(require("axios"));
|
|
|
48
48
|
var import_config = require("./config");
|
|
49
49
|
__reExport(request_exports, require("./type"), module.exports);
|
|
50
50
|
var axiosInstance = import_axios.default.create(import_constants.axiosConfig);
|
|
51
|
-
|
|
52
|
-
axiosInstance.interceptors.request.use((config) => {
|
|
53
|
-
console.log("config11", config);
|
|
54
|
-
return config;
|
|
55
|
-
}, import_utils.interceptorsRequestError);
|
|
51
|
+
axiosInstance.interceptors.request.use(import_utils.interceptorsRequest, import_utils.interceptorsRequestError);
|
|
56
52
|
axiosInstance.interceptors.response.use(import_utils.interceptorsResponse, import_utils.interceptorsResponseError);
|
|
57
53
|
var createRequest = (props) => {
|
|
58
54
|
const { data, config, method } = props;
|