best-unit 1.2.18 → 1.2.19

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.
Files changed (47) hide show
  1. package/package.json +4 -1
  2. package/BEST_UNIT_USAGE.md +0 -402
  3. package/index.html +0 -13
  4. package/src/api/axiosInstance.ts +0 -111
  5. package/src/api/index.ts +0 -136
  6. package/src/api/proxy.ts +0 -11
  7. package/src/components/business/recharge-sdk/components/offline-transfer-form/index.tsx +0 -158
  8. package/src/components/business/recharge-sdk/components/offline-transfer-form/theme.tsx +0 -238
  9. package/src/components/business/recharge-sdk/components/online-recharge-form/index.tsx +0 -199
  10. package/src/components/business/recharge-sdk/components/online-recharge-form/theme.tsx +0 -151
  11. package/src/components/business/recharge-sdk/components/recharge/index.tsx +0 -152
  12. package/src/components/business/recharge-sdk/components/recharge/theme.tsx +0 -64
  13. package/src/components/business/recharge-sdk/index.tsx +0 -37
  14. package/src/components/business/refresh-button/index.tsx +0 -99
  15. package/src/components/business/refresh-button/theme.tsx +0 -58
  16. package/src/components/business/statistical-balance/index.tsx +0 -190
  17. package/src/components/business/statistical-balance/theme.tsx +0 -110
  18. package/src/components/common/button/index.tsx +0 -17
  19. package/src/components/common/button/theme.tsx +0 -48
  20. package/src/components/common/hover-popover/index.tsx +0 -179
  21. package/src/components/common/hover-popover/theme.tsx +0 -39
  22. package/src/components/common/message/index.tsx +0 -321
  23. package/src/components/common/message/theme.tsx +0 -25
  24. package/src/components/common/modal/index.tsx +0 -99
  25. package/src/components/common/modal/theme.tsx +0 -91
  26. package/src/components/common/select/index.tsx +0 -229
  27. package/src/components/common/select/theme.tsx +0 -104
  28. package/src/components/common/upload/index.tsx +0 -140
  29. package/src/components/common/upload/theme.tsx +0 -89
  30. package/src/demo/App.tsx +0 -685
  31. package/src/demo/index.tsx +0 -4
  32. package/src/demo/testBalanceData.tsx +0 -79
  33. package/src/demo/theme-config-example.tsx +0 -1
  34. package/src/local/en.ts +0 -63
  35. package/src/local/index.ts +0 -36
  36. package/src/local/zh.ts +0 -62
  37. package/src/main.ts +0 -26
  38. package/src/types/global.d.ts +0 -146
  39. package/src/types/index.ts +0 -31
  40. package/src/types/preact-custom-element.d.ts +0 -1
  41. package/src/utils/business/index.ts +0 -132
  42. package/src/utils/common/index.ts +0 -8
  43. package/src/vite-env.d.ts +0 -8
  44. package/tsconfig.app.json +0 -33
  45. package/tsconfig.json +0 -15
  46. package/tsconfig.node.json +0 -24
  47. package/vite.config.ts +0 -24
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "best-unit",
3
3
  "private": false,
4
- "version": "1.2.18",
4
+ "version": "1.2.19",
5
5
  "type": "module",
6
6
  "main": "dist/best-unit.cjs",
7
7
  "module": "dist/best-unit.js",
8
8
  "types": "dist/types/global.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
