udxcms 1.0.15 → 1.0.17
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.js +54 -88
- package/dist/api/h5/axios.js +15 -20
- package/dist/api/h5/common.js +21 -37
- package/dist/api/index.js +20 -62
- package/dist/components/businessComponents/Header.vue +1 -1
- package/dist/config/const.js +5 -8
- package/dist/config/index.js +1 -3
- package/dist/filter/dateyear.js +1 -4
- package/dist/filter/numberFormat.js +1 -4
- package/dist/index.js +35 -60
- package/dist/libs/localStorageConstant.js +18 -21
- package/dist/mixins/themeMixin-votex.js +1 -3
- package/dist/mixins/themeMixin.js +1 -3
- package/dist/router/Home.js +32 -70
- package/dist/router/index.js +1 -8
- package/dist/store/CmsStore.js +3 -5
- package/dist/store/CmsStoreH5.js +4 -6
- package/dist/store/index.js +2 -10
- package/dist/utils/EventBus.js +1 -4
- package/dist/utils/Session.js +1 -4
- package/dist/utils/Storage.js +2 -38
- package/dist/utils/apiEvent.js +2 -7
- package/dist/utils/axiosRetry.js +9 -14
- package/dist/utils/connect.js +21 -29
- package/dist/utils/http.js +17 -24
- package/dist/utils/index.js +97 -166
- package/dist/utils/isMobile.js +1 -4
- package/dist/utils/parse.js +3 -7
- package/dist/utils/pdf.js +3 -7
- package/package.json +1 -1
package/dist/api/common.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Descripttion:
|
|
4
3
|
* @version:
|
|
@@ -7,103 +6,84 @@
|
|
|
7
6
|
* @LastEditors: Lewis
|
|
8
7
|
* @LastEditTime: 2021-12-14 00:31:16
|
|
9
8
|
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.isMerchant = exports.getSignleSymbolPrice = exports.getWhitePaper = exports.isFavor = exports.favor = exports.getService = exports.getPssistance = exports.getAnnouncement = exports.getCoin = exports.fetchNetworkList = exports.getTokens = exports.getTradeOverview = exports.getRewardsOverview = exports.getBlocksOverview = exports.getLocation = exports.breakdown = exports.setReadById = exports.setRead = exports.getUnreadCount = exports.getMessage = exports.logOut = exports.getMedias = exports.geeTest = exports.getLanguages = exports.setLanguage = exports.setCurrency = exports.getCurrency = exports.getPhoneCode = void 0;
|
|
15
9
|
let MemberUrl = '/member'; // 私域名 变量
|
|
16
10
|
const BASECMS = '/cms/v1.0';
|
|
17
11
|
const BASEHADE = '/notifications/v1.0';
|
|
18
12
|
const BASEPATH = '/member';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
import { instance } from './index';
|
|
14
|
+
import store from '../store/CmsStore';
|
|
15
|
+
import config from './../config/index';
|
|
22
16
|
function getHost() {
|
|
23
17
|
// const host = 'http://127.0.0.1:7001';
|
|
24
18
|
const host = window.site_config["payment_api_path"];
|
|
25
19
|
return host;
|
|
26
20
|
}
|
|
27
21
|
let axios = {
|
|
28
|
-
request:
|
|
22
|
+
request: instance
|
|
29
23
|
};
|
|
30
|
-
const getPhoneCode = (params) => {
|
|
31
|
-
return
|
|
24
|
+
export const getPhoneCode = (params) => {
|
|
25
|
+
return instance.get(`/notifications/v1.0/country/phone-codes`, { params });
|
|
32
26
|
};
|
|
33
|
-
exports.getPhoneCode = getPhoneCode;
|
|
34
27
|
// get the currencies
|
|
35
|
-
const getCurrency = () => {
|
|
36
|
-
return
|
|
28
|
+
export const getCurrency = () => {
|
|
29
|
+
return instance.get(`/member/v1.0/country/currencies`);
|
|
37
30
|
};
|
|
38
|
-
exports.getCurrency = getCurrency;
|
|
39
31
|
// set the currencies
|
|
40
|
-
const setCurrency = (currency) => {
|
|
41
|
-
return
|
|
32
|
+
export const setCurrency = (currency) => {
|
|
33
|
+
return instance.put(`/member/v1.0/member/currency`, { currency }, { 'content-type': 'application/json' });
|
|
42
34
|
};
|
|
43
|
-
exports.setCurrency = setCurrency;
|
|
44
35
|
// set language
|
|
45
|
-
const setLanguage = (data) => {
|
|
46
|
-
return
|
|
36
|
+
export const setLanguage = (data) => {
|
|
37
|
+
return instance({
|
|
47
38
|
url: `${MemberUrl}/v1.0/member/language`,
|
|
48
39
|
method: 'put',
|
|
49
40
|
data
|
|
50
41
|
});
|
|
51
42
|
};
|
|
52
|
-
exports.setLanguage = setLanguage;
|
|
53
43
|
// get language list
|
|
54
|
-
const getLanguages = () => {
|
|
44
|
+
export const getLanguages = () => {
|
|
55
45
|
console.log('getLanguages in cms-submodule');
|
|
56
|
-
return
|
|
46
|
+
return instance({
|
|
57
47
|
url: `/member/v1.0/languages`,
|
|
58
48
|
method: 'GET'
|
|
59
49
|
});
|
|
60
50
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return index_1.instance.post(`/member/v1.0/member/security/captcha/geetest/register`, { client_type: "WEB" });
|
|
51
|
+
export const geeTest = () => {
|
|
52
|
+
return instance.post(`/member/v1.0/member/security/captcha/geetest/register`, { client_type: "WEB" });
|
|
64
53
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return index_1.instance.get(`${BASECMS}/cms/medias`);
|
|
54
|
+
export const getMedias = data => {
|
|
55
|
+
return instance.get(`${BASECMS}/cms/medias`);
|
|
68
56
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return index_1.instance.post(`${MemberUrl}/v1.0/member/logout`, {});
|
|
57
|
+
export const logOut = () => {
|
|
58
|
+
return instance.post(`${MemberUrl}/v1.0/member/logout`, {});
|
|
72
59
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return index_1.instance.get(`${BASEHADE}/notifications/me/messages?page_no=${data.page_number}&page_size=${data.page_size}`, { isNotGoToLogin: true });
|
|
60
|
+
export const getMessage = data => {
|
|
61
|
+
return instance.get(`${BASEHADE}/notifications/me/messages?page_no=${data.page_number}&page_size=${data.page_size}`, { isNotGoToLogin: true });
|
|
76
62
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return index_1.instance.get(`${BASEHADE}/notifications/me/messages/unread/count`, { isNotGoToLogin: true });
|
|
63
|
+
export const getUnreadCount = () => {
|
|
64
|
+
return instance.get(`${BASEHADE}/notifications/me/messages/unread/count`, { isNotGoToLogin: true });
|
|
80
65
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return index_1.instance.put(`${BASEHADE}/notifications/me/messages/read`);
|
|
66
|
+
export const setRead = () => {
|
|
67
|
+
return instance.put(`${BASEHADE}/notifications/me/messages/read`);
|
|
84
68
|
};
|
|
85
|
-
|
|
86
|
-
const setReadById = data => {
|
|
69
|
+
export const setReadById = data => {
|
|
87
70
|
let id = data.id;
|
|
88
|
-
return
|
|
71
|
+
return instance.put(`${BASEHADE}/notifications/me/messages/${id}/read`);
|
|
89
72
|
};
|
|
90
|
-
|
|
91
|
-
const breakdown = params => {
|
|
73
|
+
export const breakdown = params => {
|
|
92
74
|
return axios.request({
|
|
93
75
|
url: `/wallet/v1.0/breakdown`,
|
|
94
76
|
method: 'get',
|
|
95
77
|
params
|
|
96
78
|
});
|
|
97
79
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return index_1.instance.get(`/member/v1.0/member/location`);
|
|
80
|
+
export const getLocation = () => {
|
|
81
|
+
return instance.get(`/member/v1.0/member/location`);
|
|
101
82
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (CmsStore_1.default.state.explorerSets.api_url) {
|
|
83
|
+
export const getBlocksOverview = data => {
|
|
84
|
+
if (store.state.explorerSets.api_url) {
|
|
105
85
|
return axios.request({
|
|
106
|
-
url: `${
|
|
86
|
+
url: `${store.state.explorerSets.api_url}/blocks/overview`,
|
|
107
87
|
// url: `http://xapi.chainscan.powx.io/blocks/overview`,
|
|
108
88
|
method: 'get',
|
|
109
89
|
params: data,
|
|
@@ -116,8 +96,7 @@ const getBlocksOverview = data => {
|
|
|
116
96
|
});
|
|
117
97
|
}
|
|
118
98
|
};
|
|
119
|
-
|
|
120
|
-
const getRewardsOverview = params => {
|
|
99
|
+
export const getRewardsOverview = params => {
|
|
121
100
|
const baseUrl = window.site_config['site_common_chain_scan_api_url'];
|
|
122
101
|
// const baseUrl = 'http://xapi.chainscan.powx.io';
|
|
123
102
|
return axios.request({
|
|
@@ -127,8 +106,7 @@ const getRewardsOverview = params => {
|
|
|
127
106
|
unToken: true
|
|
128
107
|
});
|
|
129
108
|
};
|
|
130
|
-
|
|
131
|
-
const getTradeOverview = params => {
|
|
109
|
+
export const getTradeOverview = params => {
|
|
132
110
|
// https://xapi.powx.io/rinkeby/market/v1.0/markets/overview?chain_id=4
|
|
133
111
|
const { url, data } = params;
|
|
134
112
|
return axios.request({
|
|
@@ -137,35 +115,31 @@ const getTradeOverview = params => {
|
|
|
137
115
|
params: data,
|
|
138
116
|
});
|
|
139
117
|
};
|
|
140
|
-
|
|
141
|
-
const getTokens = () => {
|
|
118
|
+
export const getTokens = () => {
|
|
142
119
|
return axios.request({
|
|
143
|
-
url: `${
|
|
120
|
+
url: `${config.sitePath}networks/contract-map.json`,
|
|
144
121
|
// url: 'https://djgs8mufg9606.cloudfront.net/networks/tokens.json',
|
|
145
122
|
method: 'get',
|
|
146
123
|
unToken: true
|
|
147
124
|
});
|
|
148
125
|
};
|
|
149
|
-
|
|
150
|
-
const fetchNetworkList = () => {
|
|
126
|
+
export const fetchNetworkList = () => {
|
|
151
127
|
return axios.request({
|
|
152
|
-
url: `${
|
|
128
|
+
url: `${config.sitePath}networks/network_list.json`,
|
|
153
129
|
method: 'get',
|
|
154
130
|
unToken: true
|
|
155
131
|
});
|
|
156
132
|
};
|
|
157
|
-
|
|
158
|
-
const getCoin = data => {
|
|
133
|
+
export const getCoin = data => {
|
|
159
134
|
return axios.request({
|
|
160
135
|
url: `/wallet/v1.0/coins`,
|
|
161
136
|
method: 'get',
|
|
162
137
|
params: data
|
|
163
138
|
});
|
|
164
139
|
};
|
|
165
|
-
exports.getCoin = getCoin;
|
|
166
140
|
// -- cms -- / start
|
|
167
141
|
// get white paper
|
|
168
|
-
const getAnnouncement = type => {
|
|
142
|
+
export const getAnnouncement = type => {
|
|
169
143
|
return axios.request({
|
|
170
144
|
url: `/cms/v1.0/cms/announcement`,
|
|
171
145
|
method: 'get',
|
|
@@ -174,9 +148,8 @@ const getAnnouncement = type => {
|
|
|
174
148
|
}
|
|
175
149
|
});
|
|
176
150
|
};
|
|
177
|
-
exports.getAnnouncement = getAnnouncement;
|
|
178
151
|
// Get the protocol of service
|
|
179
|
-
const getPssistance = type => {
|
|
152
|
+
export const getPssistance = type => {
|
|
180
153
|
return axios.request({
|
|
181
154
|
url: `/cms/v1.0/cms/assistance`,
|
|
182
155
|
method: 'get',
|
|
@@ -185,35 +158,30 @@ const getPssistance = type => {
|
|
|
185
158
|
}
|
|
186
159
|
});
|
|
187
160
|
};
|
|
188
|
-
exports.getPssistance = getPssistance;
|
|
189
161
|
// Get the protocol of service
|
|
190
|
-
const getService = data => {
|
|
191
|
-
return
|
|
162
|
+
export const getService = data => {
|
|
163
|
+
return instance.get(`${BASECMS}/cms/assistance/protocol`);
|
|
192
164
|
};
|
|
193
|
-
exports.getService = getService;
|
|
194
165
|
// post the favor of activity
|
|
195
|
-
const favor = data => {
|
|
196
|
-
return
|
|
166
|
+
export const favor = data => {
|
|
167
|
+
return instance.post(`${BASEPATH}/v1.0/favor/change`, {
|
|
197
168
|
favor_type: 1,
|
|
198
169
|
biz_id: data.bizId,
|
|
199
170
|
is_favor: data.favor
|
|
200
171
|
});
|
|
201
172
|
};
|
|
202
|
-
exports.favor = favor;
|
|
203
173
|
// post the favor of activity
|
|
204
|
-
const isFavor = data => {
|
|
205
|
-
return
|
|
174
|
+
export const isFavor = data => {
|
|
175
|
+
return instance.get(`${BASEPATH}/v1.0/favor/exist/${data.type}/${data.bizId}`, {
|
|
206
176
|
isNotGoToLogin: true,
|
|
207
177
|
});
|
|
208
178
|
};
|
|
209
|
-
exports.isFavor = isFavor;
|
|
210
179
|
// get banner imgs
|
|
211
|
-
const getWhitePaper = data => {
|
|
212
|
-
return
|
|
180
|
+
export const getWhitePaper = data => {
|
|
181
|
+
return instance.get(`${BASECMS}/announcements?announcement_type=${data.announcement_type}`, {});
|
|
213
182
|
};
|
|
214
|
-
exports.getWhitePaper = getWhitePaper;
|
|
215
183
|
// -- cms -- / end
|
|
216
|
-
const getSignleSymbolPrice = data => {
|
|
184
|
+
export const getSignleSymbolPrice = data => {
|
|
217
185
|
return axios.request({
|
|
218
186
|
url: `${site_config.site_common_market_api_url}/data/price`,
|
|
219
187
|
method: "get",
|
|
@@ -221,18 +189,16 @@ const getSignleSymbolPrice = data => {
|
|
|
221
189
|
unToken: true
|
|
222
190
|
});
|
|
223
191
|
};
|
|
224
|
-
|
|
225
|
-
const isMerchant = (params, headers = {}) => {
|
|
192
|
+
export const isMerchant = (params, headers = {}) => {
|
|
226
193
|
const host = getHost();
|
|
227
194
|
if (!host)
|
|
228
195
|
return new Promise((resove, reject) => {
|
|
229
196
|
reject(false);
|
|
230
197
|
});
|
|
231
|
-
return
|
|
198
|
+
return instance.get(`${host}/v1.0/merchant/is_merchant`, {
|
|
232
199
|
params,
|
|
233
200
|
isNotGoToLogin: true,
|
|
234
201
|
headers: Object.assign({}, headers)
|
|
235
202
|
});
|
|
236
203
|
};
|
|
237
|
-
exports.isMerchant = isMerchant;
|
|
238
204
|
// -- get single-symbole-price -- /
|
package/dist/api/h5/axios.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Author: Sneed
|
|
4
3
|
* @Date: 2020-12-27 22:43:10
|
|
@@ -6,16 +5,12 @@
|
|
|
6
5
|
* @LastEditors: lewis lewis@everylink.ai
|
|
7
6
|
* @Description:
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const axios_1 = __importDefault(require("axios"));
|
|
14
|
-
const utils_1 = require("../../utils");
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import { getAreaCode, getChainId, getMarketApi } from '../../utils';
|
|
15
10
|
// import Store from '@/store/index'
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
import Storage from '../../utils/Storage';
|
|
12
|
+
import { retryCount, retryDelay, retryFun, getBaseUrl } from "../../utils/axiosRetry";
|
|
13
|
+
import { getEventCenter } from "../../index";
|
|
19
14
|
var dealMarktUrl = function (url) {
|
|
20
15
|
if (url.endsWith('/market'))
|
|
21
16
|
return url.slice(0, url.length - '/market'.length);
|
|
@@ -29,20 +24,20 @@ class HttpRequest {
|
|
|
29
24
|
}
|
|
30
25
|
getInsideConfig() {
|
|
31
26
|
// let baseURL = process.env.NODE_ENV=='development' ? '' : i18n.t('site_common_api_url');
|
|
32
|
-
const { store } =
|
|
27
|
+
const { store } = getEventCenter();
|
|
33
28
|
const config = {
|
|
34
29
|
baseURL: this.baseUrl,
|
|
35
|
-
retry:
|
|
36
|
-
retryDelay:
|
|
30
|
+
retry: retryCount,
|
|
31
|
+
retryDelay: retryDelay,
|
|
37
32
|
// baseURL,
|
|
38
33
|
headers: {
|
|
39
34
|
// 请求头信息
|
|
40
35
|
client_id: 'h5',
|
|
41
|
-
'x-auth-token':
|
|
36
|
+
'x-auth-token': Storage.get('TOKEN'),
|
|
42
37
|
'language': store.state.language,
|
|
43
38
|
timezone: store.state.timezone,
|
|
44
39
|
country: store.state.country,
|
|
45
|
-
code:
|
|
40
|
+
code: getAreaCode()
|
|
46
41
|
}
|
|
47
42
|
};
|
|
48
43
|
return config;
|
|
@@ -52,8 +47,8 @@ class HttpRequest {
|
|
|
52
47
|
instance.interceptors.request.use(config => {
|
|
53
48
|
this.queue[url] = true;
|
|
54
49
|
let hostname = window.location.hostname;
|
|
55
|
-
let base_url =
|
|
56
|
-
let base_url_market = (site_config &&
|
|
50
|
+
let base_url = getBaseUrl(0);
|
|
51
|
+
let base_url_market = (site_config && getMarketApi(getChainId())) || "";
|
|
57
52
|
if (base_url.length && hostname) {
|
|
58
53
|
config.baseURL = base_url;
|
|
59
54
|
}
|
|
@@ -68,7 +63,7 @@ class HttpRequest {
|
|
|
68
63
|
});
|
|
69
64
|
// 响应拦截
|
|
70
65
|
instance.interceptors.response.use(res => {
|
|
71
|
-
const { store } =
|
|
66
|
+
const { store } = getEventCenter();
|
|
72
67
|
// 接口成功
|
|
73
68
|
const { data, status } = res;
|
|
74
69
|
// 状态判断
|
|
@@ -108,7 +103,7 @@ class HttpRequest {
|
|
|
108
103
|
});
|
|
109
104
|
}
|
|
110
105
|
request(options, ignoreExpired = false) {
|
|
111
|
-
const instance =
|
|
106
|
+
const instance = axios.create();
|
|
112
107
|
let oldOptions = this.getInsideConfig();
|
|
113
108
|
if (options.headers) {
|
|
114
109
|
Object.assign(oldOptions.headers, options.headers);
|
|
@@ -121,4 +116,4 @@ class HttpRequest {
|
|
|
121
116
|
}
|
|
122
117
|
const baseUrl = '';
|
|
123
118
|
const reqAxios = new HttpRequest(baseUrl);
|
|
124
|
-
|
|
119
|
+
export default reqAxios;
|
package/dist/api/h5/common.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Descripttion:
|
|
4
3
|
* @version:
|
|
@@ -7,90 +6,76 @@
|
|
|
7
6
|
* @LastEditors: Lewis
|
|
8
7
|
* @LastEditTime: 2021-09-02 09:37:44
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.geetestInfo = exports.readAll = exports.getUnreadCount = exports.Logout = exports.setLanguage = exports.walletconnectLogin = exports.getSecretKey = exports.getCoin = exports.breakdown = exports.getBlocksOverview = void 0;
|
|
15
|
-
const axios_1 = __importDefault(require("./axios"));
|
|
9
|
+
import axios from './axios';
|
|
16
10
|
const BaseWalletUrl = '/wallet';
|
|
17
11
|
const MemberUrl = '/member';
|
|
18
12
|
const NotificationsUrl = '/notifications';
|
|
19
|
-
const getBlocksOverview = data => {
|
|
20
|
-
return
|
|
13
|
+
export const getBlocksOverview = data => {
|
|
14
|
+
return axios.request({
|
|
21
15
|
url: `/trade-mining/v1.0/blocks/overview`,
|
|
22
16
|
method: 'get',
|
|
23
17
|
params: data,
|
|
24
18
|
});
|
|
25
19
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return axios_1.default.request({
|
|
20
|
+
export const breakdown = params => {
|
|
21
|
+
return axios.request({
|
|
29
22
|
url: `${BaseWalletUrl}/v1.0/breakdown`,
|
|
30
23
|
method: 'get',
|
|
31
24
|
params
|
|
32
25
|
});
|
|
33
26
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return axios_1.default.request({
|
|
27
|
+
export const getCoin = data => {
|
|
28
|
+
return axios.request({
|
|
37
29
|
url: `${BaseWalletUrl}/v1.0/coins`,
|
|
38
30
|
method: 'get',
|
|
39
31
|
});
|
|
40
32
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return axios_1.default.request({
|
|
33
|
+
export const getSecretKey = data => {
|
|
34
|
+
return axios.request({
|
|
44
35
|
url: `${MemberUrl}/v1.0/wallet-connect/connect`,
|
|
45
36
|
data,
|
|
46
37
|
method: 'post'
|
|
47
38
|
});
|
|
48
39
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return axios_1.default.request({
|
|
40
|
+
export const walletconnectLogin = data => {
|
|
41
|
+
return axios.request({
|
|
52
42
|
url: `${MemberUrl}/v1.0/member/login/wallet-client`,
|
|
53
43
|
data,
|
|
54
44
|
method: 'post'
|
|
55
45
|
});
|
|
56
46
|
};
|
|
57
|
-
exports.walletconnectLogin = walletconnectLogin;
|
|
58
47
|
// set language
|
|
59
|
-
const setLanguage = (data) => {
|
|
60
|
-
return
|
|
48
|
+
export const setLanguage = (data) => {
|
|
49
|
+
return axios.request({
|
|
61
50
|
url: `${MemberUrl}/v1.0/member/language`,
|
|
62
51
|
method: 'put',
|
|
63
52
|
data
|
|
64
53
|
});
|
|
65
54
|
};
|
|
66
|
-
exports.setLanguage = setLanguage;
|
|
67
55
|
// 退出
|
|
68
|
-
const Logout = () => {
|
|
69
|
-
return
|
|
56
|
+
export const Logout = () => {
|
|
57
|
+
return axios.request({
|
|
70
58
|
url: `${MemberUrl}/v1.0/member/logout`,
|
|
71
59
|
method: 'post'
|
|
72
60
|
});
|
|
73
61
|
};
|
|
74
|
-
exports.Logout = Logout;
|
|
75
62
|
// notification
|
|
76
63
|
// Get user's unread count of messages
|
|
77
|
-
const getUnreadCount = () => {
|
|
78
|
-
return
|
|
64
|
+
export const getUnreadCount = () => {
|
|
65
|
+
return axios.request({
|
|
79
66
|
url: `${NotificationsUrl}/v1.0/notifications/me/messages/unread/count`,
|
|
80
67
|
method: 'get',
|
|
81
68
|
}, true);
|
|
82
69
|
};
|
|
83
|
-
exports.getUnreadCount = getUnreadCount;
|
|
84
70
|
// Set all the messages status to already read
|
|
85
|
-
const readAll = () => {
|
|
86
|
-
return
|
|
71
|
+
export const readAll = () => {
|
|
72
|
+
return axios.request({
|
|
87
73
|
url: `${baseUrl}/v1.0/notifications/me/messages/read`,
|
|
88
74
|
method: 'PUT',
|
|
89
75
|
});
|
|
90
76
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return axios_1.default.request({
|
|
77
|
+
export const geetestInfo = () => {
|
|
78
|
+
return axios.request({
|
|
94
79
|
url: `${MemberUrl}/v1.0/member/security/captcha/geetest/register`,
|
|
95
80
|
data: {
|
|
96
81
|
client_type
|
|
@@ -98,4 +83,3 @@ const geetestInfo = () => {
|
|
|
98
83
|
method: 'post'
|
|
99
84
|
});
|
|
100
85
|
};
|
|
101
|
-
exports.geetestInfo = geetestInfo;
|
package/dist/api/index.js
CHANGED
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
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
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
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
1
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
2
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
3
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -44,26 +7,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
8
|
});
|
|
46
9
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
|
|
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");
|
|
10
|
+
import axios from "axios";
|
|
11
|
+
import conf from "../config/index";
|
|
12
|
+
import { getTimeZone, getChainId, getMarketApi } from "../utils/index";
|
|
13
|
+
import Storage from "../utils/Storage";
|
|
14
|
+
import { retryCount, retryDelay, retryFun, getBaseUrl } from "../utils/axiosRetry";
|
|
57
15
|
var mergeConfig = require("axios/lib/core/mergeConfig");
|
|
58
|
-
|
|
59
|
-
const instance =
|
|
16
|
+
import { getEventCenter } from "../index";
|
|
17
|
+
const instance = axios.create({
|
|
60
18
|
baseURL: "",
|
|
61
|
-
timeout:
|
|
62
|
-
retry:
|
|
63
|
-
retryDelay:
|
|
19
|
+
timeout: conf.timeOut,
|
|
20
|
+
retry: retryCount,
|
|
21
|
+
retryDelay: retryDelay,
|
|
64
22
|
headers: {},
|
|
65
23
|
});
|
|
66
|
-
exports.instance = instance;
|
|
67
24
|
var dealMarktUrl = function (url) {
|
|
68
25
|
if (url.endsWith("/market"))
|
|
69
26
|
return url.slice(0, url.length - "/market".length);
|
|
@@ -78,9 +35,9 @@ instance.delete = function (url, data, config) {
|
|
|
78
35
|
}));
|
|
79
36
|
};
|
|
80
37
|
instance.interceptors.request.use(function (config) {
|
|
81
|
-
const { store } =
|
|
82
|
-
let base_url =
|
|
83
|
-
let base_url_market = (site_config &&
|
|
38
|
+
const { store } = getEventCenter();
|
|
39
|
+
let base_url = getBaseUrl(0);
|
|
40
|
+
let base_url_market = (site_config && getMarketApi(getChainId())) || "";
|
|
84
41
|
// console.log('base_url_market:', base_url_market);
|
|
85
42
|
let hostname = window.location.hostname;
|
|
86
43
|
if (base_url.length) {
|
|
@@ -93,12 +50,12 @@ instance.interceptors.request.use(function (config) {
|
|
|
93
50
|
config.baseURL = dealMarktUrl(base_url_market);
|
|
94
51
|
}
|
|
95
52
|
if (!config.unToken) {
|
|
96
|
-
config.headers["x-auth-token"] =
|
|
53
|
+
config.headers["x-auth-token"] = Storage.get("TOKEN");
|
|
97
54
|
config.headers["client_id"] = "WEB";
|
|
98
55
|
config.headers["language"] = localStorage.getItem("language");
|
|
99
56
|
config.headers["timezone"] =
|
|
100
57
|
(store.state.user && store.state.user.userInfo && store.state.user.userInfo.timezone) ||
|
|
101
|
-
|
|
58
|
+
getTimeZone() ||
|
|
102
59
|
"";
|
|
103
60
|
config.headers["country"] =
|
|
104
61
|
(store.state.user && store.state.user.userInfo && store.state.user.userInfo.country) ||
|
|
@@ -117,7 +74,7 @@ instance.interceptors.request.use(function (config) {
|
|
|
117
74
|
instance.interceptors.response.use(function (response) {
|
|
118
75
|
let isNotGoToLogin = response.config.isNotGoToLogin;
|
|
119
76
|
if (response) {
|
|
120
|
-
const { store, router } =
|
|
77
|
+
const { store, router } = getEventCenter();
|
|
121
78
|
let code = response.data.code;
|
|
122
79
|
response.data.codeMessage = response.data.message;
|
|
123
80
|
if (code == "200" || (response.status === 200 && !code) || code === 3) {
|
|
@@ -156,8 +113,9 @@ instance.interceptors.response.use(function (response) {
|
|
|
156
113
|
}
|
|
157
114
|
}
|
|
158
115
|
}, (error) => __awaiter(void 0, void 0, void 0, function* () {
|
|
159
|
-
const res = yield
|
|
116
|
+
const res = yield retryFun(instance, error);
|
|
160
117
|
return res;
|
|
161
118
|
}));
|
|
162
|
-
|
|
163
|
-
|
|
119
|
+
export { instance };
|
|
120
|
+
export * from './common.js';
|
|
121
|
+
export * as H5Common from './h5/common.js';
|
|
@@ -137,7 +137,7 @@ const header = {
|
|
|
137
137
|
let componentName = this.commonConf.indexHeader || ''
|
|
138
138
|
this.showUnit = this.commonConf.showUnit || ''
|
|
139
139
|
if (Object.keys(this.commonConf).length) {
|
|
140
|
-
this.$store.commit('setCommonConf', this.commonConf)
|
|
140
|
+
this.$store.commit('CmsStore/setCommonConf', this.commonConf)
|
|
141
141
|
}
|
|
142
142
|
// this.componentId = 'header_dex' || componentName || 'header_b'
|
|
143
143
|
this.componentId = componentName || 'header_b'
|
package/dist/config/const.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* @Author: Sneed
|
|
4
3
|
* @Date: 2020-11-10 15:52:43
|
|
@@ -6,11 +5,9 @@
|
|
|
6
5
|
* @LastEditors: Lewis
|
|
7
6
|
* @Description: 修改password正则表达式
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
exports.number = exports.code = exports.email = exports.password = exports.mobile = void 0;
|
|
11
|
-
exports.mobile = /^[0-9]{7,11}$/;
|
|
8
|
+
export const mobile = /^[0-9]{7,11}$/;
|
|
12
9
|
// export const password = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?!.*\W).{8,20}$/;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
export const password = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(.*).{8,20}$/;
|
|
11
|
+
export const email = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
|
|
12
|
+
export const code = /^[0-9]{6}$/;
|
|
13
|
+
export const number = /^[1-9]\d*(\.\d+)?$/;
|
package/dist/config/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/*
|
|
4
2
|
* @Descripttion:
|
|
5
3
|
* @version:
|
|
@@ -8,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
6
|
* @LastEditors: lewis lewis@everylink.ai
|
|
9
7
|
* @LastEditTime: 2025-09-23 18:50:02
|
|
10
8
|
*/
|
|
11
|
-
|
|
9
|
+
export default {
|
|
12
10
|
sitePath: process.env.VUE_APP_MODE == 'production' ? 'https://djgs8mufg9606.cloudfront.net/' : 'https://d1qu701gfywrk1.cloudfront.net/', // site path
|
|
13
11
|
// sitePath: "https://djgs8mufg9606.cloudfront.net/",
|
|
14
12
|
themePath: process.env.VUE_APP_MODE == 'production' ? 'https://djgs8mufg9606.cloudfront.net/config/' : 'https://d1qu701gfywrk1.cloudfront.net/config/',
|