@vef-framework/core 1.0.99 → 1.0.101
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/api/api-client.js +1 -1
- package/es/api/api-context.js +1 -1
- package/es/api/index.js +1 -1
- package/es/api/query-client.js +1 -1
- package/es/api/request-client.js +8 -8
- package/es/auth/auth-context.js +1 -1
- package/es/auth/index.js +1 -1
- package/es/expr/compiler.js +1 -1
- package/es/expr/helpers.js +1 -1
- package/es/index.js +1 -1
- package/es/middleware/dispatcher.js +1 -1
- package/lib/api/api-client.cjs +1 -1
- package/lib/api/api-context.cjs +1 -1
- package/lib/api/index.cjs +1 -1
- package/lib/api/query-client.cjs +1 -1
- package/lib/api/request-client.cjs +8 -8
- package/lib/auth/auth-context.cjs +1 -1
- package/lib/auth/index.cjs +1 -1
- package/lib/expr/compiler.cjs +1 -1
- package/lib/expr/helpers.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/middleware/dispatcher.cjs +1 -1
- package/package.json +2 -2
package/es/api/api-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { useQuery, keepPreviousData, useSuspenseQuery, useMutation, useIsFetching, useIsMutating, QueryClientProvider } from '@tanstack/react-query';
|
|
3
3
|
import { createElement } from 'react';
|
|
4
4
|
import { createQueryClient } from './query-client.js';
|
package/es/api/api-context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { VefError } from '@vef-framework/shared';
|
|
3
3
|
import { createContext, useMemo, createElement, useContext } from 'react';
|
|
4
4
|
|
package/es/api/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
export { ApiClient, createApiClient } from './api-client.js';
|
|
3
3
|
export { ApiContextProvider, useApiContext } from './api-context.js';
|
|
4
4
|
export { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
package/es/api/query-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
|
|
4
4
|
function createQueryClient(options) {
|
package/es/api/request-client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { isNullish, showInfoMessage, showWarningMessage, VefError, isString, showErrorMessage, isFunction } from '@vef-framework/shared';
|
|
3
3
|
import axios, { CanceledError } from 'axios';
|
|
4
4
|
import qs from 'qs';
|
|
@@ -72,10 +72,10 @@ class RequestClient {
|
|
|
72
72
|
} else if (code === unauthorizedCode) {
|
|
73
73
|
await onUnauthorized?.();
|
|
74
74
|
} else if (code === tokenExpiredCode) {
|
|
75
|
-
showInfoMessage("
|
|
75
|
+
showInfoMessage("登录已失效");
|
|
76
76
|
await onUnauthorized?.();
|
|
77
77
|
} else if (code === accessDeniedCode) {
|
|
78
|
-
showWarningMessage(`${message}
|
|
78
|
+
showWarningMessage(`${message},请联系管理员为您开通`);
|
|
79
79
|
await onAccessDenied?.();
|
|
80
80
|
} else {
|
|
81
81
|
showWarningMessage(message);
|
|
@@ -88,19 +88,19 @@ class RequestClient {
|
|
|
88
88
|
}
|
|
89
89
|
const { response, message } = error;
|
|
90
90
|
if (response?.data) {
|
|
91
|
-
const errorMessage =
|
|
91
|
+
const errorMessage = `处理请求响应信息异常:${message ?? "无"}`;
|
|
92
92
|
return Promise.reject(new VefError(response.status, errorMessage));
|
|
93
93
|
} else {
|
|
94
94
|
let errorMessage = message ?? (isString(error) ? error : "");
|
|
95
95
|
if (errorMessage === "Network Error") {
|
|
96
|
-
errorMessage = "
|
|
96
|
+
errorMessage = "接口连接异常可能原因:网络不通或存在跨域问题。";
|
|
97
97
|
} else if (errorMessage.includes("timeout")) {
|
|
98
|
-
errorMessage = "
|
|
98
|
+
errorMessage = "接口请求超时";
|
|
99
99
|
} else if (errorMessage.includes("Request failed with status code")) {
|
|
100
100
|
const code = message.substring(message.length - 3);
|
|
101
|
-
errorMessage =
|
|
101
|
+
errorMessage = `接口状态码异常:${code}`;
|
|
102
102
|
} else {
|
|
103
|
-
errorMessage = "
|
|
103
|
+
errorMessage = "接口未知异常";
|
|
104
104
|
}
|
|
105
105
|
showErrorMessage(errorMessage);
|
|
106
106
|
return Promise.reject(new VefError(-1, errorMessage));
|
package/es/auth/auth-context.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { isString, VefError } from '@vef-framework/shared';
|
|
3
3
|
import { createContext, useMemo, createElement, useContext } from 'react';
|
|
4
4
|
|
package/es/auth/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
export { AuthContextProvider, useAuthContext } from './auth-context.js';
|
|
3
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/expr/compiler.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import { parseArgs, getAt, isQuotedString, rmEscapes } from './helpers.js';
|
|
3
3
|
|
|
4
4
|
function compile(expr) {
|
package/es/expr/helpers.js
CHANGED
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
import './api/index.js';
|
|
3
3
|
import './auth/index.js';
|
|
4
4
|
export { compile } from './expr/compiler.js';
|
package/lib/api/api-client.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/api/api-context.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/api/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/api/query-client.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
@@ -76,10 +76,10 @@ class RequestClient {
|
|
|
76
76
|
} else if (code === unauthorizedCode) {
|
|
77
77
|
await onUnauthorized?.();
|
|
78
78
|
} else if (code === tokenExpiredCode) {
|
|
79
|
-
shared.showInfoMessage("
|
|
79
|
+
shared.showInfoMessage("登录已失效");
|
|
80
80
|
await onUnauthorized?.();
|
|
81
81
|
} else if (code === accessDeniedCode) {
|
|
82
|
-
shared.showWarningMessage(`${message}
|
|
82
|
+
shared.showWarningMessage(`${message},请联系管理员为您开通`);
|
|
83
83
|
await onAccessDenied?.();
|
|
84
84
|
} else {
|
|
85
85
|
shared.showWarningMessage(message);
|
|
@@ -92,19 +92,19 @@ class RequestClient {
|
|
|
92
92
|
}
|
|
93
93
|
const { response, message } = error;
|
|
94
94
|
if (response?.data) {
|
|
95
|
-
const errorMessage =
|
|
95
|
+
const errorMessage = `处理请求响应信息异常:${message ?? "无"}`;
|
|
96
96
|
return Promise.reject(new shared.VefError(response.status, errorMessage));
|
|
97
97
|
} else {
|
|
98
98
|
let errorMessage = message ?? (shared.isString(error) ? error : "");
|
|
99
99
|
if (errorMessage === "Network Error") {
|
|
100
|
-
errorMessage = "
|
|
100
|
+
errorMessage = "接口连接异常可能原因:网络不通或存在跨域问题。";
|
|
101
101
|
} else if (errorMessage.includes("timeout")) {
|
|
102
|
-
errorMessage = "
|
|
102
|
+
errorMessage = "接口请求超时";
|
|
103
103
|
} else if (errorMessage.includes("Request failed with status code")) {
|
|
104
104
|
const code = message.substring(message.length - 3);
|
|
105
|
-
errorMessage =
|
|
105
|
+
errorMessage = `接口状态码异常:${code}`;
|
|
106
106
|
} else {
|
|
107
|
-
errorMessage = "
|
|
107
|
+
errorMessage = "接口未知异常";
|
|
108
108
|
}
|
|
109
109
|
shared.showErrorMessage(errorMessage);
|
|
110
110
|
return Promise.reject(new shared.VefError(-1, errorMessage));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/auth/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/expr/compiler.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/expr/helpers.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
1
|
+
/*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:14.569Z, made by Venus. */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vef-framework/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.101",
|
|
5
5
|
"private": false,
|
|
6
6
|
"packageManager": "pnpm@9.15.0",
|
|
7
7
|
"description": "The core of the VEF framework",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"use-sync-external-store": "^1.4.0",
|
|
37
37
|
"@tanstack/react-query": "5.67.1",
|
|
38
38
|
"@tanstack/react-router": "1.112.18",
|
|
39
|
-
"@vef-framework/shared": "1.0.
|
|
39
|
+
"@vef-framework/shared": "1.0.101",
|
|
40
40
|
"axios": "1.8.2",
|
|
41
41
|
"qs": "6.14.0"
|
|
42
42
|
},
|