iboot-http-client 1.2.8 → 1.2.9
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/dist/iboot-http-client.cjs.js +2 -2
- package/dist/iboot-http-client.cjs.js.map +1 -1
- package/dist/iboot-http-client.es.js +438 -428
- package/dist/iboot-http-client.es.js.map +1 -1
- package/dist/iboot-http-client.umd.js +2 -2
- package/dist/iboot-http-client.umd.js.map +1 -1
- package/dist/types/http-client.d.ts +2 -1
- package/dist/types/types/http.d.ts +3 -1
- package/dist/types/types/router.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClientGetParams, ClientPostParams, CurWebsite, ServerHttpOpts, HttpToken, ResultModel, ServerRequestOptions, ICookies, IStorage, ServerHttpOptsMin } from './types/http';
|
|
2
2
|
import { User } from './types/user';
|
|
3
|
+
import { ResponseContext } from './router';
|
|
3
4
|
export declare const setClientRequestHeader: ({ deviceId, website }: Readonly<{
|
|
4
5
|
deviceId: string;
|
|
5
6
|
website?: CurWebsite;
|
|
@@ -17,7 +18,7 @@ export declare const getLoginUser: (cookies: ICookies) => User | undefined;
|
|
|
17
18
|
export declare const getToken: (cookies: ICookies) => HttpToken | undefined;
|
|
18
19
|
export declare const setToken: (data: User & {
|
|
19
20
|
token: string;
|
|
20
|
-
},
|
|
21
|
+
}, res: ResponseContext) => void;
|
|
21
22
|
export declare const cleanToken: (cookies: ICookies) => void;
|
|
22
23
|
export declare class HttpClient {
|
|
23
24
|
private readonly baseUrl;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ResultModel } from './http';
|
|
1
|
+
import { ICookies, ResultModel } from './http';
|
|
2
2
|
export type ContentType = 'application/json' | 'multipart/form-data' | 'application/x-www-form-urlencoded';
|
|
3
3
|
export interface RequestContext {
|
|
4
4
|
url: URL;
|
|
@@ -17,6 +17,7 @@ export interface ResponseContext {
|
|
|
17
17
|
options?: any;
|
|
18
18
|
}>;
|
|
19
19
|
body: ResultModel<any>;
|
|
20
|
+
cleanCookies?: (cookies: ICookies) => void;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* 路由处理适配器
|