9
12
  "scripts": {
10
13
  "dev": "vite",
11
14
  "build": "tsc --noEmit && vite build && cp -r src/types dist/types",
@@ -1,402 +0,0 @@
1
- # BestUnit 组件库使用文档
2
-
3
- ## 概述
4
-
5
- BestUnit 是一个功能完整的组件库,提供了余额管理、充值功能和刷新按钮等核心功能。本文档详细说明了所有导出的函数、组件及其使用方法。
6
-
7
- ## 快速开始
8
-
9
- ### 1. 安装和引入
10
-
11
- ```javascript
12
- import {
13
- initFundUnit,
14
- getBalanceData,
15
- refreshBalance,
16
- npmTest,
17
- printCurrentTime,
18
- viteProxy,
19
- } from "best-unit";
20
-
21
- // 引入组件
22
- import "best-unit";
23
- ```
24
-
25
- ### 2. 初始化
26
-
27
- ```javascript
28
- // 初始化组件库
29
- initFundUnit({
30
- token: "your-jwt-token",
31
- user_id: "user-uuid",
32
- env: "dev",
33
- });
34
- ```
35
-
36
- ## 核心函数
37
-
38
- ### initFundUnit(params: InitParams)
39
-
40
- 初始化组件库的核心函数,必须在其他功能使用前调用。
41
-
42
- #### 参数说明
43
-
44
- | 参数名 | 类型 | 必填 | 默认值 | 说明 |
45
- | ----------------- | -------- | ---- | ------------- | ------------ |
46
- | `token` | `string` | ✅ | - | JWT 认证令牌 |
47
- | `user_id` | `string` | ✅ | - | 用户唯一标识 |
48
- | `env` | `Env` | ✅ | - | 环境配置 |
49
- | `merchant_id` | `string` | ❌ | - | 商户 ID |
50
- | `biz_type` | `string` | ❌ | - | 业务类型 |
51
- | `fund_balance_id` | `string` | ❌ | - | 余额账户 ID |
52
- | `theme` | `Theme` | ❌ | `Theme.WHITE` | 主题设置 |
53
- | `locale` | `Locale` | ❌ | `Locale.ZH` | 语言设置 |
54
-
55
- #### 使用示例
56
-
57
- ```javascript
58
- import { initFundUnit } from "best-unit";
59
- import { Theme, Locale, Env } from "best-unit";
60
-
61
- // 基本初始化
62
- initFundUnit({
63
- token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
64
- user_id: "19b8a77c-d3fc-45da-9520-4a07463123df",
65
- env: Env.DEV,
66
- });
67
-
68
- // 完整初始化
69
- initFundUnit({
70
- token: "your-jwt-token",
71
- user_id: "user-uuid",
72
- merchant_id: "merchant-123",
73
- biz_type: "payment",
74
- fund_balance_id: "FB1FNZ5Q55M7QP2C",
75
- theme: Theme.DARK,
76
- locale: Locale.EN,
77
- env: Env.PROD,
78
- });
79
- ```
80
-
81
- ### getBalanceData()
82
-
83
- 获取当前余额数据。如果缓存中没有有效数据,会自动调用接口获取最新值。
84
-
85
- #### 返回值
86
-
87
- ```typescript
88
- interface BalanceData {
89
- fundBalanceId: string; // 余额账户ID
90
- merchantId: number; // 商户ID
91
- bizType: string; // 业务类型
92
- currency: string; // 币种
93
- totalAmount: string; // 真实金额
94
- availableAmount: string; // 可用余额
95
- frozenAmount: string; // 冻结金额
96
- pendingAmount: string; // 待处理金额
97
- status: string; // 状态
98
- createdAt: string; // 创建时间
99
- }
100
- ```
101
-
102
- #### 使用示例
103
-
104
- ```javascript
105
- import { getBalanceData } from "best-unit";
106
-
107
- // 异步获取余额数据
108
- const balanceData = await getBalanceData();
109
- console.log("当前余额:", balanceData);
110
-
111
- // 使用 async/await
112
- async function getBalance() {
113
- try {
114
- const data = await getBalanceData();
115
- console.log("余额数据:", data);
116
- } catch (error) {
117
- console.error("获取余额失败:", error);
118
- }
119
- }
120
-
121
- // 使用 Promise
122
- getBalanceData()
123
- .then((data) => {
124
- console.log("余额数据:", data);
125
- })
126
- .catch((error) => {
127
- console.error("获取余额失败:", error);
128
- });
129
- ```
130
-
131
- ### refreshBalance()
132
-
133
- 触发余额刷新事件,所有余额相关组件会自动更新。
134
-
135
- #### 使用示例
136
-
137
- ```javascript
138
- import { refreshBalance } from "best-unit";
139
-
140
- // 手动刷新余额
141
- refreshBalance();
142
- ```
143
-
144
- ## 工具函数
145
-
146
- ### npmTest()
147
-
148
- 测试函数,用于验证包是否正确安装。
149
-
150
- ```javascript
151
- import { npmTest } from "best-unit";
152
-
153
- npmTest(); // 输出: "npm package test!!!"
154
- ```
155
-
156
- ### printCurrentTime()
157
-
158
- 打印当前时间。
159
-
160
- ```javascript
161
- import { printCurrentTime } from "best-unit";
162
-
163
- printCurrentTime(); // 输出: "Current time: 2024-01-01T00:00:00.000Z"
164
- ```
165
-
166
- ### viteProxy
167
-
168
- Vite 代理配置,用于开发环境。
169
-
170
- ```javascript
171
- import { viteProxy } from "best-unit";
172
-
173
- // 在 vite.config.js 中使用
174
- export default {
175
- server: {
176
- proxy: viteProxy,
177
- },
178
- };
179
- ```
180
-
181
- ## 组件使用
182
-
183
- ### 1. best-statistical-balance (余额统计组件)
184
-
185
- 显示用户余额信息的组件,支持悬停查看详情。
186
-
187
- #### 基本用法
188
-
189
- ```html
190
- <!-- 基本使用 -->
191
- <best-statistical-balance></best-statistical-balance>
192
-
193
- <!-- 自定义弹窗位置 -->
194
- <best-statistical-balance popover-position="top"></best-statistical-balance>
195
- ```
196
-
197
- #### 属性说明
198
-
199
- | 属性名 | 类型 | 必填 | 默认值 | 说明 |
200
- | ------------------ | -------- | ---- | ---------- | -------------------------------------------------- |
201
- | `popover-position` | `string` | ❌ | `"bottom"` | 弹窗位置:`"top"`, `"bottom"`, `"left"`, `"right"` |
202
-
203
- #### 功能特性
204
-
205
- - 自动获取并显示余额数据
206
- - 悬停显示详细余额信息
207
- - 响应式设计,支持主题切换
208
- - 自动监听刷新事件
209
-
210
- ### 2. best-refresh-button (刷新按钮组件)
211
-
212
- 可自定义的刷新按钮,支持动画效果。
213
-
214
- #### 基本用法
215
-
216
- ```html
217
- <!-- 显示默认文案 -->
218
- <best-refresh-button>刷新</best-refresh-button>
219
-
220
- <!-- 只显示图标 -->
221
- <best-refresh-button></best-refresh-button>
222
-
223
- <!-- 自定义文案 -->
224
- <best-refresh-button>重新加载</best-refresh-button>
225
- ```
226
-
227
- #### 属性说明
228
-
229
- | 属性名 | 类型 | 必填 | 默认值 | 说明 |
230
- | ------- | -------- | ---- | ---------- | ------------------------------------------ |
231
- | `color` | `string` | ❌ | - | 按钮颜色 |
232
- | `size` | `string` | ❌ | `"medium"` | 按钮尺寸:`"small"`, `"medium"`, `"large"` |
233
-
234
- #### 功能特性
235
-
236
- - 点击时图标旋转动画
237
- - 自动触发余额刷新
238
- - 支持自定义文案和颜色
239
- - 响应式设计
240
-
241
- ### 3. best-recharge (充值组件)
242
-
243
- 提供充值功能的组件。
244
-
245
- #### 基本用法
246
-
247
- ```html
248
- <!-- 基本使用 -->
249
- <best-recharge></best-recharge>
250
-
251
- <!-- 自定义主题 -->
252
- <best-recharge theme="dark"></best-recharge>
253
- ```
254
-
255
- #### 属性说明
256
-
257
- | 属性名 | 类型 | 必填 | 默认值 | 说明 |
258
- | ------- | -------- | ---- | --------- | ------------------------- |
259
- | `theme` | `string` | ❌ | `"white"` | 主题:`"white"`, `"dark"` |
260
-
261
- #### 功能特性
262
-
263
- - 在线充值功能
264
- - 支持多种支付方式
265
- - 自动跳转支付页面
266
- - 响应式设计
267
-
268
- ## 类型定义
269
-
270
- ### Env (环境枚举)
271
-
272
- ```typescript
273
- enum Env {
274
- DEV = "dev",
275
- DEVELOPMENT = "development",
276
- TEST = "test",
277
- PROD = "prod",
278
- PRODUCTION = "production",
279
- }
280
- ```
281
-
282
- ### Theme (主题枚举)
283
-
284
- ```typescript
285
- enum Theme {
286
- WHITE = "white",
287
- DARK = "dark",
288
- }
289
- ```
290
-
291
- ### Locale (语言枚举)
292
-
293
- ```typescript
294
- enum Locale {
295
- ZH = "zh",
296
- EN = "en",
297
- }
298
- ```
299
-
300
- ## 完整示例
301
-
302
- ### HTML 页面集成
303
-
304
- ```html
305
- <!DOCTYPE html>
306
- <html lang="zh-CN">
307
- <head>
308
- <meta charset="UTF-8" />
309
- <title>BestUnit 示例</title>
310
- </head>
311
- <body>
312
- <!-- 余额显示 -->
313
- <best-statistical-balance></best-statistical-balance>
314
-
315
- <!-- 刷新按钮 -->
316
- <best-refresh-button>刷新余额</best-refresh-button>
317
-
318
- <!-- 充值按钮 -->
319
- <best-recharge></best-recharge>
320
-
321
- <script type="module">
322
- import { initFundUnit } from "best-unit";
323
- import { Env, Theme, Locale } from "best-unit";
324
-
325
- // 初始化
326
- initFundUnit({
327
- token: "your-jwt-token",
328
- user_id: "user-uuid",
329
- theme: Theme.WHITE,
330
- locale: Locale.ZH,
331
- env: Env.DEV,
332
- });
333
- </script>
334
- </body>
335
- </html>
336
- ```
337
-
338
- ### React/Vue 集成
339
-
340
- ```javascript
341
- // React 示例
342
- import React, { useEffect } from "react";
343
- import { initFundUnit } from "best-unit";
344
-
345
- function App() {
346
- useEffect(() => {
347
- initFundUnit({
348
- token: "your-jwt-token",
349
- user_id: "user-uuid",
350
- env: "dev",
351
- });
352
- }, []);
353
-
354
- return (
355
- <div>
356
- <best-statistical-balance></best-statistical-balance>
357
- <best-refresh-button>刷新</best-refresh-button>
358
- <best-recharge></best-recharge>
359
- </div>
360
- );
361
- }
362
- ```
363
-
364
- ## 注意事项
365
-
366
- 1. **初始化顺序**:必须先调用 `initFundUnit()` 再使用其他功能
367
- 2. **Token 安全**:确保 JWT token 的安全性,不要在客户端存储敏感信息
368
- 3. **环境配置**:根据实际环境选择合适的 `env` 参数
369
- 4. **组件依赖**:所有组件都依赖于初始化配置,确保配置正确
370
- 5. **浏览器兼容性**:需要支持 Custom Elements 和 Shadow DOM 的现代浏览器
371
-
372
- ## 错误处理
373
-
374
- ```javascript
375
- try {
376
- initFundUnit({
377
- token: "invalid-token",
378
- user_id: "user-uuid",
379
- env: "dev",
380
- });
381
- } catch (error) {
382
- console.error("初始化失败:", error);
383
- }
384
-
385
- // 检查余额数据(异步)
386
- async function checkBalanceData() {
387
- try {
388
- const balanceData = await getBalanceData();
389
- if (!balanceData.fundBalanceId) {
390
- console.warn("余额数据未初始化");
391
- }
392
- } catch (error) {
393
- console.error("获取余额数据失败:", error);
394
- }
395
- }
396
- ```
397
-
398
- ## 更新日志
399
-
400
- - **v1.0.0**: 初始版本,包含基础功能
401
- - **v1.1.0**: 添加动画效果和主题支持
402
- - **v1.2.0**: 优化缓存机制和错误处理
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Best Unit</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="/src/demo/index.tsx"></script>
12
- </body>
13
- </html>
@@ -1,111 +0,0 @@
1
- import axios from "axios";
2
- import type {
3
- AxiosInstance,
4
- AxiosResponse,
5
- InternalAxiosRequestConfig,
6
- } from "axios";
7
- import { message } from "@/components/common/message";
8
- import { Env, Locale } from "@/types";
9
-
10
- export interface CreateAxiosOptions {
11
- baseURL?: string;
12
- timeout?: number;
13
- onError?: (msg: string, error: any) => void;
14
- }
15
-
16
- export function createAxiosInstance(options: CreateAxiosOptions = {}) {
17
- // 根据 fund_unit_params 中的 env 参数选择 API URL
18
- const fundUnitParams = JSON.parse(
19
- sessionStorage.getItem("fund_unit_params") || "{}"
20
- );
21
-
22
- console.log("fundUnitParams", fundUnitParams);
23
- const { env } = fundUnitParams;
24
-
25
- let apiUrl: string;
26
- switch (env) {
27
- case Env.DEV:
28
- case Env.DEVELOPMENT:
29
- apiUrl = "/api";
30
- break;
31
- case Env.TEST:
32
- apiUrl = "https://fund.bestfulfill.tech/api/sdk";
33
- break;
34
- case Env.PROD:
35
- case Env.PRODUCTION:
36
- default:
37
- apiUrl = "https://fund.bestfulfill.com/api/sdk";
38
- break;
39
- }
40
-
41
- const { baseURL = apiUrl, timeout = 10000, onError } = options;
42
-
43
- const instance: AxiosInstance = axios.create({ baseURL, timeout });
44
-
45
- // 请求拦截:加 token、国际化
46
- instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
47
- const { token, locale } = fundUnitParams;
48
- config.headers = {
49
- ...config.headers,
50
- Authorization: token,
51
- "x-locale": locale === Locale.ZH ? "zh-CN" : "en-US",
52
- } as any;
53
-
54
- return config;
55
- });
56
-
57
- // 响应拦截:code=0判定成功,其他走 onError
58
- instance.interceptors.response.use(
59
- (response: AxiosResponse) => {
60
- if (response.data && response.data.code === 0) {
61
- return response.data;
62
- }
63
- const errorMsg =
64
- response.data?.msg || response.data?.message || "未知错误";
65
-
66
- // 显示错误消息
67
- message.error(errorMsg);
68
-
69
- if (onError) {
70
- onError(errorMsg, response);
71
- }
72
- return Promise.reject(response.data || { message: "未知错误" });
73
- },
74
- (error) => {
75
- const errorMsg =
76
- error.response?.data?.msg ||
77
- error.response?.data?.message ||
78
- error.message ||
79
- "网络请求失败";
80
-
81
- // 显示错误消息
82
- message.error(errorMsg);
83
-
84
- if (onError) {
85
- onError(errorMsg, error);
86
- }
87
- return Promise.reject(error);
88
- }
89
- );
90
-
91
- return instance;
92
- }
93
-
94
- // 缓存 axios 实例
95
- let httpInstance: AxiosInstance | null = null;
96
-
97
- // 获取 axios 实例的函数
98
- export function http(): AxiosInstance {
99
- if (!httpInstance) {
100
- httpInstance = createAxiosInstance();
101
- }
102
- return httpInstance;
103
- }
104
-
105
- // 重置 axios 实例(当 fund_unit_params 更新时调用)
106
- export function resetHttpInstance(): void {
107
- httpInstance = null;
108
- }
109
-
110
- // 默认导出获取实例的函数
111
- export default http;
package/src/api/index.ts DELETED
@@ -1,136 +0,0 @@
1
- import { http } from "./axiosInstance";
2
- import type { AxiosProgressEvent } from "axios";
3
- // 获取余额
4
- export function getBalance() {
5
- const fundUnitParams = JSON.parse(
6
- sessionStorage.getItem("fund_unit_params") || "{}"
7
- );
8
- return http()
9
- .get("/balance", {
10
- params: {
11
- merchant_id: fundUnitParams.merchantId,
12
- biz_type: fundUnitParams.bizType,
13
- fund_balance_id: fundUnitParams.fundBalanceId,
14
- },
15
- })
16
- .then((res) => {
17
- const data = res.data;
18
- const balanceData = {
19
- fundBalanceId: data.fund_balance_id,
20
- merchantId: data.merchant_id,
21
- bizType: data.biz_type,
22
- currency: data.currency,
23
- totalAmount: data.total_amount,
24
- frozenAmount: data.frozen_amount,
25
- creditLimit: data.credit_config?.credit_limit,
26
- creditUsed: data.credit_used,
27
- isCredit: data.credit_config ? true : false,
28
- availableAmount: data.available_amount,
29
- pendingAmount: data.pending_amount,
30
- status: data.status,
31
- createdAt: data.created_at,
32
- };
33
- sessionStorage.setItem("balanceData", JSON.stringify(balanceData));
34
- return balanceData;
35
- });
36
- }
37
-
38
- // 获取所有字典
39
- export const getAllDicts = async () => {
40
- return http()
41
- .get("/all-dicts", {})
42
- .then((res) => {
43
- sessionStorage.setItem("all_dicts", JSON.stringify(res.data));
44
- return res.data || {};
45
- });
46
- };
47
-
48
- // 上传文件
49
- export const uploadFile = async (
50
- file: any,
51
- onProgress?: (percent: number) => void
52
- ) => {
53
- return http()
54
- .post("/oss/upload", file, {
55
- headers: {
56
- "Content-Type": "multipart/form-data",
57
- },
58
- onUploadProgress: (progressEvent: AxiosProgressEvent) => {
59
- if (progressEvent.total) {
60
- const percent = Math.round(
61
- (progressEvent.loaded * 100) / progressEvent.total
62
- );
63
- onProgress && onProgress(percent);
64
- }
65
- },
66
- })
67
- .then((res) => {
68
- return res.data?.url || "";
69
- });
70
- };
71
-
72
- // 创建离线充值
73
- export const createOfflineRecharge = async (data: any) => {
74
- const fundUnitParams = JSON.parse(
75
- sessionStorage.getItem("fund_unit_params") || "{}"
76
- );
77
-
78
- const params = {
79
- merchant_id: Number(fundUnitParams.merchantId),
80
- biz_type: fundUnitParams.bizType,
81
- fund_balance_id: fundUnitParams.fundBalanceId,
82
- source_operator: fundUnitParams.userId
83
- ? String(fundUnitParams.userId)
84
- : undefined,
85
- transfer_no: data.transferNo,
86
- transfer_channel: data.transferChannel,
87
- voucher_urls: data.voucherUrls,
88
- };
89
- return http().post("/offline/recharge/create", params, {});
90
- };
91
-
92
- // 创建在线充值
93
- export const createOnlineRecharge = async (data: any) => {
94
- const fundUnitParams = JSON.parse(
95
- sessionStorage.getItem("fund_unit_params") || "{}"
96
- );
97
-
98
- const params = {
99
- merchant_id: Number(fundUnitParams.merchantId),
100
- biz_type: fundUnitParams.bizType,
101
- fund_balance_id: fundUnitParams.fundBalanceId,
102
- source_operator: fundUnitParams.userId
103
- ? String(fundUnitParams.userId)
104
- : undefined,
105
- amount: data.amount,
106
- currency: data.currency,
107
- recharge_channel: data.rechargeChannel,
108
- return_url: window.location.href,
109
- };
110
- return http()
111
- .post("/online/recharge/create", params, {})
112
- .then((res) => {
113
- return res.data.redirect_url;
114
- });
115
- };
116
-
117
- interface CalcPaymentAmountParams {
118
- channel: string; // 支付平台,如 "stripe"
119
- amount: string; // 充值金额,如 "10"
120
- currency: string; // 币种,如 "USD"
121
- }
122
-
123
- // 计算支付金额
124
- export const calcPaymentAmount = async (data: CalcPaymentAmountParams) => {
125
- return http()
126
- .get("/calc-payment-amount", {
127
- params: data,
128
- })
129
- .then((res) => {
130
- const data = res.data;
131
- return data.payment_amount;
132
- });
133
- };
134
-
135
- // 示例用法:
136
- // getBalance({ merchant_id: '1128', biz_type: 'ad', token: 'xxx' }).then(res => console.log(res));
package/src/api/proxy.ts DELETED
@@ -1,11 +0,0 @@
1
- // Vite 配置用的代理对象
2
- const viteProxy = {
3
- "/api": {
4
- target: "https://fund.bestfulfill.tech/api/sdk",
5
- changeOrigin: true,
6
- rewrite: (path: string) => path.replace(/^\/api/, ""),
7
- secure: false,
8
- },
9
- };
10
-
11
- export { viteProxy };