udxcms 1.0.4 → 1.0.6
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/api/common.d.ts +28 -28
- package/dist/api/h5/axios.d.ts +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +144 -2
- package/dist/config/index.js +3 -3
- package/dist/index.d.ts +6 -5
- package/dist/index.js +30 -10
- package/dist/store/CmsStore.js +2 -2
- package/dist/utils/axiosRetry.d.ts +7 -0
- package/dist/utils/axiosRetry.js +14 -0
- package/dist/utils/connect.d.ts +6 -0
- package/dist/utils/connect.js +7 -2
- package/dist/utils/index.d.ts +55 -1
- package/dist/utils/index.js +712 -3
- package/dist/utils/parse.d.ts +5 -0
- package/dist/utils/parse.js +12 -0
- package/dist/utils/pdf.d.ts +4 -0
- package/dist/utils/pdf.js +5 -2
- package/package.json +6 -2
package/dist/api/common.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
export function getPhoneCode(params: any): any
|
|
2
|
-
export function getCurrency(): any
|
|
3
|
-
export function setCurrency(currency: any): any
|
|
4
|
-
export function setLanguage(data: any): any
|
|
5
|
-
export function getLanguages(): any
|
|
6
|
-
export function geeTest(): any
|
|
7
|
-
export function getMedias(data: any): any
|
|
8
|
-
export function logOut(): any
|
|
9
|
-
export function getMessage(data: any): any
|
|
10
|
-
export function getUnreadCount(): any
|
|
11
|
-
export function setRead(): any
|
|
12
|
-
export function setReadById(data: any): any
|
|
13
|
-
export function breakdown(params: any): any
|
|
14
|
-
export function getLocation(): any
|
|
15
|
-
export function getBlocksOverview(data: any): any
|
|
16
|
-
export function getRewardsOverview(params: any): any
|
|
17
|
-
export function getTradeOverview(params: any): any
|
|
18
|
-
export function getTokens(): any
|
|
19
|
-
export function fetchNetworkList(): any
|
|
20
|
-
export function getCoin(data: any): any
|
|
21
|
-
export function getAnnouncement(type: any): any
|
|
22
|
-
export function getPssistance(type: any): any
|
|
23
|
-
export function getService(data: any): any
|
|
24
|
-
export function favor(data: any): any
|
|
25
|
-
export function isFavor(data: any): any
|
|
26
|
-
export function getWhitePaper(data: any): any
|
|
27
|
-
export function getSignleSymbolPrice(data: any): any
|
|
28
|
-
export function isMerchant(params: any, headers?: {}): any
|
|
1
|
+
export function getPhoneCode(params: any): Promise<import("axios").AxiosResponse<any>>;
|
|
2
|
+
export function getCurrency(): Promise<import("axios").AxiosResponse<any>>;
|
|
3
|
+
export function setCurrency(currency: any): Promise<import("axios").AxiosResponse<any>>;
|
|
4
|
+
export function setLanguage(data: any): import("axios").AxiosPromise<any>;
|
|
5
|
+
export function getLanguages(): import("axios").AxiosPromise<any>;
|
|
6
|
+
export function geeTest(): Promise<import("axios").AxiosResponse<any>>;
|
|
7
|
+
export function getMedias(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
8
|
+
export function logOut(): Promise<import("axios").AxiosResponse<any>>;
|
|
9
|
+
export function getMessage(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
10
|
+
export function getUnreadCount(): Promise<import("axios").AxiosResponse<any>>;
|
|
11
|
+
export function setRead(): Promise<import("axios").AxiosResponse<any>>;
|
|
12
|
+
export function setReadById(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
13
|
+
export function breakdown(params: any): import("axios").AxiosPromise<any>;
|
|
14
|
+
export function getLocation(): Promise<import("axios").AxiosResponse<any>>;
|
|
15
|
+
export function getBlocksOverview(data: any): Promise<any>;
|
|
16
|
+
export function getRewardsOverview(params: any): import("axios").AxiosPromise<any>;
|
|
17
|
+
export function getTradeOverview(params: any): import("axios").AxiosPromise<any>;
|
|
18
|
+
export function getTokens(): import("axios").AxiosPromise<any>;
|
|
19
|
+
export function fetchNetworkList(): import("axios").AxiosPromise<any>;
|
|
20
|
+
export function getCoin(data: any): import("axios").AxiosPromise<any>;
|
|
21
|
+
export function getAnnouncement(type: any): import("axios").AxiosPromise<any>;
|
|
22
|
+
export function getPssistance(type: any): import("axios").AxiosPromise<any>;
|
|
23
|
+
export function getService(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
24
|
+
export function favor(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
25
|
+
export function isFavor(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
26
|
+
export function getWhitePaper(data: any): Promise<import("axios").AxiosResponse<any>>;
|
|
27
|
+
export function getSignleSymbolPrice(data: any): import("axios").AxiosPromise<any>;
|
|
28
|
+
export function isMerchant(params: any, headers?: {}): Promise<any>;
|
package/dist/api/h5/axios.d.ts
CHANGED
package/dist/api/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./common.js";
|
|
2
|
-
export * from "./h5/common.js";
|
|
3
|
-
export
|
|
2
|
+
export * as H5Common from "./h5/common.js";
|
|
3
|
+
export const instance: import("axios").AxiosInstance;
|
package/dist/api/index.js
CHANGED
|
@@ -10,10 +10,152 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
16
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.H5Common = exports.instance = void 0;
|
|
52
|
+
const axios_1 = __importDefault(require("axios"));
|
|
53
|
+
const index_1 = __importDefault(require("../config/index"));
|
|
54
|
+
const index_2 = require("../utils/index");
|
|
55
|
+
const Storage_1 = __importDefault(require("../utils/Storage"));
|
|
56
|
+
const axiosRetry_1 = require("../utils/axiosRetry");
|
|
57
|
+
var mergeConfig = require("axios/lib/core/mergeConfig");
|
|
58
|
+
const instance = axios_1.default.create({
|
|
59
|
+
baseURL: "",
|
|
60
|
+
timeout: index_1.default.timeOut,
|
|
61
|
+
retry: axiosRetry_1.retryCount,
|
|
62
|
+
retryDelay: axiosRetry_1.retryDelay,
|
|
63
|
+
headers: {},
|
|
64
|
+
});
|
|
65
|
+
exports.instance = instance;
|
|
66
|
+
var dealMarktUrl = function (url) {
|
|
67
|
+
if (url.endsWith("/market"))
|
|
68
|
+
return url.slice(0, url.length - "/market".length);
|
|
69
|
+
else
|
|
70
|
+
url;
|
|
71
|
+
};
|
|
72
|
+
instance.delete = function (url, data, config) {
|
|
73
|
+
return instance.request(mergeConfig(config || {}, {
|
|
74
|
+
method: "delete",
|
|
75
|
+
url: url,
|
|
76
|
+
data: data,
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
instance.interceptors.request.use(function (config) {
|
|
80
|
+
let Store = window.$Vue.$store;
|
|
81
|
+
let base_url = (0, axiosRetry_1.getBaseUrl)(0);
|
|
82
|
+
let base_url_market = (site_config && (0, index_2.getMarketApi)((0, index_2.getChainId)())) || "";
|
|
83
|
+
// console.log('base_url_market:', base_url_market);
|
|
84
|
+
let hostname = window.location.hostname;
|
|
85
|
+
if (base_url.length) {
|
|
86
|
+
config.baseURL = base_url;
|
|
87
|
+
}
|
|
88
|
+
if (base_url.length &&
|
|
89
|
+
hostname &&
|
|
90
|
+
(config.url.startsWith("/market") ||
|
|
91
|
+
config.url.startsWith("market"))) {
|
|
92
|
+
config.baseURL = dealMarktUrl(base_url_market);
|
|
93
|
+
}
|
|
94
|
+
if (!config.unToken) {
|
|
95
|
+
config.headers["x-auth-token"] = Storage_1.default.get("TOKEN");
|
|
96
|
+
config.headers["client_id"] = "WEB";
|
|
97
|
+
config.headers["language"] = localStorage.getItem("language");
|
|
98
|
+
config.headers["timezone"] =
|
|
99
|
+
(Store.state.user && Store.state.user.userInfo && Store.state.user.userInfo.timezone) ||
|
|
100
|
+
(0, index_2.getTimeZone)() ||
|
|
101
|
+
"";
|
|
102
|
+
config.headers["country"] =
|
|
103
|
+
(Store.state.user && Store.state.user.userInfo && Store.state.user.userInfo.country) ||
|
|
104
|
+
"";
|
|
105
|
+
if (!config.headers["signature"])
|
|
106
|
+
delete config.headers["signature"];
|
|
107
|
+
if (config["x-submit-token"]) {
|
|
108
|
+
config.headers["x-submit-token"] = config["x-submit-token"];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// console.log('config:', config);
|
|
112
|
+
return config;
|
|
113
|
+
}, function (error) {
|
|
114
|
+
return Promise.reject(error);
|
|
115
|
+
});
|
|
116
|
+
instance.interceptors.response.use(function (response) {
|
|
117
|
+
let isNotGoToLogin = response.config.isNotGoToLogin;
|
|
118
|
+
if (response) {
|
|
119
|
+
let code = response.data.code;
|
|
120
|
+
response.data.codeMessage = response.data.message;
|
|
121
|
+
if (code == "200" || (response.status === 200 && !code) || code === 3) {
|
|
122
|
+
return response.data;
|
|
123
|
+
}
|
|
124
|
+
else if (typeof code === 'string') {
|
|
125
|
+
let resCode = code.split("-");
|
|
126
|
+
let codeStr = resCode[2] + "-" + resCode[3];
|
|
127
|
+
if (codeStr === "2-023") {
|
|
128
|
+
if (!isNotGoToLogin) {
|
|
129
|
+
Store.commit("user/logoutWallet");
|
|
130
|
+
response.data.showError = true;
|
|
131
|
+
$Vue && $Vue.$router.push({
|
|
132
|
+
name: "login_wallet",
|
|
133
|
+
});
|
|
134
|
+
return Promise.reject(response.data);
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
Store.commit("user/logoutWallet");
|
|
138
|
+
return Promise.resolve(response.data);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
if (parseInt(code.split("-")[2]) <= 2) {
|
|
143
|
+
response.data.codeMessage = response.data.message;
|
|
144
|
+
return Promise.reject(response.data);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
response.showError = true;
|
|
148
|
+
return Promise.reject(response.data);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return Promise.reject(response.data);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, (error) => __awaiter(void 0, void 0, void 0, function* () {
|
|
157
|
+
const res = yield (0, axiosRetry_1.retryFun)(instance, error);
|
|
158
|
+
return res;
|
|
159
|
+
}));
|
|
17
160
|
__exportStar(require("./common.js"), exports);
|
|
18
|
-
|
|
19
|
-
__exportStar(require("./h5/axios.js"), exports);
|
|
161
|
+
exports.H5Common = __importStar(require("./h5/common.js"));
|
package/dist/config/index.js
CHANGED
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
* @Author:
|
|
7
7
|
* @Date: 2021-08-02 11:52:46
|
|
8
8
|
* @LastEditors: lewis lewis@everylink.ai
|
|
9
|
-
* @LastEditTime: 2025-09-
|
|
9
|
+
* @LastEditTime: 2025-09-23 11:45:28
|
|
10
10
|
*/
|
|
11
11
|
exports.default = {
|
|
12
|
-
sitePath: process.env.VUE_APP_MODE
|
|
12
|
+
sitePath: process.env.VUE_APP_MODE == 'production' ? 'https://djgs8mufg9606.cloudfront.net/' : 'https://d1qu701gfywrk1.cloudfront.net/', // site path
|
|
13
13
|
// sitePath: "https://djgs8mufg9606.cloudfront.net/",
|
|
14
|
-
themePath: process.env.VUE_APP_MODE
|
|
14
|
+
themePath: process.env.VUE_APP_MODE == 'production' ? 'https://djgs8mufg9606.cloudfront.net/config/' : 'https://d1qu701gfywrk1.cloudfront.net/config/',
|
|
15
15
|
siteLogo: 'site/logo',
|
|
16
16
|
timeOut: 30000,
|
|
17
17
|
loginText: 'Session expired, please log in again.',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
1
|
+
export * as cmsComponents from './components';
|
|
2
|
+
export * as cmsViews from './views';
|
|
3
|
+
export * as cmsUtils from './utils';
|
|
4
|
+
export * as cmsRouter from './router';
|
|
5
|
+
export * as cmsStore from './store';
|
|
6
|
+
export * as api from './api';
|
package/dist/index.js
CHANGED
|
@@ -10,21 +10,41 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
16
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.api = exports.cmsStore = exports.cmsRouter = exports.cmsUtils = exports.cmsViews = exports.cmsComponents = void 0;
|
|
17
37
|
/*
|
|
18
38
|
* @Author: lewis lewis@everylink.ai
|
|
19
39
|
* @Date: 2025-09-17 10:50:27
|
|
20
40
|
* @LastEditors: lewis lewis@everylink.ai
|
|
21
|
-
* @LastEditTime: 2025-09-
|
|
41
|
+
* @LastEditTime: 2025-09-23 12:02:52
|
|
22
42
|
* @FilePath: /localTools/Users/apple/web-front/web-front/src/common_modules/cms-submodule/index.js
|
|
23
43
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
24
44
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
45
|
+
exports.cmsComponents = __importStar(require("./components"));
|
|
46
|
+
exports.cmsViews = __importStar(require("./views"));
|
|
47
|
+
exports.cmsUtils = __importStar(require("./utils"));
|
|
48
|
+
exports.cmsRouter = __importStar(require("./router"));
|
|
49
|
+
exports.cmsStore = __importStar(require("./store"));
|
|
50
|
+
exports.api = __importStar(require("./api"));
|
package/dist/store/CmsStore.js
CHANGED
|
@@ -14,8 +14,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
* @version:
|
|
15
15
|
* @Author:
|
|
16
16
|
* @Date: 2021-07-30 10:46:1
|
|
17
|
-
* @LastEditors:
|
|
18
|
-
* @LastEditTime:
|
|
17
|
+
* @LastEditors: lewis lewis@everylink.ai
|
|
18
|
+
* @LastEditTime: 2025-09-22 18:59:24
|
|
19
19
|
*/
|
|
20
20
|
const common_1 = require("../api/common");
|
|
21
21
|
exports.default = {
|
|
@@ -2,3 +2,10 @@ export const retryCount: 1;
|
|
|
2
2
|
export const retryDelay: 100;
|
|
3
3
|
export function getBaseUrl(retry: any): string;
|
|
4
4
|
export function retryFun(instance: any, error: any): Promise<any>;
|
|
5
|
+
declare namespace _default {
|
|
6
|
+
export { retryCount };
|
|
7
|
+
export { retryDelay };
|
|
8
|
+
export { getBaseUrl };
|
|
9
|
+
export { retryFun };
|
|
10
|
+
}
|
|
11
|
+
export default _default;
|
package/dist/utils/axiosRetry.js
CHANGED
|
@@ -10,6 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.retryFun = exports.getBaseUrl = exports.retryDelay = exports.retryCount = void 0;
|
|
13
|
+
/*
|
|
14
|
+
* @Author: lewis lewis@everylink.ai
|
|
15
|
+
* @Date: 2023-12-19 10:49:53
|
|
16
|
+
* @LastEditors: lewis lewis@everylink.ai
|
|
17
|
+
* @LastEditTime: 2025-09-19 17:03:24
|
|
18
|
+
* @FilePath: /localTools/Users/apple/web-front/web-front/src/common_modules/cms-submodule/utils/axiosRetry.js
|
|
19
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
20
|
+
*/
|
|
13
21
|
exports.retryCount = 1; // 重试次数,现在默认重试一次,后期可以调整
|
|
14
22
|
exports.retryDelay = 100; // 重试延迟时间
|
|
15
23
|
let site_common_api_url = '';
|
|
@@ -55,3 +63,9 @@ const retryFun = (instance, error) => __awaiter(void 0, void 0, void 0, function
|
|
|
55
63
|
}
|
|
56
64
|
});
|
|
57
65
|
exports.retryFun = retryFun;
|
|
66
|
+
exports.default = {
|
|
67
|
+
retryCount: exports.retryCount,
|
|
68
|
+
retryDelay: exports.retryDelay,
|
|
69
|
+
getBaseUrl: exports.getBaseUrl,
|
|
70
|
+
retryFun: exports.retryFun
|
|
71
|
+
};
|
package/dist/utils/connect.d.ts
CHANGED
|
@@ -12,3 +12,9 @@ export class ConnectSocketTool {
|
|
|
12
12
|
close(): void;
|
|
13
13
|
}
|
|
14
14
|
export function connnectSingle(url: any): void;
|
|
15
|
+
declare namespace _default {
|
|
16
|
+
export { connnectSingle };
|
|
17
|
+
export { ConnectSocketTool };
|
|
18
|
+
export { connectCloseReason };
|
|
19
|
+
}
|
|
20
|
+
export default _default;
|
package/dist/utils/connect.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @version:
|
|
5
5
|
* @Author:
|
|
6
6
|
* @Date: 2021-04-07 14:59:35
|
|
7
|
-
* @LastEditors:
|
|
8
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditors: lewis lewis@everylink.ai
|
|
8
|
+
* @LastEditTime: 2025-09-19 17:05:55
|
|
9
9
|
*/
|
|
10
10
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
11
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -284,3 +284,8 @@ const connnectSingle = function (url) {
|
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
exports.connnectSingle = connnectSingle;
|
|
287
|
+
exports.default = {
|
|
288
|
+
connnectSingle: exports.connnectSingle,
|
|
289
|
+
ConnectSocketTool,
|
|
290
|
+
connectCloseReason: exports.connectCloseReason,
|
|
291
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,60 @@
|
|
|
1
|
+
export function calcDotDeal(val: any, resVal: any, sign?: string): string;
|
|
2
|
+
export function loadImportScript(src: any, callback: any, saveKey: any): Promise<any>;
|
|
3
|
+
export function AccountForm(account: any, accountType: any): any;
|
|
4
|
+
export function getTimeZone(): string;
|
|
5
|
+
export function getUTCTime(d1: any): number;
|
|
6
|
+
export function formatUTCTime(date: any): any;
|
|
7
|
+
export function isUserCenter(): boolean;
|
|
8
|
+
export function onEvents(type: any, fn: any): void;
|
|
9
|
+
export function emitEvents(type: any, args: any): void;
|
|
10
|
+
export function refreshEvents(events: any): void;
|
|
11
|
+
export function emitLoading(obj: any): void;
|
|
12
|
+
export function getToken(): string;
|
|
13
|
+
export function getAreaCode(): string;
|
|
14
|
+
export function copyText(text: any, e: any): boolean;
|
|
15
|
+
export function isPhone(): RegExpMatchArray;
|
|
16
|
+
export function getChainId(): number;
|
|
17
|
+
export function getLayer1RpcUrl(chainId: any): any;
|
|
18
|
+
export function getChainLayer2Config(chainId?: number): {};
|
|
19
|
+
export function toUpperDataKey(item: any): any;
|
|
20
|
+
export function getMarketApi(chainId: any, connectType: string, apiType: any): string;
|
|
21
|
+
export function getQueryChainId(isMarketType: any): any;
|
|
22
|
+
export function getTradeDefaultChainId(): any;
|
|
23
|
+
export function isMobile(): boolean;
|
|
24
|
+
export function isInIsWalletApp(): boolean;
|
|
25
|
+
export function getStyleObj(pageName: any, keyStr: any): {};
|
|
26
|
+
export function formDataEthers(val: any, decimal: any): string;
|
|
27
|
+
export function formatDateDecimal(num?: number, decimal?: number, zoreFalse?: number): any;
|
|
28
|
+
export function checkEthAddress(address: any): "" | "address must start with '0x'" | "Address must be 20 bytes long";
|
|
29
|
+
export function formatAccount(value: any): any;
|
|
30
|
+
export function accMul(arg1: any, arg2: any): number;
|
|
31
|
+
export function accDiv(arg1: any, arg2: any): number;
|
|
32
|
+
export function accAddSub(arg1: any, arg2: any, sign: any): string | number;
|
|
33
|
+
export function getExplorer(chainId: any): "rinkeby" | "vm";
|
|
34
|
+
export function getHashBlockUrl(hash: string, chainId: any, layer: any): string;
|
|
35
|
+
export function formatTokenCommify(value: any, dp?: any, addSuffixZero?: boolean): any;
|
|
36
|
+
export function toRound(value: any, ratio?: number): string;
|
|
37
|
+
export function formatFiatCommify(value: any, dp?: number): any;
|
|
38
|
+
export function formatNumber(val: any, decimal: any): any;
|
|
39
|
+
export function decimalFunc(val: any, decimal?: number): any;
|
|
40
|
+
export function addZoreFormat(demical: any): string;
|
|
41
|
+
export function numberFormat(num: any, demical?: number, isZero?: boolean): any;
|
|
42
|
+
export function numDecimals(val: any, decimals: any, zeroDecimals?: number): string | number;
|
|
43
|
+
export function formatStringNum(num?: number, decimal?: number, zoreFalse?: number): any;
|
|
44
|
+
export function formatArrStringNum(num: any): any[];
|
|
45
|
+
export function setDecimals(name: any, value: any): void;
|
|
46
|
+
export function getDecimals(name: any): any;
|
|
47
|
+
export function filterL2Balance(data: any, type: any, symbol: any): any;
|
|
48
|
+
export function commify(value: any): any;
|
|
49
|
+
export function getWalletCoinFee(transfer: any, fn: any): Promise<void>;
|
|
50
|
+
export function getFee(transfer: any, fn: any): Promise<void>;
|
|
51
|
+
export function shareUtils(type: any, title: any): void;
|
|
1
52
|
export { default as EventBus } from "./EventBus.js";
|
|
2
53
|
export { default as Session } from "./Session.js";
|
|
3
54
|
export { default as Storage } from "./Storage.js";
|
|
4
55
|
export { default as apiEvent } from "./apiEvent.js";
|
|
56
|
+
export { default as axiosRetry } from "./axiosRetry.js";
|
|
57
|
+
export { default as connect } from "./connect.js";
|
|
5
58
|
export { default as http } from "./http.js";
|
|
6
|
-
export { default as
|
|
59
|
+
export { default as parse } from "./parse.js";
|
|
60
|
+
export { default as pdf } from "./pdf.js";
|
package/dist/utils/index.js
CHANGED
|
@@ -1,9 +1,720 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
13
|
};
|
|
5
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
15
|
+
exports.EventBus = exports.shareUtils = exports.getFee = exports.getWalletCoinFee = exports.commify = exports.filterL2Balance = exports.getDecimals = exports.setDecimals = exports.formatArrStringNum = exports.formatStringNum = exports.numDecimals = exports.numberFormat = exports.addZoreFormat = exports.decimalFunc = exports.formatNumber = exports.formatFiatCommify = exports.toRound = exports.formatTokenCommify = exports.getHashBlockUrl = exports.getExplorer = exports.accAddSub = exports.accDiv = exports.accMul = exports.formatAccount = exports.checkEthAddress = exports.formatDateDecimal = exports.formDataEthers = exports.getStyleObj = exports.isInIsWalletApp = exports.isMobile = exports.getTradeDefaultChainId = exports.getQueryChainId = exports.getMarketApi = exports.toUpperDataKey = exports.getChainLayer2Config = exports.getLayer1RpcUrl = exports.getChainId = exports.isPhone = exports.copyText = exports.getAreaCode = exports.getToken = exports.emitLoading = exports.refreshEvents = exports.emitEvents = exports.onEvents = exports.isUserCenter = exports.formatUTCTime = exports.getUTCTime = exports.getTimeZone = exports.AccountForm = void 0;
|
|
16
|
+
exports.pdf = exports.parse = exports.http = exports.connect = exports.blockies = exports.axiosRetry = exports.apiEvent = exports.Storage = exports.Session = void 0;
|
|
17
|
+
exports.calcDotDeal = calcDotDeal;
|
|
18
|
+
exports.loadImportScript = loadImportScript;
|
|
19
|
+
const clipboard_copy_1 = __importDefault(require("clipboard-copy"));
|
|
20
|
+
const ethers_1 = require("ethers");
|
|
21
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
22
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
23
|
+
const index_1 = __importDefault(require("../config/index"));
|
|
24
|
+
const parse_1 = require("./parse");
|
|
25
|
+
const AccountForm = (account, accountType) => {
|
|
26
|
+
let AccArr = account.split("");
|
|
27
|
+
if (accountType === "Phone") {
|
|
28
|
+
let len = AccArr.length;
|
|
29
|
+
if (len < 7) {
|
|
30
|
+
return account;
|
|
31
|
+
}
|
|
32
|
+
else if (len <= 9 && len >= 7) {
|
|
33
|
+
let middle = Math.round(len / 2) - 1;
|
|
34
|
+
let startIndex = middle - 1;
|
|
35
|
+
AccArr.splice(startIndex, 3, '***');
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
let middle = len / 2 - 1;
|
|
39
|
+
let startIndex;
|
|
40
|
+
if (Math.floor(middle) == middle) {
|
|
41
|
+
startIndex = middle - 1;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
startIndex = Math.floor(middle) - 1;
|
|
45
|
+
}
|
|
46
|
+
AccArr.splice(startIndex, 4, '****');
|
|
47
|
+
}
|
|
48
|
+
return AccArr.join("");
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const indStr = AccArr.indexOf("@");
|
|
52
|
+
const indEnd = AccArr.lastIndexOf(".") - 1;
|
|
53
|
+
AccArr.splice(indStr + 1, indEnd - indStr, '***');
|
|
54
|
+
if (indStr < 3) {
|
|
55
|
+
AccArr.splice(indStr - 1, 1, "*");
|
|
56
|
+
}
|
|
57
|
+
else if (indStr >= 3 && indStr <= 5) {
|
|
58
|
+
AccArr.splice(indStr - 2, 2, "**");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
AccArr.splice(indStr - 3, 3, "***");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
;
|
|
65
|
+
return AccArr.join("");
|
|
66
|
+
};
|
|
67
|
+
exports.AccountForm = AccountForm;
|
|
68
|
+
/**
|
|
69
|
+
* @name: calc dots repalce nums
|
|
70
|
+
* @test: ●●●●●●● ●●●●●323q● 22323qw
|
|
71
|
+
* @msg: 22323 323q w
|
|
72
|
+
* @param {*}
|
|
73
|
+
* @return {*}
|
|
74
|
+
*/
|
|
75
|
+
const TEMPSAVEDATASPACE = {};
|
|
76
|
+
function calcDotDeal(val, resVal, sign = "●") {
|
|
77
|
+
let start = "";
|
|
78
|
+
let replaceArr = "";
|
|
79
|
+
let end = 0;
|
|
80
|
+
for (var i = 0, len = val.length; i < len; i++) {
|
|
81
|
+
if (val[i] == sign && !replaceArr)
|
|
82
|
+
start += resVal[i];
|
|
83
|
+
if (val[i] !== sign)
|
|
84
|
+
replaceArr += val[i];
|
|
85
|
+
if (val[i] == sign && replaceArr.length)
|
|
86
|
+
end++;
|
|
87
|
+
}
|
|
88
|
+
return start + replaceArr + (end > 0 ? resVal.slice(-end) : "");
|
|
89
|
+
}
|
|
90
|
+
const getTimeZone = () => {
|
|
91
|
+
let offset = new Date().getTimezoneOffset();
|
|
92
|
+
if (offset != 0) {
|
|
93
|
+
let symbol = Math.abs(offset) === offset ? "-" : "+";
|
|
94
|
+
let h = (Math.floor(Math.abs(offset) / 60) + "").padStart(2, "0");
|
|
95
|
+
let m = ((Math.abs(offset) % 60) + "").padStart(2, "0");
|
|
96
|
+
return `GMT${symbol}${h}:${m}`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
return "GMT+0";
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.getTimeZone = getTimeZone;
|
|
103
|
+
const getUTCTime = (d1) => {
|
|
104
|
+
return new Date(d1.getUTCFullYear(), d1.getUTCMonth(), d1.getUTCDate(), d1.getUTCHours(), d1.getUTCMinutes(), d1.getUTCSeconds()).getTime();
|
|
105
|
+
};
|
|
106
|
+
exports.getUTCTime = getUTCTime;
|
|
107
|
+
const formatUTCTime = (date) => {
|
|
108
|
+
try {
|
|
109
|
+
return dayjs_1.default.utc(date).format('YYYY-MM-DD HH:mm:ss UTC');
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
exports.formatUTCTime = formatUTCTime;
|
|
116
|
+
const isUserCenter = () => {
|
|
117
|
+
let configType = (site_config && site_config.centralization_type) || "";
|
|
118
|
+
return configType == "CENTRALIZATION";
|
|
119
|
+
};
|
|
120
|
+
exports.isUserCenter = isUserCenter;
|
|
121
|
+
const onEvents = (type, fn) => {
|
|
122
|
+
$Vue.$bus.$on(type, fn);
|
|
123
|
+
};
|
|
124
|
+
exports.onEvents = onEvents;
|
|
125
|
+
const emitEvents = (type, args) => {
|
|
126
|
+
$Vue.$bus.$emit(type, args);
|
|
127
|
+
};
|
|
128
|
+
exports.emitEvents = emitEvents;
|
|
129
|
+
const refreshEvents = (events) => {
|
|
130
|
+
$Vue && $Vue.$bus.$emit("refresh", events);
|
|
131
|
+
};
|
|
132
|
+
exports.refreshEvents = refreshEvents;
|
|
133
|
+
const emitLoading = (obj) => {
|
|
134
|
+
$Vue && $Vue.$bus.$emit("linkLoading", obj);
|
|
135
|
+
};
|
|
136
|
+
exports.emitLoading = emitLoading;
|
|
137
|
+
function loadImportScript(src, callback, saveKey) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return new Promise((resolve, reject) => {
|
|
140
|
+
var loadScriptArr = document.getElementsByTagName('script');
|
|
141
|
+
let loadScriptIndex = Array.from(loadScriptArr).find(v => {
|
|
142
|
+
return v.src == src;
|
|
143
|
+
});
|
|
144
|
+
if (loadScriptIndex) {
|
|
145
|
+
resolve(!saveKey ? true : TEMPSAVEDATASPACE[src]);
|
|
146
|
+
callback && callback();
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
var oS = document.createElement("script");
|
|
150
|
+
oS.src = src;
|
|
151
|
+
document.getElementsByTagName("head")[0].appendChild(oS);
|
|
152
|
+
oS.async = "async";
|
|
153
|
+
oS.onload = function () {
|
|
154
|
+
!saveKey && resolve(true);
|
|
155
|
+
if (saveKey) {
|
|
156
|
+
TEMPSAVEDATASPACE[src] = window[saveKey];
|
|
157
|
+
resolve(TEMPSAVEDATASPACE[src]);
|
|
158
|
+
}
|
|
159
|
+
callback && callback();
|
|
160
|
+
};
|
|
161
|
+
oS.onerror = function () {
|
|
162
|
+
reject(false);
|
|
163
|
+
callback && callback();
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const getToken = () => {
|
|
169
|
+
const token = localStorage.getItem("token");
|
|
170
|
+
if (token) {
|
|
171
|
+
return token;
|
|
172
|
+
}
|
|
173
|
+
return null;
|
|
174
|
+
};
|
|
175
|
+
exports.getToken = getToken;
|
|
176
|
+
const getAreaCode = () => {
|
|
177
|
+
const areaCode = sessionStorage.getItem("userAreaCode");
|
|
178
|
+
if (areaCode) {
|
|
179
|
+
return areaCode;
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
};
|
|
183
|
+
exports.getAreaCode = getAreaCode;
|
|
184
|
+
/**
|
|
185
|
+
*
|
|
186
|
+
* @param {*} text 复制的内容
|
|
187
|
+
*/
|
|
188
|
+
const copyText = (text, e) => {
|
|
189
|
+
(0, clipboard_copy_1.default)(text);
|
|
190
|
+
return true;
|
|
191
|
+
};
|
|
192
|
+
exports.copyText = copyText;
|
|
193
|
+
const isPhone = () => {
|
|
194
|
+
return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
|
|
195
|
+
};
|
|
196
|
+
exports.isPhone = isPhone;
|
|
197
|
+
const getChainId = function () {
|
|
198
|
+
let chainId = window.ethereum && window.ethereum.chainId || localStorage.getItem('networkId') || '';
|
|
199
|
+
if (!chainId) {
|
|
200
|
+
if (window.site_config) {
|
|
201
|
+
try {
|
|
202
|
+
let netWorkConfig = window.site_config['networks'];
|
|
203
|
+
let chainArr = netWorkConfig && JSON.parse(netWorkConfig);
|
|
204
|
+
chainId = chainArr && chainArr.length && chainArr[0].chainId;
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
// chainId = '4'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// console.log('getChainId:', chainId);
|
|
212
|
+
return parseInt(chainId);
|
|
213
|
+
};
|
|
214
|
+
exports.getChainId = getChainId;
|
|
215
|
+
// export const getChainLayer2Config = function(chainId = 4) {
|
|
216
|
+
// let layer2Config = {}
|
|
217
|
+
// if (window.site_config) {
|
|
218
|
+
// try {
|
|
219
|
+
// let config = window.site_config['layer2_config_' + chainId]
|
|
220
|
+
// layer2Config = config && config.length && JSON.parse(config)
|
|
221
|
+
// } catch (error) {
|
|
222
|
+
// layer2Config = {}
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
// return layer2Config
|
|
226
|
+
// }
|
|
227
|
+
const getLayer1RpcUrl = function (chainId) {
|
|
228
|
+
let netWroks = [];
|
|
229
|
+
chainId = chainId && parseInt(chainId) || '';
|
|
230
|
+
if (window.site_config) {
|
|
231
|
+
try {
|
|
232
|
+
let configNetworks = window.site_config['layer1_list'];
|
|
233
|
+
netWroks = configNetworks && configNetworks.length && JSON.parse(configNetworks) || [];
|
|
234
|
+
netWroks = netWroks.map(v => {
|
|
235
|
+
let config = Object.keys(v).length ? v[Object.keys(v)[0]] : {};
|
|
236
|
+
return {
|
|
237
|
+
rpc_url: config.layer1_rpc_url,
|
|
238
|
+
sub_type: 'layer1_config_',
|
|
239
|
+
subkey: Object.keys(v)[0]
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
netWroks = [];
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return netWroks.filter(v => {
|
|
248
|
+
return chainId && (v.sub_type + chainId == v.subkey) || !chainId;
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
exports.getLayer1RpcUrl = getLayer1RpcUrl;
|
|
252
|
+
const getChainLayer2Config = function (chainId = 4) {
|
|
253
|
+
let layer2Config = {};
|
|
254
|
+
if (window.site_config) {
|
|
255
|
+
try {
|
|
256
|
+
chainId = chainId && parseInt(chainId) || '';
|
|
257
|
+
let layer2_config = window.site_config['layer2_list'];
|
|
258
|
+
let layer1_config = (0, exports.getLayer1RpcUrl)(chainId);
|
|
259
|
+
let layer2ConfigArr = layer2_config && layer2_config.length && JSON.parse(layer2_config);
|
|
260
|
+
layer2ConfigArr.map(v => {
|
|
261
|
+
let layer2_key = Object.keys(v)[0];
|
|
262
|
+
if ('layer2_config_' + chainId == layer2_key) {
|
|
263
|
+
layer2Config = v[layer2_key];
|
|
264
|
+
layer2Config.web3j = layer1_config[0].rpc_url || '';
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
catch (error) {
|
|
269
|
+
layer2Config = {};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return layer2Config;
|
|
273
|
+
};
|
|
274
|
+
exports.getChainLayer2Config = getChainLayer2Config;
|
|
275
|
+
const toUpperDataKey = item => {
|
|
276
|
+
let resItem = item.replace(/\_(\w)/g, function (a, b) {
|
|
277
|
+
return b.toUpperCase();
|
|
278
|
+
});
|
|
279
|
+
return resItem;
|
|
280
|
+
};
|
|
281
|
+
exports.toUpperDataKey = toUpperDataKey;
|
|
282
|
+
const getMarketApi = function (chainId, connectType = "market_api", apiType) {
|
|
283
|
+
const store = window.$Vue.$store;
|
|
284
|
+
apiType = apiType || 'api';
|
|
285
|
+
if (connectType == 'perpetual') {
|
|
286
|
+
connectType = `market_${connectType}_${apiType}`;
|
|
287
|
+
}
|
|
288
|
+
else if (connectType == 'spot') {
|
|
289
|
+
connectType = `market_${apiType}`;
|
|
290
|
+
}
|
|
291
|
+
else if (!connectType) {
|
|
292
|
+
connectType = `market_${apiType}`;
|
|
293
|
+
}
|
|
294
|
+
let marketApi = '';
|
|
295
|
+
try {
|
|
296
|
+
let config = store.state.siteConfig[connectType] || store.state.siteConfig[(0, exports.toUpperDataKey)(connectType)];
|
|
297
|
+
let marketSettingObj = config && config.length && typeof config == 'string' && JSON.parse(config) || config || {};
|
|
298
|
+
marketApi = marketSettingObj[chainId] || marketSettingObj['0'] || '';
|
|
299
|
+
}
|
|
300
|
+
catch (error) {
|
|
301
|
+
marketApi = '';
|
|
302
|
+
}
|
|
303
|
+
return marketApi;
|
|
304
|
+
};
|
|
305
|
+
exports.getMarketApi = getMarketApi;
|
|
306
|
+
const getQueryChainId = function (isMarketType) {
|
|
307
|
+
const store = window.$Vue.$store;
|
|
308
|
+
let resChainId;
|
|
309
|
+
let multiChainId = localStorage.getItem('isMultiChains'); // 0 isnot multiChain, !0 mutiCHain
|
|
310
|
+
let isPerpetual = store.state.trade.tradeMode == 'perpetual'; // 是否是永续,永续暂时不支持多练聚合
|
|
311
|
+
if (((0, exports.isPhone)() || multiChainId * 1) && isMarketType && !isPerpetual) {
|
|
312
|
+
resChainId = '0';
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
resChainId = (0, exports.getTradeDefaultChainId)();
|
|
316
|
+
}
|
|
317
|
+
return resChainId;
|
|
318
|
+
};
|
|
319
|
+
exports.getQueryChainId = getQueryChainId;
|
|
320
|
+
const getTradeDefaultChainId = function () {
|
|
321
|
+
const store = window.$Vue.$store;
|
|
322
|
+
return store.state.chainId;
|
|
323
|
+
};
|
|
324
|
+
exports.getTradeDefaultChainId = getTradeDefaultChainId;
|
|
325
|
+
const isMobile = () => {
|
|
326
|
+
let isMobile = false;
|
|
327
|
+
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
|
|
328
|
+
// console.log('移动端');
|
|
329
|
+
isMobile = true;
|
|
330
|
+
}
|
|
331
|
+
if (document.body.clientWidth < 800) {
|
|
332
|
+
isMobile = true;
|
|
333
|
+
}
|
|
334
|
+
return isMobile;
|
|
335
|
+
};
|
|
336
|
+
exports.isMobile = isMobile;
|
|
337
|
+
const isInIsWalletApp = () => {
|
|
338
|
+
return navigator.userAgent.includes('isWallet');
|
|
339
|
+
};
|
|
340
|
+
exports.isInIsWalletApp = isInIsWalletApp;
|
|
341
|
+
const getStyleObj = (pageName, keyStr) => {
|
|
342
|
+
// let styleArrStr = ['commonConf', 'commonHeader', 'styleConf', 'indexStyleList'].join(',')
|
|
343
|
+
let resObj = {};
|
|
344
|
+
theme_config.map(v => {
|
|
345
|
+
v.pageList.map(component => {
|
|
346
|
+
component.configList.map(config => {
|
|
347
|
+
if (component.pageKey == 'common' && config.componentsKey == 'common_conf') {
|
|
348
|
+
let commonConf = (0, parse_1.unwrapJSONStr)(config.config) || {};
|
|
349
|
+
if (!!~keyStr.indexOf('commonConf')) {
|
|
350
|
+
resObj['commonConf'] = commonConf;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
if (component.pageKey == 'common' && config.componentsKey.startsWith('header')) {
|
|
354
|
+
let commonHeader = (0, parse_1.unwrapJSONStr)(config.config) || {};
|
|
355
|
+
if (!!~keyStr.indexOf('commonHeader')) {
|
|
356
|
+
resObj['commonHeader'] = commonHeader;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (component.pageKey == pageName && pageName != 'home' && config.componentsKey.startsWith('header')) {
|
|
360
|
+
let styleConf = (0, parse_1.unwrapJSONStr)(config.config);
|
|
361
|
+
if (!!~keyStr.indexOf('styleConf')) {
|
|
362
|
+
resObj['styleConf'] = styleConf;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
else if (component.pageKey == pageName && pageName == 'home' && config.componentsKey == 'common_conf' && component.pageKey == 'home') {
|
|
366
|
+
let indexStyleList = (0, parse_1.unwrapJSONStr)(config.config).headerStyleSet || [];
|
|
367
|
+
let styleConf = indexStyleList[0];
|
|
368
|
+
if (!!~keyStr.indexOf('styleConf')) {
|
|
369
|
+
resObj['styleConf'] = styleConf;
|
|
370
|
+
}
|
|
371
|
+
if (!!~keyStr.indexOf('indexStyleList')) {
|
|
372
|
+
resObj['indexStyleList'] = indexStyleList;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
// console.log('resObj', resObj)
|
|
379
|
+
return resObj;
|
|
380
|
+
};
|
|
381
|
+
exports.getStyleObj = getStyleObj;
|
|
382
|
+
const formDataEthers = (val, decimal) => {
|
|
383
|
+
return ethers_1.ethers.utils.formatUnits(val.toString(), decimal || 18);
|
|
384
|
+
};
|
|
385
|
+
exports.formDataEthers = formDataEthers;
|
|
386
|
+
const formatDateDecimal = (num = 0, decimal = 2, zoreFalse = 0) => {
|
|
387
|
+
if (!num && num !== 0)
|
|
388
|
+
return num;
|
|
389
|
+
let initVal = (0, exports.decimalFunc)(num, decimal);
|
|
390
|
+
if (!Number(initVal) && decimal < 6)
|
|
391
|
+
initVal = (0, exports.decimalFunc)(num, 6);
|
|
392
|
+
if (!Number(initVal) && decimal < 10)
|
|
393
|
+
initVal = (0, exports.decimalFunc)(num, 10);
|
|
394
|
+
let reg = initVal.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g;
|
|
395
|
+
initVal = initVal.replace(reg, '$1,');
|
|
396
|
+
if (!zoreFalse) {
|
|
397
|
+
if (!~initVal.indexOf('.'))
|
|
398
|
+
initVal = initVal + '.00';
|
|
399
|
+
else if (initVal.split('.')[1].length < 2)
|
|
400
|
+
initVal = initVal + '0';
|
|
401
|
+
}
|
|
402
|
+
return initVal;
|
|
403
|
+
};
|
|
404
|
+
exports.formatDateDecimal = formatDateDecimal;
|
|
405
|
+
const checkEthAddress = function (address) {
|
|
406
|
+
if (!address || (address && !address.startsWith("0x"))) {
|
|
407
|
+
return "address must start with '0x'";
|
|
408
|
+
}
|
|
409
|
+
else {
|
|
410
|
+
try {
|
|
411
|
+
let addressBytes = ethers_1.utils.arrayify(address);
|
|
412
|
+
if (addressBytes.length !== 20) {
|
|
413
|
+
return "Address must be 20 bytes long";
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
return "Address must be 20 bytes long";
|
|
418
|
+
}
|
|
419
|
+
return "";
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
exports.checkEthAddress = checkEthAddress;
|
|
423
|
+
const formatAccount = function (value) {
|
|
424
|
+
return exports.checkEthAddress && !(0, exports.checkEthAddress)(value) && (value.length > 10 && (value.slice(0, 4) + "******" + value.slice(-4, value.length)) || value) || value;
|
|
425
|
+
};
|
|
426
|
+
exports.formatAccount = formatAccount;
|
|
427
|
+
// trade-utils ----===---
|
|
428
|
+
const accMul = function accMul(arg1, arg2) {
|
|
429
|
+
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
|
|
430
|
+
try {
|
|
431
|
+
m += s1.split(".")[1].length;
|
|
432
|
+
}
|
|
433
|
+
catch (e) { }
|
|
434
|
+
try {
|
|
435
|
+
m += s2.split(".")[1].length;
|
|
436
|
+
}
|
|
437
|
+
catch (e) { }
|
|
438
|
+
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
|
|
439
|
+
};
|
|
440
|
+
exports.accMul = accMul;
|
|
441
|
+
const accDiv = function accDiv(arg1, arg2) {
|
|
442
|
+
var t1 = 0, t2 = 0, r1, r2;
|
|
443
|
+
try {
|
|
444
|
+
t1 = arg1.toString().split(".")[1].length;
|
|
445
|
+
}
|
|
446
|
+
catch (e) { }
|
|
447
|
+
try {
|
|
448
|
+
t2 = arg2.toString().split(".")[1].length;
|
|
449
|
+
}
|
|
450
|
+
catch (e) { }
|
|
451
|
+
r1 = Number(arg1.toString().replace(".", ""));
|
|
452
|
+
r2 = Number(arg2.toString().replace(".", ""));
|
|
453
|
+
return (r1 / r2) * Math.pow(10, t2 - t1);
|
|
454
|
+
};
|
|
455
|
+
exports.accDiv = accDiv;
|
|
456
|
+
const accAddSub = function (arg1, arg2, sign) {
|
|
457
|
+
var r1, r2, m, n;
|
|
458
|
+
try {
|
|
459
|
+
r1 = arg1.toString().split(".")[1].length;
|
|
460
|
+
}
|
|
461
|
+
catch (e) {
|
|
462
|
+
r1 = 0;
|
|
463
|
+
}
|
|
464
|
+
try {
|
|
465
|
+
r2 = arg2.toString().split(".")[1].length;
|
|
466
|
+
}
|
|
467
|
+
catch (e) {
|
|
468
|
+
r2 = 0;
|
|
469
|
+
}
|
|
470
|
+
m = Math.pow(10, Math.max(r1, r2));
|
|
471
|
+
if (sign == 1) {
|
|
472
|
+
return (arg1 * m + arg2 * m) / m;
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
n = (r1 >= r2) ? r1 : r2;
|
|
476
|
+
return ((arg1 * m - arg2 * m) / m).toFixed(n);
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
exports.accAddSub = accAddSub;
|
|
480
|
+
const getExplorer = function (chainId) {
|
|
481
|
+
return chainId == 4 ? 'rinkeby' : 'vm';
|
|
482
|
+
};
|
|
483
|
+
exports.getExplorer = getExplorer;
|
|
484
|
+
const getHashBlockUrl = (hash = '', chainId, layer) => {
|
|
485
|
+
const store = window.$Vue.$store;
|
|
486
|
+
const url = store.getters.filterNetworkItem(chainId, layer).blockExplorerUrl;
|
|
487
|
+
if (url) {
|
|
488
|
+
return url.endsWith("/") ? url + `tx/${hash}` : url + `/tx/${hash}`;
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
const privateUrl = window.site_config.block_explorer_url;
|
|
492
|
+
let txid = hash && hash.indexOf("sync-tx:") >= 0 ? hash.substring(8) : (hash || '');
|
|
493
|
+
let blockUrl = (privateUrl.endsWith("/") ? `${privateUrl}${chainId}/${layer}/` : `${privateUrl}/${chainId}/${layer}/`);
|
|
494
|
+
return blockUrl + `tx/${txid}`;
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
exports.getHashBlockUrl = getHashBlockUrl;
|
|
498
|
+
/**
|
|
499
|
+
* 格式化Token,向下取(截取)
|
|
500
|
+
* 返回示例:1,000.0, 1,000.1234
|
|
501
|
+
* @param {*} value // unit:ether
|
|
502
|
+
* @param {*} dp // 显示精度
|
|
503
|
+
*/
|
|
504
|
+
const formatTokenCommify = (value, dp = 0, addSuffixZero = true) => {
|
|
505
|
+
if (!value)
|
|
506
|
+
return value;
|
|
507
|
+
const arr = value.toString().split(".");
|
|
508
|
+
let result = ethers_1.utils.commify(arr[0]);
|
|
509
|
+
result += ".";
|
|
510
|
+
if (arr.length > 1 && dp > 0) {
|
|
511
|
+
result += arr[1].substr(0, dp);
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
result += "0";
|
|
515
|
+
}
|
|
516
|
+
return result;
|
|
517
|
+
};
|
|
518
|
+
exports.formatTokenCommify = formatTokenCommify;
|
|
519
|
+
const toRound = (value, ratio = 2) => {
|
|
520
|
+
if (value === null)
|
|
521
|
+
return null;
|
|
522
|
+
const base = Math.pow(10, ratio);
|
|
523
|
+
return new bignumber_js_1.default(value).times(base).integerValue(bignumber_js_1.default.ROUND_HALF_UP).div(base).toString();
|
|
524
|
+
};
|
|
525
|
+
exports.toRound = toRound;
|
|
526
|
+
/**
|
|
527
|
+
* 格式化法币价格/金额(四舍五入)
|
|
528
|
+
* 默认是格式化为10位。
|
|
529
|
+
* @param {*} value
|
|
530
|
+
* @param {Number} dp 显示精度
|
|
531
|
+
*/
|
|
532
|
+
const formatFiatCommify = (value, dp = 10) => {
|
|
533
|
+
if (!value)
|
|
534
|
+
return value;
|
|
535
|
+
let result = (0, exports.toRound)(value, dp);
|
|
536
|
+
// 格式化整数(逗号分割)
|
|
537
|
+
const arr = result.toString().split(".");
|
|
538
|
+
let integerStr = ethers_1.utils.commify(arr[0]);
|
|
539
|
+
let mantissa = arr[1] || '0';
|
|
540
|
+
return integerStr + "." + mantissa;
|
|
541
|
+
};
|
|
542
|
+
exports.formatFiatCommify = formatFiatCommify;
|
|
543
|
+
const formatNumber = function (val, decimal) {
|
|
544
|
+
let reg = new RegExp(`^(\\d+)\\.(\\d{0,${decimal}}).*$`);
|
|
545
|
+
val = val.toString().replace(reg, '$1.$2');
|
|
546
|
+
return val;
|
|
547
|
+
};
|
|
548
|
+
exports.formatNumber = formatNumber;
|
|
549
|
+
const decimalFunc = function (val, decimal = 2) {
|
|
550
|
+
let sign = val * 1 < 0;
|
|
551
|
+
val = Math.abs(val);
|
|
552
|
+
let reg = new RegExp(`^(\\d+)\\.(\\d{0,${decimal}}).*$`);
|
|
553
|
+
val = val.toString().replace(reg, '$1.$2');
|
|
554
|
+
// val = Number(val).toFixed(decimal)
|
|
555
|
+
let resVal = sign ? '-' + val : val;
|
|
556
|
+
return resVal;
|
|
557
|
+
};
|
|
558
|
+
exports.decimalFunc = decimalFunc;
|
|
559
|
+
const addZoreFormat = function (demical) {
|
|
560
|
+
var zoreInit = "0";
|
|
561
|
+
return zoreInit + "." + zoreInit.repeat(demical);
|
|
562
|
+
};
|
|
563
|
+
exports.addZoreFormat = addZoreFormat;
|
|
564
|
+
// 默认去掉0
|
|
565
|
+
const numberFormat = function (num, demical = 0, isZero = true) {
|
|
566
|
+
// console.log('numberFormat num, demical:',num, demical);
|
|
567
|
+
if ((!num || !(num * 1)) && !isZero) {
|
|
568
|
+
return (0, exports.addZoreFormat)(demical);
|
|
569
|
+
}
|
|
570
|
+
else {
|
|
571
|
+
num = (!isZero ? Number(num).toFixed(demical) + '' : Number(num).toFixed(demical) * 1) + "";
|
|
572
|
+
let reg = num.indexOf(".") > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g;
|
|
573
|
+
console.log();
|
|
574
|
+
return num.replace(reg, "$1,");
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
exports.numberFormat = numberFormat;
|
|
578
|
+
const numDecimals = function (val, decimals, zeroDecimals = 1) {
|
|
579
|
+
let dealVal = (val * 1).toFixed(decimals) * 1;
|
|
580
|
+
let zero = '0'.repeat(zeroDecimals);
|
|
581
|
+
if (dealVal != val * 1) {
|
|
582
|
+
dealVal = dealVal - Math.pow(10, -decimals);
|
|
583
|
+
}
|
|
584
|
+
return !!~(dealVal + '').indexOf('.') ? dealVal : (dealVal + '.' + zero);
|
|
585
|
+
};
|
|
586
|
+
exports.numDecimals = numDecimals;
|
|
587
|
+
const formatStringNum = (num = 0, decimal = 2, zoreFalse = 0) => {
|
|
588
|
+
if (!num && num !== 0)
|
|
589
|
+
return num;
|
|
590
|
+
let initVal = (0, exports.decimalFunc)(num, decimal);
|
|
591
|
+
if (!Number(initVal) && decimal < 6)
|
|
592
|
+
initVal = (0, exports.decimalFunc)(num, 6);
|
|
593
|
+
if (!Number(initVal) && decimal < 10)
|
|
594
|
+
initVal = (0, exports.decimalFunc)(num, 10);
|
|
595
|
+
let reg = initVal.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g;
|
|
596
|
+
// let reg = /(\d)(?=(?:\d{3})+$)/g
|
|
597
|
+
initVal = parseFloat(initVal) + '';
|
|
598
|
+
initVal = initVal.replace(reg, '$1,');
|
|
599
|
+
if (!zoreFalse) {
|
|
600
|
+
if (!~initVal.indexOf('.'))
|
|
601
|
+
initVal = initVal + '.00';
|
|
602
|
+
else if (initVal.split('.')[1].length < 2)
|
|
603
|
+
initVal = initVal + '0';
|
|
604
|
+
}
|
|
605
|
+
return initVal;
|
|
606
|
+
};
|
|
607
|
+
exports.formatStringNum = formatStringNum;
|
|
608
|
+
const formatArrStringNum = function (num) {
|
|
609
|
+
num = num + '';
|
|
610
|
+
if (num.indexOf('.') == -1) {
|
|
611
|
+
return [num, 1];
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
let decimal = num.split('.')[1].length;
|
|
615
|
+
// return [num * Math.pow(10, decimal), 1 * Math.pow(10, decimal)]
|
|
616
|
+
const a2 = Math.pow(10, decimal);
|
|
617
|
+
const a1 = new bignumber_js_1.default(num).times(a2).toNumber();
|
|
618
|
+
return [a1, a2];
|
|
619
|
+
}
|
|
620
|
+
};
|
|
621
|
+
exports.formatArrStringNum = formatArrStringNum;
|
|
622
|
+
const setDecimals = function (name, value) {
|
|
623
|
+
let decimalsArr = {};
|
|
624
|
+
try {
|
|
625
|
+
decimalsArr = JSON.parse(localStorage.getItem('decimalsArr'));
|
|
626
|
+
}
|
|
627
|
+
catch (error) {
|
|
628
|
+
decimalsArr = {};
|
|
629
|
+
}
|
|
630
|
+
if (!decimalsArr)
|
|
631
|
+
decimalsArr = {};
|
|
632
|
+
decimalsArr[name] = value;
|
|
633
|
+
localStorage.setItem('decimalsArr', JSON.stringify(decimalsArr));
|
|
634
|
+
};
|
|
635
|
+
exports.setDecimals = setDecimals;
|
|
636
|
+
const getDecimals = function (name) {
|
|
637
|
+
let decimalsArr = {};
|
|
638
|
+
try {
|
|
639
|
+
decimalsArr = JSON.parse(localStorage.getItem('decimalsArr'));
|
|
640
|
+
return decimalsArr[name];
|
|
641
|
+
}
|
|
642
|
+
catch (error) {
|
|
643
|
+
return [];
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
exports.getDecimals = getDecimals;
|
|
647
|
+
/**
|
|
648
|
+
* 获取金额
|
|
649
|
+
* data: {committed,available,locked}
|
|
650
|
+
*/
|
|
651
|
+
const filterL2Balance = (data, type, symbol) => {
|
|
652
|
+
if (!data)
|
|
653
|
+
return null;
|
|
654
|
+
if (Object.prototype.toString.call(data) !== "[object Object]")
|
|
655
|
+
return null;
|
|
656
|
+
if (!data[type])
|
|
657
|
+
return null;
|
|
658
|
+
if (!data[type]['balances'])
|
|
659
|
+
return null;
|
|
660
|
+
return data[type]['balances'][symbol];
|
|
661
|
+
};
|
|
662
|
+
exports.filterL2Balance = filterL2Balance;
|
|
663
|
+
const commify = (value) => {
|
|
664
|
+
if (value === null)
|
|
665
|
+
return null;
|
|
666
|
+
if (value === "+∞")
|
|
667
|
+
return "+∞";
|
|
668
|
+
if (value.toString().includes("e"))
|
|
669
|
+
return value;
|
|
670
|
+
return ethers_1.utils.commify(value);
|
|
671
|
+
};
|
|
672
|
+
exports.commify = commify;
|
|
673
|
+
// trade---
|
|
674
|
+
const getWalletCoinFee = function (transfer, fn) {
|
|
675
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
676
|
+
let syncWallet = transfer.syncWallet || $Vue && $Vue.walletData.getSyncWallet();
|
|
677
|
+
let provider = syncWallet.provider;
|
|
678
|
+
if (provider) {
|
|
679
|
+
const fullFee = yield provider.getTransactionFee('Transfer', transfer.address, index_1.default.getFeeType || transfer.token);
|
|
680
|
+
transfer.fee = fullFee.totalFee;
|
|
681
|
+
fn && fn(transfer.fee);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
fn && fn(transfer.fee);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
};
|
|
688
|
+
exports.getWalletCoinFee = getWalletCoinFee;
|
|
689
|
+
const getFee = function (transfer, fn) {
|
|
690
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
691
|
+
let provider = $Vue && $Vue.walletData.getSyncWallet().provider;
|
|
692
|
+
if (provider) {
|
|
693
|
+
const fullFee = yield provider.getTransactionFee('Transfer', transfer.address, index_1.default.getFeeType || transfer.token);
|
|
694
|
+
transfer.fee = fullFee.totalFee;
|
|
695
|
+
fn && fn(transfer.fee);
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
fn && fn(transfer.fee);
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
};
|
|
702
|
+
exports.getFee = getFee;
|
|
703
|
+
const shareUtils = (type, title) => {
|
|
704
|
+
let dest = {
|
|
705
|
+
href: '',
|
|
706
|
+
target: '_blank'
|
|
707
|
+
};
|
|
708
|
+
switch (type) {
|
|
709
|
+
case 'facebook':
|
|
710
|
+
dest.href = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href) + "&t=" + encodeURIComponent(title);
|
|
711
|
+
break;
|
|
712
|
+
case 'twitter':
|
|
713
|
+
dest.href = "https://twitter.com/intent/tweet?text=" + encodeURIComponent(title) + "&url=" + encodeURIComponent(window.location.href);
|
|
714
|
+
}
|
|
715
|
+
window.open(dest.href, dest.target);
|
|
716
|
+
};
|
|
717
|
+
exports.shareUtils = shareUtils;
|
|
7
718
|
var EventBus_js_1 = require("./EventBus.js");
|
|
8
719
|
Object.defineProperty(exports, "EventBus", { enumerable: true, get: function () { return __importDefault(EventBus_js_1).default; } });
|
|
9
720
|
var Session_js_1 = require("./Session.js");
|
|
@@ -20,8 +731,6 @@ var connect_js_1 = require("./connect.js");
|
|
|
20
731
|
Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return __importDefault(connect_js_1).default; } });
|
|
21
732
|
var http_js_1 = require("./http.js");
|
|
22
733
|
Object.defineProperty(exports, "http", { enumerable: true, get: function () { return __importDefault(http_js_1).default; } });
|
|
23
|
-
var isMobile_js_1 = require("./isMobile.js");
|
|
24
|
-
Object.defineProperty(exports, "isMobile", { enumerable: true, get: function () { return __importDefault(isMobile_js_1).default; } });
|
|
25
734
|
var parse_js_1 = require("./parse.js");
|
|
26
735
|
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return __importDefault(parse_js_1).default; } });
|
|
27
736
|
var pdf_js_1 = require("./pdf.js");
|
package/dist/utils/parse.d.ts
CHANGED
package/dist/utils/parse.js
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isJSON = isJSON;
|
|
4
4
|
exports.unwrapJSONStr = unwrapJSONStr;
|
|
5
|
+
/*
|
|
6
|
+
* @Author: lewis lewis@everylink.ai
|
|
7
|
+
* @Date: 2023-12-19 10:49:53
|
|
8
|
+
* @LastEditors: lewis lewis@everylink.ai
|
|
9
|
+
* @LastEditTime: 2025-09-19 17:07:58
|
|
10
|
+
* @FilePath: /localTools/Users/apple/web-front/web-front/src/common_modules/cms-submodule/utils/parse.js
|
|
11
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
12
|
+
*/
|
|
5
13
|
/**
|
|
6
14
|
* 判断是否是json 字符串
|
|
7
15
|
* @param {*} jsonString 字符串
|
|
@@ -29,3 +37,7 @@ function unwrapJSONStr(str) {
|
|
|
29
37
|
}
|
|
30
38
|
return str;
|
|
31
39
|
}
|
|
40
|
+
exports.default = {
|
|
41
|
+
isJSON,
|
|
42
|
+
unwrapJSONStr
|
|
43
|
+
};
|
package/dist/utils/pdf.d.ts
CHANGED
package/dist/utils/pdf.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.Pdfembed = void 0;
|
|
|
4
4
|
/*
|
|
5
5
|
* @Author:
|
|
6
6
|
* @Date: 2020-12-17 19:28:53
|
|
7
|
-
* @LastEditTime:
|
|
8
|
-
* @LastEditors:
|
|
7
|
+
* @LastEditTime: 2025-09-19 17:07:04
|
|
8
|
+
* @LastEditors: lewis lewis@everylink.ai
|
|
9
9
|
* @Description:
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
@@ -76,3 +76,6 @@ const Pdfembed = function () {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
exports.Pdfembed = Pdfembed;
|
|
79
|
+
exports.default = {
|
|
80
|
+
Pdfembed: exports.Pdfembed
|
|
81
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "udxcms",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "cms submodule",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "ISC",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"typescript": "^5.9.2"
|
|
19
|
+
"typescript": "^5.9.2",
|
|
20
|
+
"clipboard-copy": "^4.0.1",
|
|
21
|
+
"ethers": "^5.4.0",
|
|
22
|
+
"dayjs": "^1.11.2",
|
|
23
|
+
"bignumber.js": "^9.0.2"
|
|
20
24
|
}
|
|
21
25
|
}
|