@dj1029/plugin-smart-sl 0.0.21 → 0.0.23
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+BAGX,CAAC;
|
|
1
|
+
{"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+BAGX,CAAC;AAkIH,eAAe,OAAO,CAAA;AAGtB,qBACa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAC;;IAqBtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAC,IAAI,CAAC,EAAE,GAAG;IAI1B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAK/B"}
|
|
@@ -15,6 +15,10 @@ const service = axios.create({
|
|
|
15
15
|
service.interceptors.request.use(config => {
|
|
16
16
|
// 是否需要设置 token
|
|
17
17
|
console.log("axios1 ---- config ---- ", config);
|
|
18
|
+
const isToken = config.headers.isToken === false;
|
|
19
|
+
if (!isToken) {
|
|
20
|
+
config.headers['Authorization'] = `Bearer ${config.headers.token}`;
|
|
21
|
+
}
|
|
18
22
|
// get请求映射params参数
|
|
19
23
|
if (config.method === 'get' && config.params) {
|
|
20
24
|
let url = config.url + '?' + tansParams(config.params);
|
package/dist/lib/tool.d.ts
CHANGED
package/dist/lib/tool.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;yDAqC7B"}
|
package/dist/lib/tool.js
CHANGED
|
@@ -15,12 +15,12 @@ export function buildSmartTool() {
|
|
|
15
15
|
method: 'post',
|
|
16
16
|
data: input,
|
|
17
17
|
headers: {
|
|
18
|
-
isToken: false
|
|
19
|
-
|
|
18
|
+
isToken: false,
|
|
19
|
+
token: 'abcdefghijklmnopqrstuvwsyz'
|
|
20
|
+
}
|
|
20
21
|
});
|
|
21
22
|
console.log("req ---------- ", req);
|
|
22
|
-
|
|
23
|
-
return req.data.token;
|
|
23
|
+
return req;
|
|
24
24
|
}
|
|
25
25
|
catch (error) {
|
|
26
26
|
return "I don't know how to do that because: " + getErrorMessage(error);
|