@freelog/tools-lib 0.1.172 → 0.1.174
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/service-API/contracts.d.ts +1 -0
- package/dist/service-API/presentables.d.ts +50 -4
- package/dist/service-API/resources.d.ts +1 -1
- package/dist/tools-lib.cjs.development.js +155 -80
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +155 -80
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/linkTo.d.ts +28 -19
- package/package.json +1 -1
- package/src/service-API/contracts.ts +157 -156
- package/src/service-API/presentables.ts +495 -343
- package/src/service-API/resources.ts +1 -1
- package/src/utils/linkTo.ts +155 -98
|
@@ -1326,7 +1326,7 @@ interface AddResourceItems_Draft_ParamsType {
|
|
|
1326
1326
|
resourceId: string;
|
|
1327
1327
|
addCollectionItems: {
|
|
1328
1328
|
resourceId: string;
|
|
1329
|
-
itemTitle
|
|
1329
|
+
itemTitle?: string;
|
|
1330
1330
|
// resolveResources?: {
|
|
1331
1331
|
// resourceId: string;
|
|
1332
1332
|
// contracts: {
|
package/src/utils/linkTo.ts
CHANGED
|
@@ -4,18 +4,14 @@ type TReturnType = string;
|
|
|
4
4
|
|
|
5
5
|
/************** www Start ******************************************************/
|
|
6
6
|
// 首页
|
|
7
|
-
interface HomeParamsType {
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
interface HomeParamsType {}
|
|
10
8
|
|
|
11
9
|
export function home({}: HomeParamsType = {}) {
|
|
12
10
|
return `/home`;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
// 活动列表
|
|
16
|
-
interface ActivitiesParamsType {
|
|
17
|
-
|
|
18
|
-
}
|
|
14
|
+
interface ActivitiesParamsType {}
|
|
19
15
|
|
|
20
16
|
export function activities({}: ActivitiesParamsType = {}) {
|
|
21
17
|
return `/activities`;
|
|
@@ -26,7 +22,7 @@ interface ActivitiesParamsType {
|
|
|
26
22
|
activityID: string;
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
export function activity({activityID}: ActivitiesParamsType) {
|
|
25
|
+
export function activity({ activityID }: ActivitiesParamsType) {
|
|
30
26
|
return `/activity/${activityID}`;
|
|
31
27
|
}
|
|
32
28
|
|
|
@@ -34,9 +30,7 @@ export function activity({activityID}: ActivitiesParamsType) {
|
|
|
34
30
|
|
|
35
31
|
/************** console Start ******************************************************/
|
|
36
32
|
// dashboard
|
|
37
|
-
interface DashboardParamsType {
|
|
38
|
-
|
|
39
|
-
}
|
|
33
|
+
interface DashboardParamsType {}
|
|
40
34
|
|
|
41
35
|
export function dashboard({}: DashboardParamsType = {}) {
|
|
42
36
|
return `/dashboard`;
|
|
@@ -48,13 +42,12 @@ interface MarketParamsType {
|
|
|
48
42
|
query?: string;
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
export function market({...params}: MarketParamsType = {}): TReturnType {
|
|
45
|
+
export function market({ ...params }: MarketParamsType = {}): TReturnType {
|
|
52
46
|
return `/market${handleQuery(params)}`;
|
|
53
47
|
}
|
|
54
48
|
|
|
55
49
|
// 示例节点
|
|
56
|
-
interface ExampleNodesParamsType {
|
|
57
|
-
}
|
|
50
|
+
interface ExampleNodesParamsType {}
|
|
58
51
|
|
|
59
52
|
export function exampleNodes({}: ExampleNodesParamsType = {}): TReturnType {
|
|
60
53
|
return `/examples`;
|
|
@@ -66,7 +59,10 @@ interface ResourceDetailsParamsType {
|
|
|
66
59
|
version?: string;
|
|
67
60
|
}
|
|
68
61
|
|
|
69
|
-
export function resourceDetails({
|
|
62
|
+
export function resourceDetails({
|
|
63
|
+
resourceID,
|
|
64
|
+
...params
|
|
65
|
+
}: ResourceDetailsParamsType): TReturnType {
|
|
70
66
|
return `/resource/details/${resourceID}${handleQuery(params)}`;
|
|
71
67
|
}
|
|
72
68
|
|
|
@@ -76,61 +72,56 @@ interface CollectionDetailsParamsType {
|
|
|
76
72
|
// version?: string;
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
export function collectionDetails({
|
|
75
|
+
export function collectionDetails({
|
|
76
|
+
collectionID,
|
|
77
|
+
}: CollectionDetailsParamsType): TReturnType {
|
|
80
78
|
return `/resource/collectionDetails/${collectionID}`;
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
// 资源创建入口
|
|
84
|
-
interface ResourceCreatorParamsType {
|
|
85
|
-
}
|
|
82
|
+
interface ResourceCreatorParamsType {}
|
|
86
83
|
|
|
87
84
|
export function resourceCreatorEntry({}: ResourceCreatorParamsType = {}): TReturnType {
|
|
88
85
|
return `/resource/creatorEntry`;
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
// 资源创建
|
|
92
|
-
interface ResourceCreatorParamsType {
|
|
93
|
-
}
|
|
89
|
+
interface ResourceCreatorParamsType {}
|
|
94
90
|
|
|
95
91
|
export function resourceCreator({}: ResourceCreatorParamsType = {}): TReturnType {
|
|
96
92
|
return `/resource/creator`;
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
// 资源批量创建
|
|
100
|
-
interface ResourceCreatorParamsType {
|
|
101
|
-
}
|
|
96
|
+
interface ResourceCreatorParamsType {}
|
|
102
97
|
|
|
103
98
|
export function resourceCreatorBatch({}: ResourceCreatorParamsType = {}): TReturnType {
|
|
104
99
|
return `/resource/creatorBatch`;
|
|
105
100
|
}
|
|
106
101
|
|
|
107
102
|
// 集合创建
|
|
108
|
-
interface CollectionCreatorParamsType {
|
|
109
|
-
}
|
|
103
|
+
interface CollectionCreatorParamsType {}
|
|
110
104
|
|
|
111
105
|
export function collectionCreator({}: CollectionCreatorParamsType = {}): TReturnType {
|
|
112
106
|
return `/resource/collectionCreator`;
|
|
113
107
|
}
|
|
114
108
|
|
|
115
109
|
// 我的资源
|
|
116
|
-
interface MyResourcesParamsType {
|
|
117
|
-
}
|
|
110
|
+
interface MyResourcesParamsType {}
|
|
118
111
|
|
|
119
112
|
export function myResources({}: MyResourcesParamsType = {}): TReturnType {
|
|
120
113
|
return `/resource/list`;
|
|
121
114
|
}
|
|
122
115
|
|
|
123
116
|
// 我的集合
|
|
124
|
-
interface MyCollectionsParamsType {
|
|
125
|
-
}
|
|
117
|
+
interface MyCollectionsParamsType {}
|
|
126
118
|
|
|
127
119
|
export function myCollections({}: MyCollectionsParamsType = {}): TReturnType {
|
|
128
120
|
return `/resource/collection`;
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
// 我的收藏
|
|
132
|
-
interface MyCollectsParamsType {
|
|
133
|
-
}
|
|
124
|
+
interface MyCollectsParamsType {}
|
|
134
125
|
|
|
135
126
|
export function myCollects({}: MyCollectsParamsType = {}): TReturnType {
|
|
136
127
|
return `/resource/collect`;
|
|
@@ -142,8 +133,13 @@ interface ResourceVersionInfoParamsType {
|
|
|
142
133
|
version?: string;
|
|
143
134
|
}
|
|
144
135
|
|
|
145
|
-
export function resourceVersionInfo({
|
|
146
|
-
|
|
136
|
+
export function resourceVersionInfo({
|
|
137
|
+
resourceID,
|
|
138
|
+
version = '',
|
|
139
|
+
}: ResourceVersionInfoParamsType): TReturnType {
|
|
140
|
+
return `/resource/sidebar/versionInfo/${resourceID}${handleQuery({
|
|
141
|
+
version,
|
|
142
|
+
})}`;
|
|
147
143
|
}
|
|
148
144
|
|
|
149
145
|
// 资源信息
|
|
@@ -151,7 +147,9 @@ interface ResourceInfoParamsType {
|
|
|
151
147
|
resourceID: string;
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
export function resourceInfo({
|
|
150
|
+
export function resourceInfo({
|
|
151
|
+
resourceID,
|
|
152
|
+
}: ResourceInfoParamsType): TReturnType {
|
|
155
153
|
return `/resource/sidebar/info/${resourceID}`;
|
|
156
154
|
}
|
|
157
155
|
|
|
@@ -160,7 +158,9 @@ interface ResourcePolicyParamsType {
|
|
|
160
158
|
resourceID: string;
|
|
161
159
|
}
|
|
162
160
|
|
|
163
|
-
export function resourcePolicy({
|
|
161
|
+
export function resourcePolicy({
|
|
162
|
+
resourceID,
|
|
163
|
+
}: ResourcePolicyParamsType): TReturnType {
|
|
164
164
|
return `/resource/sidebar/policy/${resourceID}`;
|
|
165
165
|
}
|
|
166
166
|
|
|
@@ -169,7 +169,9 @@ interface ResourceContractParamsType {
|
|
|
169
169
|
resourceID: string;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
export function resourceContract({
|
|
172
|
+
export function resourceContract({
|
|
173
|
+
resourceID,
|
|
174
|
+
}: ResourceContractParamsType): TReturnType {
|
|
173
175
|
return `/resource/sidebar/contract/${resourceID}`;
|
|
174
176
|
}
|
|
175
177
|
|
|
@@ -178,7 +180,9 @@ interface ResourceDependencyParamsType {
|
|
|
178
180
|
resourceID: string;
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
export function resourceDependency({
|
|
183
|
+
export function resourceDependency({
|
|
184
|
+
resourceID,
|
|
185
|
+
}: ResourceDependencyParamsType): TReturnType {
|
|
182
186
|
return `/resource/sidebar/dependency/${resourceID}`;
|
|
183
187
|
}
|
|
184
188
|
|
|
@@ -187,7 +191,9 @@ interface ResourceVersionCreatorParamsType {
|
|
|
187
191
|
resourceID: string;
|
|
188
192
|
}
|
|
189
193
|
|
|
190
|
-
export function resourceVersionCreator({
|
|
194
|
+
export function resourceVersionCreator({
|
|
195
|
+
resourceID,
|
|
196
|
+
}: ResourceVersionCreatorParamsType): TReturnType {
|
|
191
197
|
return `/resource/versionCreator/${resourceID}`;
|
|
192
198
|
}
|
|
193
199
|
|
|
@@ -197,7 +203,9 @@ interface CollectionVersionInfoParamsType {
|
|
|
197
203
|
// version?: string;
|
|
198
204
|
}
|
|
199
205
|
|
|
200
|
-
export function collectionVersionInfo({
|
|
206
|
+
export function collectionVersionInfo({
|
|
207
|
+
collectionID,
|
|
208
|
+
}: CollectionVersionInfoParamsType): TReturnType {
|
|
201
209
|
return `/resource/collectionSidebar/versionInfo/${collectionID}`;
|
|
202
210
|
}
|
|
203
211
|
|
|
@@ -206,7 +214,9 @@ interface CollectionInfoParamsType {
|
|
|
206
214
|
collectionID: string;
|
|
207
215
|
}
|
|
208
216
|
|
|
209
|
-
export function collectionInfo({
|
|
217
|
+
export function collectionInfo({
|
|
218
|
+
collectionID,
|
|
219
|
+
}: CollectionInfoParamsType): TReturnType {
|
|
210
220
|
return `/resource/collectionSidebar/info/${collectionID}`;
|
|
211
221
|
}
|
|
212
222
|
|
|
@@ -215,7 +225,9 @@ interface CollectionPolicyParamsType {
|
|
|
215
225
|
collectionID: string;
|
|
216
226
|
}
|
|
217
227
|
|
|
218
|
-
export function collectionPolicy({
|
|
228
|
+
export function collectionPolicy({
|
|
229
|
+
collectionID,
|
|
230
|
+
}: CollectionPolicyParamsType): TReturnType {
|
|
219
231
|
return `/resource/collectionSidebar/policy/${collectionID}`;
|
|
220
232
|
}
|
|
221
233
|
|
|
@@ -224,7 +236,9 @@ interface CollectionContractParamsType {
|
|
|
224
236
|
collectionID: string;
|
|
225
237
|
}
|
|
226
238
|
|
|
227
|
-
export function collectionContract({
|
|
239
|
+
export function collectionContract({
|
|
240
|
+
collectionID,
|
|
241
|
+
}: CollectionContractParamsType): TReturnType {
|
|
228
242
|
return `/resource/collectionSidebar/contract/${collectionID}`;
|
|
229
243
|
}
|
|
230
244
|
|
|
@@ -233,7 +247,9 @@ interface CollectionDependencyParamsType {
|
|
|
233
247
|
collectionID: string;
|
|
234
248
|
}
|
|
235
249
|
|
|
236
|
-
export function collectionDependency({
|
|
250
|
+
export function collectionDependency({
|
|
251
|
+
collectionID,
|
|
252
|
+
}: CollectionDependencyParamsType): TReturnType {
|
|
237
253
|
return `/resource/collectionSidebar/dependency/${collectionID}`;
|
|
238
254
|
}
|
|
239
255
|
|
|
@@ -252,34 +268,54 @@ interface NodeManagementParamsType {
|
|
|
252
268
|
showPage?: 'exhibit' | 'theme' | 'contract' | 'setting';
|
|
253
269
|
}
|
|
254
270
|
|
|
255
|
-
export function nodeManagement({
|
|
256
|
-
|
|
271
|
+
export function nodeManagement({
|
|
272
|
+
nodeID,
|
|
273
|
+
showPage = 'exhibit',
|
|
274
|
+
...params
|
|
275
|
+
}: NodeManagementParamsType): TReturnType {
|
|
276
|
+
return `/node/formal/${nodeID}${handleQuery({ showPage, ...params })}`;
|
|
257
277
|
}
|
|
258
278
|
|
|
259
279
|
// 展品管理
|
|
260
280
|
interface ExhibitManagementParamsType {
|
|
261
281
|
exhibitID: string;
|
|
262
|
-
openAuthDrawer?: boolean
|
|
282
|
+
openAuthDrawer?: boolean;
|
|
263
283
|
showMoreSetting?: boolean;
|
|
264
284
|
}
|
|
265
285
|
|
|
266
|
-
export function exhibitManagement({
|
|
286
|
+
export function exhibitManagement({
|
|
287
|
+
exhibitID,
|
|
288
|
+
...params
|
|
289
|
+
}: ExhibitManagementParamsType): TReturnType {
|
|
267
290
|
return `/node/exhibit/formal/${exhibitID}${handleQuery({
|
|
268
|
-
...params
|
|
291
|
+
...params,
|
|
269
292
|
})}`;
|
|
270
293
|
}
|
|
271
294
|
|
|
272
295
|
// 集合展品管理
|
|
273
296
|
interface CollectionExhibitManagementParamsType {
|
|
274
297
|
exhibitID: string;
|
|
275
|
-
openAuthDrawer?: boolean
|
|
298
|
+
openAuthDrawer?: boolean;
|
|
276
299
|
}
|
|
277
300
|
|
|
278
301
|
export function collectionExhibitManagement({
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
return `/node/collectionExhibit/formal/${exhibitID}${handleQuery({
|
|
302
|
+
exhibitID,
|
|
303
|
+
openAuthDrawer,
|
|
304
|
+
}: CollectionExhibitManagementParamsType): TReturnType {
|
|
305
|
+
return `/node/collectionExhibit/formal/${exhibitID}${handleQuery({
|
|
306
|
+
openAuthDrawer,
|
|
307
|
+
})}`;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// 集合展品创建
|
|
311
|
+
interface CollectionExhibitCreatorParamsType {
|
|
312
|
+
nodeID: number;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export function collectionExhibitCreator({
|
|
316
|
+
nodeID,
|
|
317
|
+
}: CollectionExhibitCreatorParamsType): TReturnType {
|
|
318
|
+
return `/node/collectionExhibitCreator/${nodeID}`;
|
|
283
319
|
}
|
|
284
320
|
|
|
285
321
|
// 测试节点管理
|
|
@@ -289,11 +325,11 @@ interface InformNodeManagementParamsType {
|
|
|
289
325
|
}
|
|
290
326
|
|
|
291
327
|
export function informNodeManagement({
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
return `/node/informal/${nodeID}${handleQuery({showPage, ...params})}`;
|
|
328
|
+
nodeID,
|
|
329
|
+
showPage = 'exhibit',
|
|
330
|
+
...params
|
|
331
|
+
}: InformNodeManagementParamsType): TReturnType {
|
|
332
|
+
return `/node/informal/${nodeID}${handleQuery({ showPage, ...params })}`;
|
|
297
333
|
}
|
|
298
334
|
|
|
299
335
|
// 测试展品管理
|
|
@@ -301,7 +337,9 @@ interface InformExhibitManagementParamsType {
|
|
|
301
337
|
exhibitID: string;
|
|
302
338
|
}
|
|
303
339
|
|
|
304
|
-
export function informExhibitManagement({
|
|
340
|
+
export function informExhibitManagement({
|
|
341
|
+
exhibitID,
|
|
342
|
+
}: InformExhibitManagementParamsType): TReturnType {
|
|
305
343
|
return `/node/exhibit/informal/${exhibitID}`;
|
|
306
344
|
}
|
|
307
345
|
|
|
@@ -311,7 +349,9 @@ interface StorageSpaceParamsType {
|
|
|
311
349
|
createBucket?: boolean;
|
|
312
350
|
}
|
|
313
351
|
|
|
314
|
-
export function storageSpace({
|
|
352
|
+
export function storageSpace({
|
|
353
|
+
...params
|
|
354
|
+
}: StorageSpaceParamsType = {}): TReturnType {
|
|
315
355
|
return `/storage${handleQuery(params)}`;
|
|
316
356
|
}
|
|
317
357
|
|
|
@@ -321,7 +361,9 @@ interface ObjectDetailsParamsType {
|
|
|
321
361
|
objectID: string;
|
|
322
362
|
}
|
|
323
363
|
|
|
324
|
-
export function objectDetails({
|
|
364
|
+
export function objectDetails({
|
|
365
|
+
...params
|
|
366
|
+
}: ObjectDetailsParamsType): TReturnType {
|
|
325
367
|
return `/storage${handleQuery(params)}`;
|
|
326
368
|
}
|
|
327
369
|
|
|
@@ -330,7 +372,9 @@ interface CollectionCreateSuccessParamsType {
|
|
|
330
372
|
collectionID: string;
|
|
331
373
|
}
|
|
332
374
|
|
|
333
|
-
export function collectionCreateSuccess({
|
|
375
|
+
export function collectionCreateSuccess({
|
|
376
|
+
collectionID,
|
|
377
|
+
}: CollectionCreateSuccessParamsType) {
|
|
334
378
|
return `/result/collection/create/success/${collectionID}`;
|
|
335
379
|
}
|
|
336
380
|
|
|
@@ -339,7 +383,9 @@ interface ResourceCreateSuccessParamsType {
|
|
|
339
383
|
resourceID: string;
|
|
340
384
|
}
|
|
341
385
|
|
|
342
|
-
export function resourceCreateSuccess({
|
|
386
|
+
export function resourceCreateSuccess({
|
|
387
|
+
resourceID,
|
|
388
|
+
}: ResourceCreateSuccessParamsType) {
|
|
343
389
|
return `/result/resource/create/success/${resourceID}`;
|
|
344
390
|
}
|
|
345
391
|
|
|
@@ -349,7 +395,10 @@ interface ResourceVersionCreateSuccessParamsType {
|
|
|
349
395
|
version: string;
|
|
350
396
|
}
|
|
351
397
|
|
|
352
|
-
export function resourceVersionCreateSuccess({
|
|
398
|
+
export function resourceVersionCreateSuccess({
|
|
399
|
+
resourceID,
|
|
400
|
+
version,
|
|
401
|
+
}: ResourceVersionCreateSuccessParamsType) {
|
|
353
402
|
return `/result/resource/version/create/success/${resourceID}/${version}`;
|
|
354
403
|
}
|
|
355
404
|
|
|
@@ -359,7 +408,10 @@ interface ResourceVersionCreateReleaseParamsType {
|
|
|
359
408
|
version: string;
|
|
360
409
|
}
|
|
361
410
|
|
|
362
|
-
export function resourceVersionCreateRelease({
|
|
411
|
+
export function resourceVersionCreateRelease({
|
|
412
|
+
resourceID,
|
|
413
|
+
version,
|
|
414
|
+
}: ResourceVersionCreateReleaseParamsType) {
|
|
363
415
|
return `/result/resource/version/create/release/${resourceID}/${version}`;
|
|
364
416
|
}
|
|
365
417
|
|
|
@@ -368,7 +420,7 @@ interface NodeCreateSuccessParamsType {
|
|
|
368
420
|
nodeID: number;
|
|
369
421
|
}
|
|
370
422
|
|
|
371
|
-
export function nodeCreateSuccess({nodeID}: NodeCreateSuccessParamsType) {
|
|
423
|
+
export function nodeCreateSuccess({ nodeID }: NodeCreateSuccessParamsType) {
|
|
372
424
|
return `/result/node/create/success/${nodeID}`;
|
|
373
425
|
}
|
|
374
426
|
|
|
@@ -378,7 +430,7 @@ interface InvitationParamsType {
|
|
|
378
430
|
invitationCode?: string;
|
|
379
431
|
}
|
|
380
432
|
|
|
381
|
-
export function invitation({goTo, ...params}: InvitationParamsType = {}) {
|
|
433
|
+
export function invitation({ goTo, ...params }: InvitationParamsType = {}) {
|
|
382
434
|
// console.log(params.goTo, 'goTo9iowjefklsdj;flksdjflk')
|
|
383
435
|
return `/invitation${handleQuery({
|
|
384
436
|
...params,
|
|
@@ -391,16 +443,15 @@ interface Exception403ParamsType {
|
|
|
391
443
|
from?: string;
|
|
392
444
|
}
|
|
393
445
|
|
|
394
|
-
export function exception403({...params}: Exception403ParamsType = {}) {
|
|
395
|
-
|
|
446
|
+
export function exception403({ ...params }: Exception403ParamsType = {}) {
|
|
396
447
|
let fromUrl: string = params.from || '';
|
|
397
448
|
if (!fromUrl) {
|
|
398
|
-
const {href, origin} = window.location;
|
|
449
|
+
const { href, origin } = window.location;
|
|
399
450
|
fromUrl = href.replace(origin, '');
|
|
400
451
|
}
|
|
401
452
|
|
|
402
453
|
return `/exception/403${handleQuery({
|
|
403
|
-
from: fromUrl
|
|
454
|
+
from: fromUrl,
|
|
404
455
|
})}`;
|
|
405
456
|
}
|
|
406
457
|
|
|
@@ -409,16 +460,30 @@ interface ExceptionUnableToAccessParamsType {
|
|
|
409
460
|
from?: string;
|
|
410
461
|
}
|
|
411
462
|
|
|
412
|
-
export function exceptionUnableToAccess({
|
|
413
|
-
|
|
463
|
+
export function exceptionUnableToAccess({
|
|
464
|
+
...params
|
|
465
|
+
}: ExceptionUnableToAccessParamsType = {}) {
|
|
414
466
|
let fromUrl: string = params.from || '';
|
|
415
467
|
if (!fromUrl) {
|
|
416
|
-
const {href, origin} = window.location;
|
|
468
|
+
const { href, origin } = window.location;
|
|
417
469
|
fromUrl = href.replace(origin, '');
|
|
418
470
|
}
|
|
419
471
|
|
|
420
472
|
return `/exception/unableToAccess${handleQuery({
|
|
421
|
-
from: fromUrl
|
|
473
|
+
from: fromUrl,
|
|
474
|
+
})}`;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// /exception/common?tipText=1234
|
|
478
|
+
// 通用异常
|
|
479
|
+
interface ExceptionCommonParamsType {
|
|
480
|
+
tipText?: string;
|
|
481
|
+
btnText?: string;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export function exceptionCommon({ ...params }: ExceptionCommonParamsType = {}) {
|
|
485
|
+
return `/exception/common${handleQuery({
|
|
486
|
+
...params,
|
|
422
487
|
})}`;
|
|
423
488
|
}
|
|
424
489
|
|
|
@@ -427,7 +492,7 @@ interface NodeFreezeParamsType {
|
|
|
427
492
|
nodeID: number;
|
|
428
493
|
}
|
|
429
494
|
|
|
430
|
-
export function nodeFreeze({nodeID}: NodeFreezeParamsType) {
|
|
495
|
+
export function nodeFreeze({ nodeID }: NodeFreezeParamsType) {
|
|
431
496
|
return `/result/node/freeze/${nodeID}`;
|
|
432
497
|
}
|
|
433
498
|
|
|
@@ -436,7 +501,7 @@ interface ResourceFreezeParamsType {
|
|
|
436
501
|
resourceID: string;
|
|
437
502
|
}
|
|
438
503
|
|
|
439
|
-
export function resourceFreeze({resourceID}: ResourceFreezeParamsType) {
|
|
504
|
+
export function resourceFreeze({ resourceID }: ResourceFreezeParamsType) {
|
|
440
505
|
return `/result/resource/freeze/${resourceID}`;
|
|
441
506
|
}
|
|
442
507
|
|
|
@@ -445,7 +510,7 @@ interface GlobalSearchParamsType {
|
|
|
445
510
|
search: string;
|
|
446
511
|
}
|
|
447
512
|
|
|
448
|
-
export function globalSearch({search}: GlobalSearchParamsType) {
|
|
513
|
+
export function globalSearch({ search }: GlobalSearchParamsType) {
|
|
449
514
|
return `/search${handleQuery({
|
|
450
515
|
search,
|
|
451
516
|
})}`;
|
|
@@ -453,14 +518,13 @@ export function globalSearch({search}: GlobalSearchParamsType) {
|
|
|
453
518
|
|
|
454
519
|
/************** console End ******************************************************/
|
|
455
520
|
|
|
456
|
-
|
|
457
521
|
/************** user Start ******************************************************/
|
|
458
522
|
// 登录
|
|
459
523
|
interface LoginParamsType {
|
|
460
524
|
goTo?: string;
|
|
461
525
|
}
|
|
462
526
|
|
|
463
|
-
export function login({goTo}: LoginParamsType = {}) {
|
|
527
|
+
export function login({ goTo }: LoginParamsType = {}) {
|
|
464
528
|
return `/login${handleQuery({
|
|
465
529
|
goTo: goTo ? encodeURIComponent(goTo) : undefined,
|
|
466
530
|
})}`;
|
|
@@ -472,7 +536,7 @@ interface LoginParamsType {
|
|
|
472
536
|
invitationCode?: string;
|
|
473
537
|
}
|
|
474
538
|
|
|
475
|
-
export function logon({goTo, ...params}: LoginParamsType = {}) {
|
|
539
|
+
export function logon({ goTo, ...params }: LoginParamsType = {}) {
|
|
476
540
|
return `/logon${handleQuery({
|
|
477
541
|
goTo: goTo ? encodeURIComponent(goTo) : undefined,
|
|
478
542
|
...params,
|
|
@@ -486,7 +550,7 @@ interface LoginParamsType {
|
|
|
486
550
|
returnUrl?: string;
|
|
487
551
|
}
|
|
488
552
|
|
|
489
|
-
export function bind({goTo, returnUrl, ...params}: LoginParamsType = {}) {
|
|
553
|
+
export function bind({ goTo, returnUrl, ...params }: LoginParamsType = {}) {
|
|
490
554
|
return `/bind${handleQuery({
|
|
491
555
|
goTo: goTo ? encodeURIComponent(goTo) : undefined,
|
|
492
556
|
returnUrl: returnUrl ? encodeURIComponent(returnUrl) : undefined,
|
|
@@ -499,7 +563,9 @@ interface RetrieveUserPasswordParamsType {
|
|
|
499
563
|
goTo?: string;
|
|
500
564
|
}
|
|
501
565
|
|
|
502
|
-
export function retrieveUserPassword({
|
|
566
|
+
export function retrieveUserPassword({
|
|
567
|
+
goTo,
|
|
568
|
+
}: RetrieveUserPasswordParamsType = {}) {
|
|
503
569
|
return `/retrieve${handleQuery({
|
|
504
570
|
goTo: goTo ? encodeURIComponent(goTo) : undefined,
|
|
505
571
|
})}`;
|
|
@@ -524,16 +590,14 @@ export function userFreeze({}: UserFreezeParamsType = {}) {
|
|
|
524
590
|
}
|
|
525
591
|
|
|
526
592
|
// 我的钱包
|
|
527
|
-
interface WalletParamsType {
|
|
528
|
-
}
|
|
593
|
+
interface WalletParamsType {}
|
|
529
594
|
|
|
530
595
|
export function wallet({}: WalletParamsType = {}) {
|
|
531
596
|
return `/logged/wallet`;
|
|
532
597
|
}
|
|
533
598
|
|
|
534
599
|
// 活动奖励
|
|
535
|
-
interface RewardParamsType {
|
|
536
|
-
}
|
|
600
|
+
interface RewardParamsType {}
|
|
537
601
|
|
|
538
602
|
export function reward({}: RewardParamsType = {}) {
|
|
539
603
|
return `/logged/reward`;
|
|
@@ -546,38 +610,33 @@ interface ContractParamsType {
|
|
|
546
610
|
licenseeName?: string;
|
|
547
611
|
}
|
|
548
612
|
|
|
549
|
-
export function contract({...params}: ContractParamsType = {}) {
|
|
613
|
+
export function contract({ ...params }: ContractParamsType = {}) {
|
|
550
614
|
return `/logged/contract${handleQuery({
|
|
551
|
-
...params
|
|
615
|
+
...params,
|
|
552
616
|
})}`;
|
|
553
617
|
}
|
|
554
618
|
|
|
555
619
|
// 个人设置
|
|
556
|
-
interface SettingParamsType {
|
|
557
|
-
}
|
|
620
|
+
interface SettingParamsType {}
|
|
558
621
|
|
|
559
622
|
export function setting({}: SettingParamsType = {}) {
|
|
560
623
|
return `/logged/setting`;
|
|
561
624
|
}
|
|
562
625
|
|
|
563
|
-
|
|
564
626
|
// 绑定
|
|
565
|
-
interface BindingParamsType {
|
|
566
|
-
}
|
|
627
|
+
interface BindingParamsType {}
|
|
567
628
|
|
|
568
629
|
export function binding({}: BindingParamsType = {}) {
|
|
569
630
|
return `/logged/binding`;
|
|
570
631
|
}
|
|
571
632
|
|
|
572
633
|
// 绑定成功
|
|
573
|
-
interface ResultBindingSuccessParamsType {
|
|
574
|
-
}
|
|
634
|
+
interface ResultBindingSuccessParamsType {}
|
|
575
635
|
|
|
576
636
|
export function resultBindingSuccess({}: ResultBindingSuccessParamsType = {}) {
|
|
577
637
|
return `/result/binding`;
|
|
578
638
|
}
|
|
579
639
|
|
|
580
|
-
|
|
581
640
|
/************** user End ******************************************************/
|
|
582
641
|
|
|
583
642
|
function handleQuery(query: object): string {
|
|
@@ -588,7 +647,5 @@ function handleQuery(query: object): string {
|
|
|
588
647
|
}
|
|
589
648
|
}
|
|
590
649
|
const result: string = querystring.stringify(obj);
|
|
591
|
-
return result ?
|
|
650
|
+
return result ? '?' + result : '';
|
|
592
651
|
}
|
|
593
|
-
|
|
594
|
-
|