@lark-apaas/client-toolkit 1.1.29-react-query.test.0 → 1.1.29
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/lib/components/AppContainer/index.js +11 -14
- package/lib/utils/getAxiosForBackend.d.ts +0 -7
- package/lib/utils/getAxiosForBackend.js +0 -7
- package/package.json +3 -4
- package/lib/apis/components/QueryProvider.d.ts +0 -1
- package/lib/apis/components/QueryProvider.js +0 -2
- package/lib/components/QueryProvider/index.d.ts +0 -10
- package/lib/components/QueryProvider/index.js +0 -27
|
@@ -16,7 +16,6 @@ import { TrackKey } from "../../types/tea.js";
|
|
|
16
16
|
import safety from "./safety.js";
|
|
17
17
|
import { getAppId } from "../../utils/getAppId.js";
|
|
18
18
|
import { ServerLogPoller } from "../../server-log/index.js";
|
|
19
|
-
import QueryProvider from "../QueryProvider/index.js";
|
|
20
19
|
registerDayjsPlugins();
|
|
21
20
|
initAxiosConfig();
|
|
22
21
|
const isMiaodaPreview = window.IS_MIAODA_PREVIEW;
|
|
@@ -222,19 +221,17 @@ const AppContainer_AppContainer = (props)=>{
|
|
|
222
221
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
223
222
|
children: [
|
|
224
223
|
/*#__PURE__*/ jsx(safety, {}),
|
|
225
|
-
/*#__PURE__*/ jsx(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
children: children
|
|
237
|
-
})
|
|
224
|
+
/*#__PURE__*/ jsx(ConfigProvider, {
|
|
225
|
+
theme: {
|
|
226
|
+
token: antdThemeToken,
|
|
227
|
+
components: {
|
|
228
|
+
Table: antdTableToken,
|
|
229
|
+
Pagination: antdPaginationToken
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
children: /*#__PURE__*/ jsx(App, {
|
|
233
|
+
themeMeta: props.themeMeta,
|
|
234
|
+
children: children
|
|
238
235
|
})
|
|
239
236
|
})
|
|
240
237
|
]
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
declare module 'axios' {
|
|
3
|
-
interface AxiosRequestConfig {
|
|
4
|
-
meta?: {
|
|
5
|
-
autoJumpToLogin?: boolean;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
2
|
/** 获取axios实例 */
|
|
10
3
|
export declare function getAxiosForBackend(): AxiosInstance;
|
|
11
4
|
export declare const axiosForBackend: AxiosInstance;
|
|
@@ -6,13 +6,6 @@ function getAxiosForBackend() {
|
|
|
6
6
|
axiosInstance = axios.create({
|
|
7
7
|
baseURL: process.env.CLIENT_BASE_PATH || '/'
|
|
8
8
|
});
|
|
9
|
-
axiosInstance.interceptors.response.use(null, (err)=>{
|
|
10
|
-
if (err.config.meta?.autoJumpToLogin !== false) {
|
|
11
|
-
const loginUrl = err.response?.headers?.['x-login-url'];
|
|
12
|
-
if (loginUrl) window.location.href = loginUrl;
|
|
13
|
-
}
|
|
14
|
-
return Promise.reject(err);
|
|
15
|
-
});
|
|
16
9
|
initAxiosConfig(axiosInstance);
|
|
17
10
|
}
|
|
18
11
|
return axiosInstance;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/client-toolkit",
|
|
3
|
-
"version": "1.1.29
|
|
3
|
+
"version": "1.1.29",
|
|
4
4
|
"types": "./lib/index.d.ts",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -148,11 +148,10 @@
|
|
|
148
148
|
"vitest": "^3.2.4"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
|
-
"@tanstack/react-query": "^5.90.12",
|
|
152
151
|
"antd": ">=5.26.6",
|
|
152
|
+
"styled-jsx": ">=5.0.0",
|
|
153
153
|
"react": ">=16.14.0",
|
|
154
154
|
"react-dom": ">=16.14.0",
|
|
155
|
-
"react-router-dom": ">=6.26.2"
|
|
156
|
-
"styled-jsx": ">=5.0.0"
|
|
155
|
+
"react-router-dom": ">=6.26.2"
|
|
157
156
|
}
|
|
158
157
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as QueryProvider, getDefaultQueryClient } from '../../components/QueryProvider';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
-
declare const getDefaultQueryClient: () => QueryClient;
|
|
4
|
-
export type QueryProviderProps = {
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
client?: QueryClient;
|
|
7
|
-
};
|
|
8
|
-
declare const QueryProvider: React.FC<QueryProviderProps>;
|
|
9
|
-
export default QueryProvider;
|
|
10
|
-
export { getDefaultQueryClient };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
4
|
-
let defaultQueryClient = null;
|
|
5
|
-
const getDefaultQueryClient = ()=>{
|
|
6
|
-
if (!defaultQueryClient) defaultQueryClient = new QueryClient({
|
|
7
|
-
defaultOptions: {
|
|
8
|
-
queries: {
|
|
9
|
-
retry: 1,
|
|
10
|
-
refetchOnWindowFocus: false
|
|
11
|
-
},
|
|
12
|
-
mutations: {
|
|
13
|
-
retry: 1
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return defaultQueryClient;
|
|
18
|
-
};
|
|
19
|
-
const QueryProvider = ({ children, client })=>{
|
|
20
|
-
const qc = client ?? getDefaultQueryClient();
|
|
21
|
-
return /*#__PURE__*/ jsx(QueryClientProvider, {
|
|
22
|
-
client: qc,
|
|
23
|
-
children: children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const components_QueryProvider = QueryProvider;
|
|
27
|
-
export { components_QueryProvider as default, getDefaultQueryClient };
|