@x-edu/service 0.0.1 → 0.0.3
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/config/index.d.ts +24 -0
- package/dist/index.d.ts +26 -0
- package/dist/request/cdn.d.ts +9 -0
- package/dist/request/elearning-library.d.ts +4 -0
- package/dist/request/helper.d.ts +1 -1
- package/dist/request/site-config.d.ts +4 -0
- package/dist/service/channel.d.ts +20 -0
- package/dist/service/elearningTrain.d.ts +6 -0
- package/dist/service/library.d.ts +34 -0
- package/dist/service/siteConfig.d.ts +10 -0
- package/dist/service/tCourse.d.ts +35 -0
- package/dist/service.js +984 -110
- package/dist/service.mjs +984 -110
- package/dist/service.umd.js +984 -110
- package/dist/util.d.ts +5 -0
- package/package.json +4 -3
package/dist/service.js
CHANGED
|
@@ -461,7 +461,7 @@ function commonjsRequire(path) {
|
|
|
461
461
|
var cryptoJs = { exports: {} };
|
|
462
462
|
var core = { exports: {} };
|
|
463
463
|
(function(module2, exports2) {
|
|
464
|
-
(function(
|
|
464
|
+
(function(root2, factory) {
|
|
465
465
|
{
|
|
466
466
|
module2.exports = factory();
|
|
467
467
|
}
|
|
@@ -709,7 +709,7 @@ var core = { exports: {} };
|
|
|
709
709
|
})(core);
|
|
710
710
|
var x64Core = { exports: {} };
|
|
711
711
|
(function(module2, exports2) {
|
|
712
|
-
(function(
|
|
712
|
+
(function(root2, factory) {
|
|
713
713
|
{
|
|
714
714
|
module2.exports = factory(core.exports);
|
|
715
715
|
}
|
|
@@ -756,7 +756,7 @@ var x64Core = { exports: {} };
|
|
|
756
756
|
})(x64Core);
|
|
757
757
|
var libTypedarrays = { exports: {} };
|
|
758
758
|
(function(module2, exports2) {
|
|
759
|
-
(function(
|
|
759
|
+
(function(root2, factory) {
|
|
760
760
|
{
|
|
761
761
|
module2.exports = factory(core.exports);
|
|
762
762
|
}
|
|
@@ -794,7 +794,7 @@ var libTypedarrays = { exports: {} };
|
|
|
794
794
|
})(libTypedarrays);
|
|
795
795
|
var encUtf16 = { exports: {} };
|
|
796
796
|
(function(module2, exports2) {
|
|
797
|
-
(function(
|
|
797
|
+
(function(root2, factory) {
|
|
798
798
|
{
|
|
799
799
|
module2.exports = factory(core.exports);
|
|
800
800
|
}
|
|
@@ -847,7 +847,7 @@ var encUtf16 = { exports: {} };
|
|
|
847
847
|
})(encUtf16);
|
|
848
848
|
var encBase64 = { exports: {} };
|
|
849
849
|
(function(module2, exports2) {
|
|
850
|
-
(function(
|
|
850
|
+
(function(root2, factory) {
|
|
851
851
|
{
|
|
852
852
|
module2.exports = factory(core.exports);
|
|
853
853
|
}
|
|
@@ -919,7 +919,7 @@ var encBase64 = { exports: {} };
|
|
|
919
919
|
var Base64$1 = encBase64.exports;
|
|
920
920
|
var encBase64url = { exports: {} };
|
|
921
921
|
(function(module2, exports2) {
|
|
922
|
-
(function(
|
|
922
|
+
(function(root2, factory) {
|
|
923
923
|
{
|
|
924
924
|
module2.exports = factory(core.exports);
|
|
925
925
|
}
|
|
@@ -990,7 +990,7 @@ var encBase64url = { exports: {} };
|
|
|
990
990
|
})(encBase64url);
|
|
991
991
|
var md5 = { exports: {} };
|
|
992
992
|
(function(module2, exports2) {
|
|
993
|
-
(function(
|
|
993
|
+
(function(root2, factory) {
|
|
994
994
|
{
|
|
995
995
|
module2.exports = factory(core.exports);
|
|
996
996
|
}
|
|
@@ -1152,7 +1152,7 @@ var md5 = { exports: {} };
|
|
|
1152
1152
|
})(md5);
|
|
1153
1153
|
var sha1 = { exports: {} };
|
|
1154
1154
|
(function(module2, exports2) {
|
|
1155
|
-
(function(
|
|
1155
|
+
(function(root2, factory) {
|
|
1156
1156
|
{
|
|
1157
1157
|
module2.exports = factory(core.exports);
|
|
1158
1158
|
}
|
|
@@ -1223,9 +1223,9 @@ var sha1 = { exports: {} };
|
|
|
1223
1223
|
return CryptoJS2.SHA1;
|
|
1224
1224
|
});
|
|
1225
1225
|
})(sha1);
|
|
1226
|
-
var sha256 = { exports: {} };
|
|
1226
|
+
var sha256$1 = { exports: {} };
|
|
1227
1227
|
(function(module2, exports2) {
|
|
1228
|
-
(function(
|
|
1228
|
+
(function(root2, factory) {
|
|
1229
1229
|
{
|
|
1230
1230
|
module2.exports = factory(core.exports);
|
|
1231
1231
|
}
|
|
@@ -1331,12 +1331,12 @@ var sha256 = { exports: {} };
|
|
|
1331
1331
|
})(Math);
|
|
1332
1332
|
return CryptoJS2.SHA256;
|
|
1333
1333
|
});
|
|
1334
|
-
})(sha256);
|
|
1334
|
+
})(sha256$1);
|
|
1335
1335
|
var sha224 = { exports: {} };
|
|
1336
1336
|
(function(module2, exports2) {
|
|
1337
|
-
(function(
|
|
1337
|
+
(function(root2, factory, undef) {
|
|
1338
1338
|
{
|
|
1339
|
-
module2.exports = factory(core.exports, sha256.exports);
|
|
1339
|
+
module2.exports = factory(core.exports, sha256$1.exports);
|
|
1340
1340
|
}
|
|
1341
1341
|
})(commonjsGlobal$1, function(CryptoJS2) {
|
|
1342
1342
|
(function() {
|
|
@@ -1360,7 +1360,7 @@ var sha224 = { exports: {} };
|
|
|
1360
1360
|
})(sha224);
|
|
1361
1361
|
var sha512 = { exports: {} };
|
|
1362
1362
|
(function(module2, exports2) {
|
|
1363
|
-
(function(
|
|
1363
|
+
(function(root2, factory, undef) {
|
|
1364
1364
|
{
|
|
1365
1365
|
module2.exports = factory(core.exports, x64Core.exports);
|
|
1366
1366
|
}
|
|
@@ -1539,7 +1539,7 @@ var sha512 = { exports: {} };
|
|
|
1539
1539
|
})(sha512);
|
|
1540
1540
|
var sha384 = { exports: {} };
|
|
1541
1541
|
(function(module2, exports2) {
|
|
1542
|
-
(function(
|
|
1542
|
+
(function(root2, factory, undef) {
|
|
1543
1543
|
{
|
|
1544
1544
|
module2.exports = factory(core.exports, x64Core.exports, sha512.exports);
|
|
1545
1545
|
}
|
|
@@ -1566,7 +1566,7 @@ var sha384 = { exports: {} };
|
|
|
1566
1566
|
})(sha384);
|
|
1567
1567
|
var sha3 = { exports: {} };
|
|
1568
1568
|
(function(module2, exports2) {
|
|
1569
|
-
(function(
|
|
1569
|
+
(function(root2, factory, undef) {
|
|
1570
1570
|
{
|
|
1571
1571
|
module2.exports = factory(core.exports, x64Core.exports);
|
|
1572
1572
|
}
|
|
@@ -1745,7 +1745,7 @@ var sha3 = { exports: {} };
|
|
|
1745
1745
|
})(sha3);
|
|
1746
1746
|
var ripemd160 = { exports: {} };
|
|
1747
1747
|
(function(module2, exports2) {
|
|
1748
|
-
(function(
|
|
1748
|
+
(function(root2, factory) {
|
|
1749
1749
|
{
|
|
1750
1750
|
module2.exports = factory(core.exports);
|
|
1751
1751
|
}
|
|
@@ -1890,7 +1890,7 @@ var ripemd160 = { exports: {} };
|
|
|
1890
1890
|
})(ripemd160);
|
|
1891
1891
|
var hmac = { exports: {} };
|
|
1892
1892
|
(function(module2, exports2) {
|
|
1893
|
-
(function(
|
|
1893
|
+
(function(root2, factory) {
|
|
1894
1894
|
{
|
|
1895
1895
|
module2.exports = factory(core.exports);
|
|
1896
1896
|
}
|
|
@@ -1942,7 +1942,7 @@ var hmac = { exports: {} };
|
|
|
1942
1942
|
})(hmac);
|
|
1943
1943
|
var pbkdf2 = { exports: {} };
|
|
1944
1944
|
(function(module2, exports2) {
|
|
1945
|
-
(function(
|
|
1945
|
+
(function(root2, factory, undef) {
|
|
1946
1946
|
{
|
|
1947
1947
|
module2.exports = factory(core.exports, sha1.exports, hmac.exports);
|
|
1948
1948
|
}
|
|
@@ -1995,7 +1995,7 @@ var pbkdf2 = { exports: {} };
|
|
|
1995
1995
|
})(pbkdf2);
|
|
1996
1996
|
var evpkdf = { exports: {} };
|
|
1997
1997
|
(function(module2, exports2) {
|
|
1998
|
-
(function(
|
|
1998
|
+
(function(root2, factory, undef) {
|
|
1999
1999
|
{
|
|
2000
2000
|
module2.exports = factory(core.exports, sha1.exports, hmac.exports);
|
|
2001
2001
|
}
|
|
@@ -2041,7 +2041,7 @@ var evpkdf = { exports: {} };
|
|
|
2041
2041
|
})(evpkdf);
|
|
2042
2042
|
var cipherCore = { exports: {} };
|
|
2043
2043
|
(function(module2, exports2) {
|
|
2044
|
-
(function(
|
|
2044
|
+
(function(root2, factory, undef) {
|
|
2045
2045
|
{
|
|
2046
2046
|
module2.exports = factory(core.exports, evpkdf.exports);
|
|
2047
2047
|
}
|
|
@@ -2261,7 +2261,7 @@ var cipherCore = { exports: {} };
|
|
|
2261
2261
|
})(cipherCore);
|
|
2262
2262
|
var modeCfb = { exports: {} };
|
|
2263
2263
|
(function(module2, exports2) {
|
|
2264
|
-
(function(
|
|
2264
|
+
(function(root2, factory, undef) {
|
|
2265
2265
|
{
|
|
2266
2266
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2267
2267
|
}
|
|
@@ -2302,7 +2302,7 @@ var modeCfb = { exports: {} };
|
|
|
2302
2302
|
})(modeCfb);
|
|
2303
2303
|
var modeCtr = { exports: {} };
|
|
2304
2304
|
(function(module2, exports2) {
|
|
2305
|
-
(function(
|
|
2305
|
+
(function(root2, factory, undef) {
|
|
2306
2306
|
{
|
|
2307
2307
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2308
2308
|
}
|
|
@@ -2333,7 +2333,7 @@ var modeCtr = { exports: {} };
|
|
|
2333
2333
|
})(modeCtr);
|
|
2334
2334
|
var modeCtrGladman = { exports: {} };
|
|
2335
2335
|
(function(module2, exports2) {
|
|
2336
|
-
(function(
|
|
2336
|
+
(function(root2, factory, undef) {
|
|
2337
2337
|
{
|
|
2338
2338
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2339
2339
|
}
|
|
@@ -2404,7 +2404,7 @@ var modeCtrGladman = { exports: {} };
|
|
|
2404
2404
|
})(modeCtrGladman);
|
|
2405
2405
|
var modeOfb = { exports: {} };
|
|
2406
2406
|
(function(module2, exports2) {
|
|
2407
|
-
(function(
|
|
2407
|
+
(function(root2, factory, undef) {
|
|
2408
2408
|
{
|
|
2409
2409
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2410
2410
|
}
|
|
@@ -2433,7 +2433,7 @@ var modeOfb = { exports: {} };
|
|
|
2433
2433
|
})(modeOfb);
|
|
2434
2434
|
var modeEcb = { exports: {} };
|
|
2435
2435
|
(function(module2, exports2) {
|
|
2436
|
-
(function(
|
|
2436
|
+
(function(root2, factory, undef) {
|
|
2437
2437
|
{
|
|
2438
2438
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2439
2439
|
}
|
|
@@ -2453,7 +2453,7 @@ var modeEcb = { exports: {} };
|
|
|
2453
2453
|
})(modeEcb);
|
|
2454
2454
|
var padAnsix923 = { exports: {} };
|
|
2455
2455
|
(function(module2, exports2) {
|
|
2456
|
-
(function(
|
|
2456
|
+
(function(root2, factory, undef) {
|
|
2457
2457
|
{
|
|
2458
2458
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2459
2459
|
}
|
|
@@ -2475,7 +2475,7 @@ var padAnsix923 = { exports: {} };
|
|
|
2475
2475
|
})(padAnsix923);
|
|
2476
2476
|
var padIso10126 = { exports: {} };
|
|
2477
2477
|
(function(module2, exports2) {
|
|
2478
|
-
(function(
|
|
2478
|
+
(function(root2, factory, undef) {
|
|
2479
2479
|
{
|
|
2480
2480
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2481
2481
|
}
|
|
@@ -2493,7 +2493,7 @@ var padIso10126 = { exports: {} };
|
|
|
2493
2493
|
})(padIso10126);
|
|
2494
2494
|
var padIso97971 = { exports: {} };
|
|
2495
2495
|
(function(module2, exports2) {
|
|
2496
|
-
(function(
|
|
2496
|
+
(function(root2, factory, undef) {
|
|
2497
2497
|
{
|
|
2498
2498
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2499
2499
|
}
|
|
@@ -2510,7 +2510,7 @@ var padIso97971 = { exports: {} };
|
|
|
2510
2510
|
})(padIso97971);
|
|
2511
2511
|
var padZeropadding = { exports: {} };
|
|
2512
2512
|
(function(module2, exports2) {
|
|
2513
|
-
(function(
|
|
2513
|
+
(function(root2, factory, undef) {
|
|
2514
2514
|
{
|
|
2515
2515
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2516
2516
|
}
|
|
@@ -2534,7 +2534,7 @@ var padZeropadding = { exports: {} };
|
|
|
2534
2534
|
})(padZeropadding);
|
|
2535
2535
|
var padNopadding = { exports: {} };
|
|
2536
2536
|
(function(module2, exports2) {
|
|
2537
|
-
(function(
|
|
2537
|
+
(function(root2, factory, undef) {
|
|
2538
2538
|
{
|
|
2539
2539
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2540
2540
|
}
|
|
@@ -2547,7 +2547,7 @@ var padNopadding = { exports: {} };
|
|
|
2547
2547
|
})(padNopadding);
|
|
2548
2548
|
var formatHex = { exports: {} };
|
|
2549
2549
|
(function(module2, exports2) {
|
|
2550
|
-
(function(
|
|
2550
|
+
(function(root2, factory, undef) {
|
|
2551
2551
|
{
|
|
2552
2552
|
module2.exports = factory(core.exports, cipherCore.exports);
|
|
2553
2553
|
}
|
|
@@ -2571,7 +2571,7 @@ var formatHex = { exports: {} };
|
|
|
2571
2571
|
})(formatHex);
|
|
2572
2572
|
var aes = { exports: {} };
|
|
2573
2573
|
(function(module2, exports2) {
|
|
2574
|
-
(function(
|
|
2574
|
+
(function(root2, factory, undef) {
|
|
2575
2575
|
{
|
|
2576
2576
|
module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
|
|
2577
2577
|
}
|
|
@@ -2713,7 +2713,7 @@ var aes = { exports: {} };
|
|
|
2713
2713
|
var AES = aes.exports;
|
|
2714
2714
|
var tripledes = { exports: {} };
|
|
2715
2715
|
(function(module2, exports2) {
|
|
2716
|
-
(function(
|
|
2716
|
+
(function(root2, factory, undef) {
|
|
2717
2717
|
{
|
|
2718
2718
|
module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
|
|
2719
2719
|
}
|
|
@@ -2828,7 +2828,7 @@ var tripledes = { exports: {} };
|
|
|
2828
2828
|
})(tripledes);
|
|
2829
2829
|
var rc4 = { exports: {} };
|
|
2830
2830
|
(function(module2, exports2) {
|
|
2831
|
-
(function(
|
|
2831
|
+
(function(root2, factory, undef) {
|
|
2832
2832
|
{
|
|
2833
2833
|
module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
|
|
2834
2834
|
}
|
|
@@ -2889,7 +2889,7 @@ var rc4 = { exports: {} };
|
|
|
2889
2889
|
})(rc4);
|
|
2890
2890
|
var rabbit = { exports: {} };
|
|
2891
2891
|
(function(module2, exports2) {
|
|
2892
|
-
(function(
|
|
2892
|
+
(function(root2, factory, undef) {
|
|
2893
2893
|
{
|
|
2894
2894
|
module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
|
|
2895
2895
|
}
|
|
@@ -2988,7 +2988,7 @@ var rabbit = { exports: {} };
|
|
|
2988
2988
|
})(rabbit);
|
|
2989
2989
|
var rabbitLegacy = { exports: {} };
|
|
2990
2990
|
(function(module2, exports2) {
|
|
2991
|
-
(function(
|
|
2991
|
+
(function(root2, factory, undef) {
|
|
2992
2992
|
{
|
|
2993
2993
|
module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
|
|
2994
2994
|
}
|
|
@@ -3083,9 +3083,9 @@ var rabbitLegacy = { exports: {} };
|
|
|
3083
3083
|
});
|
|
3084
3084
|
})(rabbitLegacy);
|
|
3085
3085
|
(function(module2, exports2) {
|
|
3086
|
-
(function(
|
|
3086
|
+
(function(root2, factory, undef) {
|
|
3087
3087
|
{
|
|
3088
|
-
module2.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
|
|
3088
|
+
module2.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256$1.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
|
|
3089
3089
|
}
|
|
3090
3090
|
})(commonjsGlobal$1, function(CryptoJS2) {
|
|
3091
3091
|
return CryptoJS2;
|
|
@@ -5547,15 +5547,15 @@ var decoder$1;
|
|
|
5547
5547
|
var Hex = { decode: function(a2) {
|
|
5548
5548
|
var i;
|
|
5549
5549
|
if (decoder$1 === void 0) {
|
|
5550
|
-
var
|
|
5550
|
+
var hex2 = "0123456789ABCDEF";
|
|
5551
5551
|
var ignore = " \f\n\r \u2028\u2029";
|
|
5552
5552
|
decoder$1 = {};
|
|
5553
5553
|
for (i = 0; i < 16; ++i) {
|
|
5554
|
-
decoder$1[
|
|
5554
|
+
decoder$1[hex2.charAt(i)] = i;
|
|
5555
5555
|
}
|
|
5556
|
-
|
|
5556
|
+
hex2 = hex2.toLowerCase();
|
|
5557
5557
|
for (i = 10; i < 16; ++i) {
|
|
5558
|
-
decoder$1[
|
|
5558
|
+
decoder$1[hex2.charAt(i)] = i;
|
|
5559
5559
|
}
|
|
5560
5560
|
for (i = 0; i < ignore.length; ++i) {
|
|
5561
5561
|
decoder$1[ignore.charAt(i)] = -1;
|
|
@@ -8262,15 +8262,15 @@ KJUR.asn1.ASN1Util = new function() {
|
|
|
8262
8262
|
return asn1Obj.getEncodedHex();
|
|
8263
8263
|
};
|
|
8264
8264
|
}();
|
|
8265
|
-
KJUR.asn1.ASN1Util.oidHexToInt = function(
|
|
8265
|
+
KJUR.asn1.ASN1Util.oidHexToInt = function(hex2) {
|
|
8266
8266
|
var s = "";
|
|
8267
|
-
var i01 = parseInt(
|
|
8267
|
+
var i01 = parseInt(hex2.substr(0, 2), 16);
|
|
8268
8268
|
var i0 = Math.floor(i01 / 40);
|
|
8269
8269
|
var i1 = i01 % 40;
|
|
8270
8270
|
var s = i0 + "." + i1;
|
|
8271
8271
|
var binbuf = "";
|
|
8272
|
-
for (var i = 2; i <
|
|
8273
|
-
var value = parseInt(
|
|
8272
|
+
for (var i = 2; i < hex2.length; i += 2) {
|
|
8273
|
+
var value = parseInt(hex2.substr(i, 2), 16);
|
|
8274
8274
|
var bin = ("00000000" + value.toString(2)).slice(-8);
|
|
8275
8275
|
binbuf = binbuf + bin.substr(1, 7);
|
|
8276
8276
|
if (bin.substr(0, 1) == "0") {
|
|
@@ -11485,7 +11485,7 @@ const typeOfTest$1 = (type) => (thing) => typeof thing === type;
|
|
|
11485
11485
|
const { isArray: isArray$1 } = Array;
|
|
11486
11486
|
const isUndefined$1 = typeOfTest$1("undefined");
|
|
11487
11487
|
function isBuffer$1(val) {
|
|
11488
|
-
return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$
|
|
11488
|
+
return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$4(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
11489
11489
|
}
|
|
11490
11490
|
const isArrayBuffer$1 = kindOfTest$1("ArrayBuffer");
|
|
11491
11491
|
function isArrayBufferView$1(val) {
|
|
@@ -11498,9 +11498,9 @@ function isArrayBufferView$1(val) {
|
|
|
11498
11498
|
return result;
|
|
11499
11499
|
}
|
|
11500
11500
|
const isString$1 = typeOfTest$1("string");
|
|
11501
|
-
const isFunction$
|
|
11501
|
+
const isFunction$4 = typeOfTest$1("function");
|
|
11502
11502
|
const isNumber$1 = typeOfTest$1("number");
|
|
11503
|
-
const isObject$
|
|
11503
|
+
const isObject$4 = (thing) => thing !== null && typeof thing === "object";
|
|
11504
11504
|
const isBoolean$1 = (thing) => thing === true || thing === false;
|
|
11505
11505
|
const isPlainObject$1 = (val) => {
|
|
11506
11506
|
if (kindOf$1(val) !== "object") {
|
|
@@ -11513,10 +11513,10 @@ const isDate$1 = kindOfTest$1("Date");
|
|
|
11513
11513
|
const isFile$1 = kindOfTest$1("File");
|
|
11514
11514
|
const isBlob$1 = kindOfTest$1("Blob");
|
|
11515
11515
|
const isFileList$1 = kindOfTest$1("FileList");
|
|
11516
|
-
const isStream$1 = (val) => isObject$
|
|
11516
|
+
const isStream$1 = (val) => isObject$4(val) && isFunction$4(val.pipe);
|
|
11517
11517
|
const isFormData$1 = (thing) => {
|
|
11518
11518
|
let kind;
|
|
11519
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$
|
|
11519
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$4(thing.append) && ((kind = kindOf$1(thing)) === "formdata" || kind === "object" && isFunction$4(thing.toString) && thing.toString() === "[object FormData]"));
|
|
11520
11520
|
};
|
|
11521
11521
|
const isURLSearchParams$1 = kindOfTest$1("URLSearchParams");
|
|
11522
11522
|
const trim$1 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
@@ -11584,7 +11584,7 @@ function merge$1() {
|
|
|
11584
11584
|
}
|
|
11585
11585
|
const extend$1 = (a2, b, thisArg, { allOwnKeys } = {}) => {
|
|
11586
11586
|
forEach$1(b, (val, key) => {
|
|
11587
|
-
if (thisArg && isFunction$
|
|
11587
|
+
if (thisArg && isFunction$4(val)) {
|
|
11588
11588
|
a2[key] = bind$1(val, thisArg);
|
|
11589
11589
|
} else {
|
|
11590
11590
|
a2[key] = val;
|
|
@@ -11671,7 +11671,7 @@ const isHTMLForm$1 = kindOfTest$1("HTMLFormElement");
|
|
|
11671
11671
|
const toCamelCase$1 = (str) => str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
|
|
11672
11672
|
return p1.toUpperCase() + p2;
|
|
11673
11673
|
});
|
|
11674
|
-
const hasOwnProperty$
|
|
11674
|
+
const hasOwnProperty$5 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
11675
11675
|
const isRegExp$1 = kindOfTest$1("RegExp");
|
|
11676
11676
|
const reduceDescriptors$1 = (obj, reducer) => {
|
|
11677
11677
|
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -11685,11 +11685,11 @@ const reduceDescriptors$1 = (obj, reducer) => {
|
|
|
11685
11685
|
};
|
|
11686
11686
|
const freezeMethods$1 = (obj) => {
|
|
11687
11687
|
reduceDescriptors$1(obj, (descriptor, name) => {
|
|
11688
|
-
if (isFunction$
|
|
11688
|
+
if (isFunction$4(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
11689
11689
|
return false;
|
|
11690
11690
|
}
|
|
11691
11691
|
const value = obj[name];
|
|
11692
|
-
if (!isFunction$
|
|
11692
|
+
if (!isFunction$4(value))
|
|
11693
11693
|
return;
|
|
11694
11694
|
descriptor.enumerable = false;
|
|
11695
11695
|
if ("writable" in descriptor) {
|
|
@@ -11731,12 +11731,12 @@ const generateString$1 = (size = 16, alphabet = ALPHABET$1.ALPHA_DIGIT) => {
|
|
|
11731
11731
|
return str;
|
|
11732
11732
|
};
|
|
11733
11733
|
function isSpecCompliantForm$1(thing) {
|
|
11734
|
-
return !!(thing && isFunction$
|
|
11734
|
+
return !!(thing && isFunction$4(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
11735
11735
|
}
|
|
11736
11736
|
const toJSONObject$1 = (obj) => {
|
|
11737
11737
|
const stack = new Array(10);
|
|
11738
11738
|
const visit = (source, i) => {
|
|
11739
|
-
if (isObject$
|
|
11739
|
+
if (isObject$4(source)) {
|
|
11740
11740
|
if (stack.indexOf(source) >= 0) {
|
|
11741
11741
|
return;
|
|
11742
11742
|
}
|
|
@@ -11756,8 +11756,8 @@ const toJSONObject$1 = (obj) => {
|
|
|
11756
11756
|
return visit(obj, 0);
|
|
11757
11757
|
};
|
|
11758
11758
|
const isAsyncFn$1 = kindOfTest$1("AsyncFunction");
|
|
11759
|
-
const isThenable$1 = (thing) => thing && (isObject$
|
|
11760
|
-
var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$
|
|
11759
|
+
const isThenable$1 = (thing) => thing && (isObject$4(thing) || isFunction$4(thing)) && isFunction$4(thing.then) && isFunction$4(thing.catch);
|
|
11760
|
+
var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$4, isPlainObject: isPlainObject$1, isUndefined: isUndefined$1, isDate: isDate$1, isFile: isFile$1, isBlob: isBlob$1, isRegExp: isRegExp$1, isFunction: isFunction$4, isStream: isStream$1, isURLSearchParams: isURLSearchParams$1, isTypedArray: isTypedArray$1, isFileList: isFileList$1, forEach: forEach$1, merge: merge$1, extend: extend$1, trim: trim$1, stripBOM: stripBOM$1, inherits: inherits$1, toFlatObject: toFlatObject$1, kindOf: kindOf$1, kindOfTest: kindOfTest$1, endsWith: endsWith$1, toArray: toArray$1, forEachEntry: forEachEntry$1, matchAll: matchAll$1, isHTMLForm: isHTMLForm$1, hasOwnProperty: hasOwnProperty$5, hasOwnProp: hasOwnProperty$5, reduceDescriptors: reduceDescriptors$1, freezeMethods: freezeMethods$1, toObjectSet: toObjectSet$1, toCamelCase: toCamelCase$1, noop: noop$1, toFiniteNumber: toFiniteNumber$1, findKey: findKey$1, global: _global$1, isContextDefined: isContextDefined$1, ALPHABET: ALPHABET$1, generateString: generateString$1, isSpecCompliantForm: isSpecCompliantForm$1, toJSONObject: toJSONObject$1, isAsyncFn: isAsyncFn$1, isThenable: isThenable$1 };
|
|
11761
11761
|
function AxiosError$1(message, code, config2, request, response) {
|
|
11762
11762
|
Error.call(this);
|
|
11763
11763
|
if (Error.captureStackTrace) {
|
|
@@ -13229,7 +13229,7 @@ const typeOfTest = (type) => (thing) => typeof thing === type;
|
|
|
13229
13229
|
const { isArray } = Array;
|
|
13230
13230
|
const isUndefined = typeOfTest("undefined");
|
|
13231
13231
|
function isBuffer(val) {
|
|
13232
|
-
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$
|
|
13232
|
+
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$3(val.constructor.isBuffer) && val.constructor.isBuffer(val);
|
|
13233
13233
|
}
|
|
13234
13234
|
const isArrayBuffer = kindOfTest("ArrayBuffer");
|
|
13235
13235
|
function isArrayBufferView(val) {
|
|
@@ -13242,9 +13242,9 @@ function isArrayBufferView(val) {
|
|
|
13242
13242
|
return result;
|
|
13243
13243
|
}
|
|
13244
13244
|
const isString = typeOfTest("string");
|
|
13245
|
-
const isFunction$
|
|
13245
|
+
const isFunction$3 = typeOfTest("function");
|
|
13246
13246
|
const isNumber = typeOfTest("number");
|
|
13247
|
-
const isObject = (thing) => thing !== null && typeof thing === "object";
|
|
13247
|
+
const isObject$3 = (thing) => thing !== null && typeof thing === "object";
|
|
13248
13248
|
const isBoolean = (thing) => thing === true || thing === false;
|
|
13249
13249
|
const isPlainObject = (val) => {
|
|
13250
13250
|
if (kindOf(val) !== "object") {
|
|
@@ -13257,11 +13257,11 @@ const isDate = kindOfTest("Date");
|
|
|
13257
13257
|
const isFile = kindOfTest("File");
|
|
13258
13258
|
const isBlob = kindOfTest("Blob");
|
|
13259
13259
|
const isFileList = kindOfTest("FileList");
|
|
13260
|
-
const isStream = (val) => isObject(val) && isFunction$
|
|
13260
|
+
const isStream = (val) => isObject$3(val) && isFunction$3(val.pipe);
|
|
13261
13261
|
const isFormData = (thing) => {
|
|
13262
13262
|
let kind;
|
|
13263
|
-
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$
|
|
13264
|
-
kind === "object" && isFunction$
|
|
13263
|
+
return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$3(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
|
|
13264
|
+
kind === "object" && isFunction$3(thing.toString) && thing.toString() === "[object FormData]"));
|
|
13265
13265
|
};
|
|
13266
13266
|
const isURLSearchParams = kindOfTest("URLSearchParams");
|
|
13267
13267
|
const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
|
|
@@ -13330,7 +13330,7 @@ function merge() {
|
|
|
13330
13330
|
}
|
|
13331
13331
|
const extend = (a2, b, thisArg, { allOwnKeys } = {}) => {
|
|
13332
13332
|
forEach(b, (val, key) => {
|
|
13333
|
-
if (thisArg && isFunction$
|
|
13333
|
+
if (thisArg && isFunction$3(val)) {
|
|
13334
13334
|
a2[key] = bind(val, thisArg);
|
|
13335
13335
|
} else {
|
|
13336
13336
|
a2[key] = val;
|
|
@@ -13428,7 +13428,7 @@ const toCamelCase = (str) => {
|
|
|
13428
13428
|
}
|
|
13429
13429
|
);
|
|
13430
13430
|
};
|
|
13431
|
-
const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
13431
|
+
const hasOwnProperty$4 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
|
|
13432
13432
|
const isRegExp = kindOfTest("RegExp");
|
|
13433
13433
|
const reduceDescriptors = (obj, reducer) => {
|
|
13434
13434
|
const descriptors2 = Object.getOwnPropertyDescriptors(obj);
|
|
@@ -13443,11 +13443,11 @@ const reduceDescriptors = (obj, reducer) => {
|
|
|
13443
13443
|
};
|
|
13444
13444
|
const freezeMethods = (obj) => {
|
|
13445
13445
|
reduceDescriptors(obj, (descriptor, name) => {
|
|
13446
|
-
if (isFunction$
|
|
13446
|
+
if (isFunction$3(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
|
|
13447
13447
|
return false;
|
|
13448
13448
|
}
|
|
13449
13449
|
const value = obj[name];
|
|
13450
|
-
if (!isFunction$
|
|
13450
|
+
if (!isFunction$3(value))
|
|
13451
13451
|
return;
|
|
13452
13452
|
descriptor.enumerable = false;
|
|
13453
13453
|
if ("writable" in descriptor) {
|
|
@@ -13492,12 +13492,12 @@ const generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
|
13492
13492
|
return str;
|
|
13493
13493
|
};
|
|
13494
13494
|
function isSpecCompliantForm(thing) {
|
|
13495
|
-
return !!(thing && isFunction$
|
|
13495
|
+
return !!(thing && isFunction$3(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
|
|
13496
13496
|
}
|
|
13497
13497
|
const toJSONObject = (obj) => {
|
|
13498
13498
|
const stack = new Array(10);
|
|
13499
13499
|
const visit = (source, i) => {
|
|
13500
|
-
if (isObject(source)) {
|
|
13500
|
+
if (isObject$3(source)) {
|
|
13501
13501
|
if (stack.indexOf(source) >= 0) {
|
|
13502
13502
|
return;
|
|
13503
13503
|
}
|
|
@@ -13517,7 +13517,7 @@ const toJSONObject = (obj) => {
|
|
|
13517
13517
|
return visit(obj, 0);
|
|
13518
13518
|
};
|
|
13519
13519
|
const isAsyncFn = kindOfTest("AsyncFunction");
|
|
13520
|
-
const isThenable = (thing) => thing && (isObject(thing) || isFunction$
|
|
13520
|
+
const isThenable = (thing) => thing && (isObject$3(thing) || isFunction$3(thing)) && isFunction$3(thing.then) && isFunction$3(thing.catch);
|
|
13521
13521
|
var utils$1 = {
|
|
13522
13522
|
isArray,
|
|
13523
13523
|
isArrayBuffer,
|
|
@@ -13527,7 +13527,7 @@ var utils$1 = {
|
|
|
13527
13527
|
isString,
|
|
13528
13528
|
isNumber,
|
|
13529
13529
|
isBoolean,
|
|
13530
|
-
isObject,
|
|
13530
|
+
isObject: isObject$3,
|
|
13531
13531
|
isPlainObject,
|
|
13532
13532
|
isReadableStream,
|
|
13533
13533
|
isRequest,
|
|
@@ -13538,7 +13538,7 @@ var utils$1 = {
|
|
|
13538
13538
|
isFile,
|
|
13539
13539
|
isBlob,
|
|
13540
13540
|
isRegExp,
|
|
13541
|
-
isFunction: isFunction$
|
|
13541
|
+
isFunction: isFunction$3,
|
|
13542
13542
|
isStream,
|
|
13543
13543
|
isURLSearchParams,
|
|
13544
13544
|
isTypedArray,
|
|
@@ -13557,8 +13557,8 @@ var utils$1 = {
|
|
|
13557
13557
|
forEachEntry,
|
|
13558
13558
|
matchAll,
|
|
13559
13559
|
isHTMLForm,
|
|
13560
|
-
hasOwnProperty,
|
|
13561
|
-
hasOwnProp: hasOwnProperty,
|
|
13560
|
+
hasOwnProperty: hasOwnProperty$4,
|
|
13561
|
+
hasOwnProp: hasOwnProperty$4,
|
|
13562
13562
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
13563
13563
|
reduceDescriptors,
|
|
13564
13564
|
freezeMethods,
|
|
@@ -17124,7 +17124,7 @@ axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new For
|
|
|
17124
17124
|
axios.getAdapter = adapters.getAdapter;
|
|
17125
17125
|
axios.HttpStatusCode = HttpStatusCode;
|
|
17126
17126
|
axios.default = axios;
|
|
17127
|
-
var isFunction = function isFunction2(variable) {
|
|
17127
|
+
var isFunction$2 = function isFunction2(variable) {
|
|
17128
17128
|
return typeof variable === "function";
|
|
17129
17129
|
};
|
|
17130
17130
|
var STATUS;
|
|
@@ -17163,7 +17163,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17163
17163
|
var blockRequest = false;
|
|
17164
17164
|
var blockError = null;
|
|
17165
17165
|
var handleError = function handleError2(error, c2) {
|
|
17166
|
-
if (isFunction(c2.failover)) {
|
|
17166
|
+
if (isFunction$2(c2.failover)) {
|
|
17167
17167
|
var newConfig = c2.failover(error, c2);
|
|
17168
17168
|
if (typeof newConfig === "object") {
|
|
17169
17169
|
return instance.request(_objectSpread2(_objectSpread2({}, newConfig), {}, {
|
|
@@ -17171,7 +17171,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17171
17171
|
}));
|
|
17172
17172
|
}
|
|
17173
17173
|
}
|
|
17174
|
-
if (isFunction(c2.shouldBlock)) {
|
|
17174
|
+
if (isFunction$2(c2.shouldBlock)) {
|
|
17175
17175
|
blockRequest = c2.shouldBlock(error);
|
|
17176
17176
|
blockError = error;
|
|
17177
17177
|
setTimeout(function() {
|
|
@@ -17185,7 +17185,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17185
17185
|
return instance.request(c2);
|
|
17186
17186
|
}
|
|
17187
17187
|
}
|
|
17188
|
-
if (isFunction(c2.error)) {
|
|
17188
|
+
if (isFunction$2(c2.error)) {
|
|
17189
17189
|
c2.error(error, c2);
|
|
17190
17190
|
}
|
|
17191
17191
|
return Promise.reject(error);
|
|
@@ -17228,7 +17228,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17228
17228
|
cache[key] = {
|
|
17229
17229
|
status: STATUS.pending,
|
|
17230
17230
|
timer: setTimeout(function() {
|
|
17231
|
-
if (isFunction(loading)) {
|
|
17231
|
+
if (isFunction$2(loading)) {
|
|
17232
17232
|
loading(_objectSpread2(_objectSpread2({}, c2), {}, {
|
|
17233
17233
|
key
|
|
17234
17234
|
}));
|
|
@@ -17299,7 +17299,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17299
17299
|
}
|
|
17300
17300
|
}
|
|
17301
17301
|
}
|
|
17302
|
-
if (isFunction(_config.complete)) {
|
|
17302
|
+
if (isFunction$2(_config.complete)) {
|
|
17303
17303
|
_config.complete(c2);
|
|
17304
17304
|
}
|
|
17305
17305
|
return response;
|
|
@@ -17312,7 +17312,7 @@ var Request$1 = /* @__PURE__ */ function() {
|
|
|
17312
17312
|
delete cache[key];
|
|
17313
17313
|
}
|
|
17314
17314
|
}
|
|
17315
|
-
if (isFunction(_config.complete)) {
|
|
17315
|
+
if (isFunction$2(_config.complete)) {
|
|
17316
17316
|
_config.complete(error.config);
|
|
17317
17317
|
}
|
|
17318
17318
|
return handleError(error, error.config);
|
|
@@ -17530,9 +17530,9 @@ function _generatePublicKey() {
|
|
|
17530
17530
|
}
|
|
17531
17531
|
const parseParams = (params) => {
|
|
17532
17532
|
var _a2;
|
|
17533
|
-
const { prefix = "", host, sdpAppId, uc, ...reset } = params;
|
|
17533
|
+
const { prefix = "", host, sdpAppId, uc, noSdpAppId, ...reset } = params;
|
|
17534
17534
|
const headers = {
|
|
17535
|
-
sdpAppId: sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
|
|
17535
|
+
sdpAppId: noSdpAppId ? null : sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
|
|
17536
17536
|
...reset || {}
|
|
17537
17537
|
};
|
|
17538
17538
|
params.originBaseURL = `${host}${prefix}`;
|
|
@@ -17548,7 +17548,8 @@ function getApi({
|
|
|
17548
17548
|
prefix,
|
|
17549
17549
|
params,
|
|
17550
17550
|
throwError,
|
|
17551
|
-
sdpAppId
|
|
17551
|
+
sdpAppId,
|
|
17552
|
+
noSdpAppId
|
|
17552
17553
|
}) {
|
|
17553
17554
|
var _a2;
|
|
17554
17555
|
const _params = parseParams({
|
|
@@ -17556,7 +17557,8 @@ function getApi({
|
|
|
17556
17557
|
prefix,
|
|
17557
17558
|
host,
|
|
17558
17559
|
uc,
|
|
17559
|
-
sdpAppId
|
|
17560
|
+
sdpAppId,
|
|
17561
|
+
noSdpAppId
|
|
17560
17562
|
});
|
|
17561
17563
|
if (!uc) {
|
|
17562
17564
|
return rawAPI(_params);
|
|
@@ -17568,6 +17570,38 @@ function getApi({
|
|
|
17568
17570
|
}, throwError);
|
|
17569
17571
|
}
|
|
17570
17572
|
const api = getApi({});
|
|
17573
|
+
function isTestHost() {
|
|
17574
|
+
const testHosts = [
|
|
17575
|
+
"localhost",
|
|
17576
|
+
"x-edu-web.beta.101.com",
|
|
17577
|
+
"test3.ykt.eduyun.cn",
|
|
17578
|
+
"test5.ykt.eduyun.cn",
|
|
17579
|
+
"test6.ykt.eduyun.cn",
|
|
17580
|
+
"test-x-edu-portal4.ykt.eduyun.cn",
|
|
17581
|
+
"web-bd.ykt.eduyun.cn",
|
|
17582
|
+
"xue-test.ykt.eduyun.cn",
|
|
17583
|
+
"teach-test.ykt.eduyun.cn",
|
|
17584
|
+
"teach-test2.ykt.eduyun.cn",
|
|
17585
|
+
"teach-test3.ykt.eduyun.cn",
|
|
17586
|
+
"h5-teach-test.ykt.eduyun.cn",
|
|
17587
|
+
"h5-teach-test2.ykt.eduyun.cn",
|
|
17588
|
+
"test-x-edu-portal3.ykt.eduyun.cn",
|
|
17589
|
+
"museum-test4.ykt.eduyun.cn",
|
|
17590
|
+
"sun.ykt.eduyun.cn",
|
|
17591
|
+
"computer.ykt.eduyun.cn",
|
|
17592
|
+
"zxx-preview.ykt.eduyun.cn"
|
|
17593
|
+
];
|
|
17594
|
+
if (testHosts.indexOf(window.location.host) > -1 || window.location.host.indexOf("localhost") > -1 || window.location.host.indexOf("192.") > -1) {
|
|
17595
|
+
return true;
|
|
17596
|
+
}
|
|
17597
|
+
return false;
|
|
17598
|
+
}
|
|
17599
|
+
function getValueByHost({ value, defaultValue }) {
|
|
17600
|
+
if (isTestHost()) {
|
|
17601
|
+
return value;
|
|
17602
|
+
}
|
|
17603
|
+
return defaultValue;
|
|
17604
|
+
}
|
|
17571
17605
|
const config = {
|
|
17572
17606
|
"ncet-xedu": {
|
|
17573
17607
|
// 代理
|
|
@@ -17584,7 +17618,28 @@ const config = {
|
|
|
17584
17618
|
// 收藏
|
|
17585
17619
|
"e-favorite-api": "//e-favorite-api.ykt.eduyun.cn",
|
|
17586
17620
|
// 学习记录
|
|
17587
|
-
"x-study-record": "//x-study-record-api.ykt.eduyun.cn"
|
|
17621
|
+
"x-study-record": "//x-study-record-api.ykt.eduyun.cn",
|
|
17622
|
+
cdn: getValueByHost({
|
|
17623
|
+
value: "//pretest-s-file-1.ykt.cbern.com.cn",
|
|
17624
|
+
defaultValue: "//s-file-1.ykt.cbern.com.cn"
|
|
17625
|
+
}),
|
|
17626
|
+
"cdn-s-file": getValueByHost({
|
|
17627
|
+
value: "//pretest-s-file-1.ykt.cbern.com.cn",
|
|
17628
|
+
defaultValue: "//s-file-1.ykt.cbern.com.cn"
|
|
17629
|
+
}),
|
|
17630
|
+
"cdn-bdcs-file": "//bdcs-file-1.ykt.cbern.com.cn",
|
|
17631
|
+
// 站点配置(存在灰度能力)
|
|
17632
|
+
"site-config": "//grey-config-web.ykt.cbern.com.cn",
|
|
17633
|
+
serviceName: {
|
|
17634
|
+
site: "bdxcloud",
|
|
17635
|
+
zxxRegion: "zxx_region",
|
|
17636
|
+
train: "teach",
|
|
17637
|
+
"t-course": "teach",
|
|
17638
|
+
eLabour: "ldjy"
|
|
17639
|
+
},
|
|
17640
|
+
defaultAreaSite: "hn",
|
|
17641
|
+
// 内容库
|
|
17642
|
+
"elearning-library": "//elearning-library-gateway.ykt.eduyun.cn"
|
|
17588
17643
|
},
|
|
17589
17644
|
preproduction: {
|
|
17590
17645
|
// 代理
|
|
@@ -17597,7 +17652,20 @@ const config = {
|
|
|
17597
17652
|
"cs-feedback": "//betacs.101.com",
|
|
17598
17653
|
"e-favorite-api": "//e-favorite-api.beta.101.com",
|
|
17599
17654
|
// 学习记录
|
|
17600
|
-
"x-study-record": "//x-study-record-api.beta.101.com"
|
|
17655
|
+
"x-study-record": "//x-study-record-api.beta.101.com",
|
|
17656
|
+
cdn: "//ndcs-pre.101.com",
|
|
17657
|
+
// 站点配置(存在灰度能力)
|
|
17658
|
+
"site-config": "//grey-config-web.ykt.cbern.com.cn",
|
|
17659
|
+
serviceName: {
|
|
17660
|
+
site: "preproduction_content_x_cloud",
|
|
17661
|
+
zxxRegion: "preproduction_content_zxx_region",
|
|
17662
|
+
train: "preproduction_content_staticize",
|
|
17663
|
+
"t-course": "preproduction_content_x_course",
|
|
17664
|
+
eLabour: "preproduction_content_zxx"
|
|
17665
|
+
},
|
|
17666
|
+
defaultAreaSite: "hn",
|
|
17667
|
+
// 内容库
|
|
17668
|
+
"elearning-library": "//elearning-library-gateway.beta.101.com"
|
|
17601
17669
|
}
|
|
17602
17670
|
};
|
|
17603
17671
|
const recommendAPIV2 = ({
|
|
@@ -17716,6 +17784,46 @@ const xStudyRecordAPI = ({
|
|
|
17716
17784
|
uc
|
|
17717
17785
|
});
|
|
17718
17786
|
};
|
|
17787
|
+
const cdnAPI = ({
|
|
17788
|
+
env
|
|
17789
|
+
}) => getApi({
|
|
17790
|
+
host: config[env]["cdn"],
|
|
17791
|
+
prefix: "",
|
|
17792
|
+
noSdpAppId: true
|
|
17793
|
+
});
|
|
17794
|
+
const cdnSFileAPI = ({
|
|
17795
|
+
env
|
|
17796
|
+
}) => getApi({
|
|
17797
|
+
host: config[env]["cdn-s-file"],
|
|
17798
|
+
prefix: "",
|
|
17799
|
+
noSdpAppId: true
|
|
17800
|
+
});
|
|
17801
|
+
const cdnBdcsFileAPI = ({
|
|
17802
|
+
env
|
|
17803
|
+
}) => getApi({
|
|
17804
|
+
host: config[env]["cdn-bdcs-file"],
|
|
17805
|
+
prefix: "",
|
|
17806
|
+
noSdpAppId: true
|
|
17807
|
+
});
|
|
17808
|
+
const siteConfigAPI = ({
|
|
17809
|
+
uc,
|
|
17810
|
+
env
|
|
17811
|
+
}) => {
|
|
17812
|
+
var _a2;
|
|
17813
|
+
return getApi({
|
|
17814
|
+
host: config[env]["site-config"],
|
|
17815
|
+
prefix: "",
|
|
17816
|
+
sdpAppId: (_a2 = uc.options) == null ? void 0 : _a2.sdpAppId
|
|
17817
|
+
});
|
|
17818
|
+
};
|
|
17819
|
+
const eLearningLibraryAPI = ({
|
|
17820
|
+
uc,
|
|
17821
|
+
env
|
|
17822
|
+
}) => getApi({
|
|
17823
|
+
host: config[env]["elearning-library"],
|
|
17824
|
+
prefix: "",
|
|
17825
|
+
uc
|
|
17826
|
+
});
|
|
17719
17827
|
async function getStatByChunk(resIds, requestFn, ...args) {
|
|
17720
17828
|
try {
|
|
17721
17829
|
const chunkSize = 100;
|
|
@@ -18436,6 +18544,740 @@ class StudyRecord {
|
|
|
18436
18544
|
this.request = request;
|
|
18437
18545
|
}
|
|
18438
18546
|
}
|
|
18547
|
+
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
18548
|
+
var _freeGlobal = freeGlobal$1;
|
|
18549
|
+
var freeGlobal = _freeGlobal;
|
|
18550
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
18551
|
+
var root$3 = freeGlobal || freeSelf || Function("return this")();
|
|
18552
|
+
var _root = root$3;
|
|
18553
|
+
var root$2 = _root;
|
|
18554
|
+
var Symbol$3 = root$2.Symbol;
|
|
18555
|
+
var _Symbol = Symbol$3;
|
|
18556
|
+
var Symbol$2 = _Symbol;
|
|
18557
|
+
var objectProto$4 = Object.prototype;
|
|
18558
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
18559
|
+
var nativeObjectToString$1 = objectProto$4.toString;
|
|
18560
|
+
var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
18561
|
+
function getRawTag$1(value) {
|
|
18562
|
+
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
18563
|
+
try {
|
|
18564
|
+
value[symToStringTag$1] = void 0;
|
|
18565
|
+
var unmasked = true;
|
|
18566
|
+
} catch (e2) {
|
|
18567
|
+
}
|
|
18568
|
+
var result = nativeObjectToString$1.call(value);
|
|
18569
|
+
if (unmasked) {
|
|
18570
|
+
if (isOwn) {
|
|
18571
|
+
value[symToStringTag$1] = tag;
|
|
18572
|
+
} else {
|
|
18573
|
+
delete value[symToStringTag$1];
|
|
18574
|
+
}
|
|
18575
|
+
}
|
|
18576
|
+
return result;
|
|
18577
|
+
}
|
|
18578
|
+
var _getRawTag = getRawTag$1;
|
|
18579
|
+
var objectProto$3 = Object.prototype;
|
|
18580
|
+
var nativeObjectToString = objectProto$3.toString;
|
|
18581
|
+
function objectToString$1(value) {
|
|
18582
|
+
return nativeObjectToString.call(value);
|
|
18583
|
+
}
|
|
18584
|
+
var _objectToString = objectToString$1;
|
|
18585
|
+
var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
|
|
18586
|
+
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
18587
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
18588
|
+
function baseGetTag$1(value) {
|
|
18589
|
+
if (value == null) {
|
|
18590
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
18591
|
+
}
|
|
18592
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
18593
|
+
}
|
|
18594
|
+
var _baseGetTag = baseGetTag$1;
|
|
18595
|
+
function isObject$2(value) {
|
|
18596
|
+
var type = typeof value;
|
|
18597
|
+
return value != null && (type == "object" || type == "function");
|
|
18598
|
+
}
|
|
18599
|
+
var isObject_1 = isObject$2;
|
|
18600
|
+
var baseGetTag = _baseGetTag, isObject$1 = isObject_1;
|
|
18601
|
+
var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
18602
|
+
function isFunction$1(value) {
|
|
18603
|
+
if (!isObject$1(value)) {
|
|
18604
|
+
return false;
|
|
18605
|
+
}
|
|
18606
|
+
var tag = baseGetTag(value);
|
|
18607
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
18608
|
+
}
|
|
18609
|
+
var isFunction_1 = isFunction$1;
|
|
18610
|
+
var root$1 = _root;
|
|
18611
|
+
var coreJsData$1 = root$1["__core-js_shared__"];
|
|
18612
|
+
var _coreJsData = coreJsData$1;
|
|
18613
|
+
var coreJsData = _coreJsData;
|
|
18614
|
+
var maskSrcKey = function() {
|
|
18615
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
18616
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
18617
|
+
}();
|
|
18618
|
+
function isMasked$1(func) {
|
|
18619
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
18620
|
+
}
|
|
18621
|
+
var _isMasked = isMasked$1;
|
|
18622
|
+
var funcProto$1 = Function.prototype;
|
|
18623
|
+
var funcToString$1 = funcProto$1.toString;
|
|
18624
|
+
function toSource$1(func) {
|
|
18625
|
+
if (func != null) {
|
|
18626
|
+
try {
|
|
18627
|
+
return funcToString$1.call(func);
|
|
18628
|
+
} catch (e2) {
|
|
18629
|
+
}
|
|
18630
|
+
try {
|
|
18631
|
+
return func + "";
|
|
18632
|
+
} catch (e2) {
|
|
18633
|
+
}
|
|
18634
|
+
}
|
|
18635
|
+
return "";
|
|
18636
|
+
}
|
|
18637
|
+
var _toSource = toSource$1;
|
|
18638
|
+
var isFunction = isFunction_1, isMasked = _isMasked, isObject = isObject_1, toSource = _toSource;
|
|
18639
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
18640
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
18641
|
+
var funcProto = Function.prototype, objectProto$2 = Object.prototype;
|
|
18642
|
+
var funcToString = funcProto.toString;
|
|
18643
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
18644
|
+
var reIsNative = RegExp(
|
|
18645
|
+
"^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
18646
|
+
);
|
|
18647
|
+
function baseIsNative$1(value) {
|
|
18648
|
+
if (!isObject(value) || isMasked(value)) {
|
|
18649
|
+
return false;
|
|
18650
|
+
}
|
|
18651
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
18652
|
+
return pattern.test(toSource(value));
|
|
18653
|
+
}
|
|
18654
|
+
var _baseIsNative = baseIsNative$1;
|
|
18655
|
+
function getValue$1(object, key) {
|
|
18656
|
+
return object == null ? void 0 : object[key];
|
|
18657
|
+
}
|
|
18658
|
+
var _getValue = getValue$1;
|
|
18659
|
+
var baseIsNative = _baseIsNative, getValue = _getValue;
|
|
18660
|
+
function getNative$2(object, key) {
|
|
18661
|
+
var value = getValue(object, key);
|
|
18662
|
+
return baseIsNative(value) ? value : void 0;
|
|
18663
|
+
}
|
|
18664
|
+
var _getNative = getNative$2;
|
|
18665
|
+
var getNative$1 = _getNative;
|
|
18666
|
+
var nativeCreate$4 = getNative$1(Object, "create");
|
|
18667
|
+
var _nativeCreate = nativeCreate$4;
|
|
18668
|
+
var nativeCreate$3 = _nativeCreate;
|
|
18669
|
+
function hashClear$1() {
|
|
18670
|
+
this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
|
|
18671
|
+
this.size = 0;
|
|
18672
|
+
}
|
|
18673
|
+
var _hashClear = hashClear$1;
|
|
18674
|
+
function hashDelete$1(key) {
|
|
18675
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
18676
|
+
this.size -= result ? 1 : 0;
|
|
18677
|
+
return result;
|
|
18678
|
+
}
|
|
18679
|
+
var _hashDelete = hashDelete$1;
|
|
18680
|
+
var nativeCreate$2 = _nativeCreate;
|
|
18681
|
+
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
18682
|
+
var objectProto$1 = Object.prototype;
|
|
18683
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
18684
|
+
function hashGet$1(key) {
|
|
18685
|
+
var data = this.__data__;
|
|
18686
|
+
if (nativeCreate$2) {
|
|
18687
|
+
var result = data[key];
|
|
18688
|
+
return result === HASH_UNDEFINED$1 ? void 0 : result;
|
|
18689
|
+
}
|
|
18690
|
+
return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
|
|
18691
|
+
}
|
|
18692
|
+
var _hashGet = hashGet$1;
|
|
18693
|
+
var nativeCreate$1 = _nativeCreate;
|
|
18694
|
+
var objectProto = Object.prototype;
|
|
18695
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
18696
|
+
function hashHas$1(key) {
|
|
18697
|
+
var data = this.__data__;
|
|
18698
|
+
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
18699
|
+
}
|
|
18700
|
+
var _hashHas = hashHas$1;
|
|
18701
|
+
var nativeCreate = _nativeCreate;
|
|
18702
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
18703
|
+
function hashSet$1(key, value) {
|
|
18704
|
+
var data = this.__data__;
|
|
18705
|
+
this.size += this.has(key) ? 0 : 1;
|
|
18706
|
+
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
18707
|
+
return this;
|
|
18708
|
+
}
|
|
18709
|
+
var _hashSet = hashSet$1;
|
|
18710
|
+
var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
|
|
18711
|
+
function Hash$1(entries) {
|
|
18712
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
18713
|
+
this.clear();
|
|
18714
|
+
while (++index < length) {
|
|
18715
|
+
var entry = entries[index];
|
|
18716
|
+
this.set(entry[0], entry[1]);
|
|
18717
|
+
}
|
|
18718
|
+
}
|
|
18719
|
+
Hash$1.prototype.clear = hashClear;
|
|
18720
|
+
Hash$1.prototype["delete"] = hashDelete;
|
|
18721
|
+
Hash$1.prototype.get = hashGet;
|
|
18722
|
+
Hash$1.prototype.has = hashHas;
|
|
18723
|
+
Hash$1.prototype.set = hashSet;
|
|
18724
|
+
var _Hash = Hash$1;
|
|
18725
|
+
function listCacheClear$1() {
|
|
18726
|
+
this.__data__ = [];
|
|
18727
|
+
this.size = 0;
|
|
18728
|
+
}
|
|
18729
|
+
var _listCacheClear = listCacheClear$1;
|
|
18730
|
+
function eq$1(value, other) {
|
|
18731
|
+
return value === other || value !== value && other !== other;
|
|
18732
|
+
}
|
|
18733
|
+
var eq_1 = eq$1;
|
|
18734
|
+
var eq = eq_1;
|
|
18735
|
+
function assocIndexOf$4(array, key) {
|
|
18736
|
+
var length = array.length;
|
|
18737
|
+
while (length--) {
|
|
18738
|
+
if (eq(array[length][0], key)) {
|
|
18739
|
+
return length;
|
|
18740
|
+
}
|
|
18741
|
+
}
|
|
18742
|
+
return -1;
|
|
18743
|
+
}
|
|
18744
|
+
var _assocIndexOf = assocIndexOf$4;
|
|
18745
|
+
var assocIndexOf$3 = _assocIndexOf;
|
|
18746
|
+
var arrayProto = Array.prototype;
|
|
18747
|
+
var splice = arrayProto.splice;
|
|
18748
|
+
function listCacheDelete$1(key) {
|
|
18749
|
+
var data = this.__data__, index = assocIndexOf$3(data, key);
|
|
18750
|
+
if (index < 0) {
|
|
18751
|
+
return false;
|
|
18752
|
+
}
|
|
18753
|
+
var lastIndex = data.length - 1;
|
|
18754
|
+
if (index == lastIndex) {
|
|
18755
|
+
data.pop();
|
|
18756
|
+
} else {
|
|
18757
|
+
splice.call(data, index, 1);
|
|
18758
|
+
}
|
|
18759
|
+
--this.size;
|
|
18760
|
+
return true;
|
|
18761
|
+
}
|
|
18762
|
+
var _listCacheDelete = listCacheDelete$1;
|
|
18763
|
+
var assocIndexOf$2 = _assocIndexOf;
|
|
18764
|
+
function listCacheGet$1(key) {
|
|
18765
|
+
var data = this.__data__, index = assocIndexOf$2(data, key);
|
|
18766
|
+
return index < 0 ? void 0 : data[index][1];
|
|
18767
|
+
}
|
|
18768
|
+
var _listCacheGet = listCacheGet$1;
|
|
18769
|
+
var assocIndexOf$1 = _assocIndexOf;
|
|
18770
|
+
function listCacheHas$1(key) {
|
|
18771
|
+
return assocIndexOf$1(this.__data__, key) > -1;
|
|
18772
|
+
}
|
|
18773
|
+
var _listCacheHas = listCacheHas$1;
|
|
18774
|
+
var assocIndexOf = _assocIndexOf;
|
|
18775
|
+
function listCacheSet$1(key, value) {
|
|
18776
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
18777
|
+
if (index < 0) {
|
|
18778
|
+
++this.size;
|
|
18779
|
+
data.push([key, value]);
|
|
18780
|
+
} else {
|
|
18781
|
+
data[index][1] = value;
|
|
18782
|
+
}
|
|
18783
|
+
return this;
|
|
18784
|
+
}
|
|
18785
|
+
var _listCacheSet = listCacheSet$1;
|
|
18786
|
+
var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
|
|
18787
|
+
function ListCache$1(entries) {
|
|
18788
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
18789
|
+
this.clear();
|
|
18790
|
+
while (++index < length) {
|
|
18791
|
+
var entry = entries[index];
|
|
18792
|
+
this.set(entry[0], entry[1]);
|
|
18793
|
+
}
|
|
18794
|
+
}
|
|
18795
|
+
ListCache$1.prototype.clear = listCacheClear;
|
|
18796
|
+
ListCache$1.prototype["delete"] = listCacheDelete;
|
|
18797
|
+
ListCache$1.prototype.get = listCacheGet;
|
|
18798
|
+
ListCache$1.prototype.has = listCacheHas;
|
|
18799
|
+
ListCache$1.prototype.set = listCacheSet;
|
|
18800
|
+
var _ListCache = ListCache$1;
|
|
18801
|
+
var getNative = _getNative, root = _root;
|
|
18802
|
+
var Map$1 = getNative(root, "Map");
|
|
18803
|
+
var _Map = Map$1;
|
|
18804
|
+
var Hash = _Hash, ListCache = _ListCache, Map = _Map;
|
|
18805
|
+
function mapCacheClear$1() {
|
|
18806
|
+
this.size = 0;
|
|
18807
|
+
this.__data__ = {
|
|
18808
|
+
"hash": new Hash(),
|
|
18809
|
+
"map": new (Map || ListCache)(),
|
|
18810
|
+
"string": new Hash()
|
|
18811
|
+
};
|
|
18812
|
+
}
|
|
18813
|
+
var _mapCacheClear = mapCacheClear$1;
|
|
18814
|
+
function isKeyable$1(value) {
|
|
18815
|
+
var type = typeof value;
|
|
18816
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
18817
|
+
}
|
|
18818
|
+
var _isKeyable = isKeyable$1;
|
|
18819
|
+
var isKeyable = _isKeyable;
|
|
18820
|
+
function getMapData$4(map, key) {
|
|
18821
|
+
var data = map.__data__;
|
|
18822
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
18823
|
+
}
|
|
18824
|
+
var _getMapData = getMapData$4;
|
|
18825
|
+
var getMapData$3 = _getMapData;
|
|
18826
|
+
function mapCacheDelete$1(key) {
|
|
18827
|
+
var result = getMapData$3(this, key)["delete"](key);
|
|
18828
|
+
this.size -= result ? 1 : 0;
|
|
18829
|
+
return result;
|
|
18830
|
+
}
|
|
18831
|
+
var _mapCacheDelete = mapCacheDelete$1;
|
|
18832
|
+
var getMapData$2 = _getMapData;
|
|
18833
|
+
function mapCacheGet$1(key) {
|
|
18834
|
+
return getMapData$2(this, key).get(key);
|
|
18835
|
+
}
|
|
18836
|
+
var _mapCacheGet = mapCacheGet$1;
|
|
18837
|
+
var getMapData$1 = _getMapData;
|
|
18838
|
+
function mapCacheHas$1(key) {
|
|
18839
|
+
return getMapData$1(this, key).has(key);
|
|
18840
|
+
}
|
|
18841
|
+
var _mapCacheHas = mapCacheHas$1;
|
|
18842
|
+
var getMapData = _getMapData;
|
|
18843
|
+
function mapCacheSet$1(key, value) {
|
|
18844
|
+
var data = getMapData(this, key), size = data.size;
|
|
18845
|
+
data.set(key, value);
|
|
18846
|
+
this.size += data.size == size ? 0 : 1;
|
|
18847
|
+
return this;
|
|
18848
|
+
}
|
|
18849
|
+
var _mapCacheSet = mapCacheSet$1;
|
|
18850
|
+
var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
|
|
18851
|
+
function MapCache$1(entries) {
|
|
18852
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
18853
|
+
this.clear();
|
|
18854
|
+
while (++index < length) {
|
|
18855
|
+
var entry = entries[index];
|
|
18856
|
+
this.set(entry[0], entry[1]);
|
|
18857
|
+
}
|
|
18858
|
+
}
|
|
18859
|
+
MapCache$1.prototype.clear = mapCacheClear;
|
|
18860
|
+
MapCache$1.prototype["delete"] = mapCacheDelete;
|
|
18861
|
+
MapCache$1.prototype.get = mapCacheGet;
|
|
18862
|
+
MapCache$1.prototype.has = mapCacheHas;
|
|
18863
|
+
MapCache$1.prototype.set = mapCacheSet;
|
|
18864
|
+
var _MapCache = MapCache$1;
|
|
18865
|
+
var MapCache = _MapCache;
|
|
18866
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
18867
|
+
function memoize(func, resolver) {
|
|
18868
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
18869
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
18870
|
+
}
|
|
18871
|
+
var memoized = function() {
|
|
18872
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
18873
|
+
if (cache.has(key)) {
|
|
18874
|
+
return cache.get(key);
|
|
18875
|
+
}
|
|
18876
|
+
var result = func.apply(this, args);
|
|
18877
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
18878
|
+
return result;
|
|
18879
|
+
};
|
|
18880
|
+
memoized.cache = new (memoize.Cache || MapCache)();
|
|
18881
|
+
return memoized;
|
|
18882
|
+
}
|
|
18883
|
+
memoize.Cache = MapCache;
|
|
18884
|
+
var memoize_1 = memoize;
|
|
18885
|
+
const memoize$1 = /* @__PURE__ */ getDefaultExportFromCjs(memoize_1);
|
|
18886
|
+
const serviceName = "teach";
|
|
18887
|
+
class TCourse {
|
|
18888
|
+
constructor(props) {
|
|
18889
|
+
__publicField(this, "request");
|
|
18890
|
+
__publicField(this, "config");
|
|
18891
|
+
__publicField(this, "getCourseRelativeInfo1", memoize$1(
|
|
18892
|
+
async (courseId) => {
|
|
18893
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18894
|
+
`/${this.config.serviceName["t-course"]}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
|
|
18895
|
+
);
|
|
18896
|
+
const { data: provider } = await this.request.cdn.cdnAPI.get(
|
|
18897
|
+
`/${serviceName}/s_course/v2/business_courses/${courseId}/course_providers.json`
|
|
18898
|
+
);
|
|
18899
|
+
if (data.course_detail && (provider == null ? void 0 : provider.length)) {
|
|
18900
|
+
data.course_detail.ext_info = {
|
|
18901
|
+
...data.course_detail.ext_info,
|
|
18902
|
+
source: provider.map((item) => item.name).join("/")
|
|
18903
|
+
};
|
|
18904
|
+
}
|
|
18905
|
+
return data;
|
|
18906
|
+
},
|
|
18907
|
+
(courseId) => `CourseRelativeInfo_${courseId}`
|
|
18908
|
+
));
|
|
18909
|
+
__publicField(this, "getCourseRelativeInfo", async ({
|
|
18910
|
+
courseId,
|
|
18911
|
+
tenantCode
|
|
18912
|
+
}) => {
|
|
18913
|
+
const { data } = await this.request.cdn.cdnAPI.get(`/${tenantCode}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`);
|
|
18914
|
+
return data;
|
|
18915
|
+
});
|
|
18916
|
+
__publicField(this, "getAreaCourseRelativeInfo", memoize$1(
|
|
18917
|
+
async ({ courseId, siteRelaId }) => {
|
|
18918
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18919
|
+
`/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
|
|
18920
|
+
);
|
|
18921
|
+
const { data: provider } = await this.request.cdn.cdnAPI.get(
|
|
18922
|
+
`/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_providers.json`
|
|
18923
|
+
);
|
|
18924
|
+
if (data.course_detail && (provider == null ? void 0 : provider.length)) {
|
|
18925
|
+
data.course_detail.ext_info = {
|
|
18926
|
+
...data.course_detail.ext_info,
|
|
18927
|
+
source: provider.map((item) => item.name).join("/")
|
|
18928
|
+
};
|
|
18929
|
+
}
|
|
18930
|
+
return data;
|
|
18931
|
+
},
|
|
18932
|
+
({ courseId }) => `Area-CourseRelativeInfo_${courseId}`
|
|
18933
|
+
));
|
|
18934
|
+
/**
|
|
18935
|
+
* 获取活动集信息, 包括了章节目录信息
|
|
18936
|
+
*
|
|
18937
|
+
* @export
|
|
18938
|
+
* @param {string} activitySetId
|
|
18939
|
+
* @returns 课程的活动集信息, nodes字段中包含活动节点信息
|
|
18940
|
+
*/
|
|
18941
|
+
__publicField(this, "getActiveSet", async ({
|
|
18942
|
+
activitySetId,
|
|
18943
|
+
tenantCode
|
|
18944
|
+
}) => {
|
|
18945
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18946
|
+
`/${tenantCode}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
|
|
18947
|
+
);
|
|
18948
|
+
if (data) {
|
|
18949
|
+
data.activity_set_id = activitySetId;
|
|
18950
|
+
}
|
|
18951
|
+
return data;
|
|
18952
|
+
});
|
|
18953
|
+
__publicField(this, "getAreaActiveSet", async ({ activitySetId, siteRelaId }) => {
|
|
18954
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18955
|
+
`/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
|
|
18956
|
+
);
|
|
18957
|
+
if (data) {
|
|
18958
|
+
data.activity_set_id = activitySetId;
|
|
18959
|
+
}
|
|
18960
|
+
return data;
|
|
18961
|
+
});
|
|
18962
|
+
// 获取视频活动课时
|
|
18963
|
+
__publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
|
|
18964
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18965
|
+
`/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
|
|
18966
|
+
);
|
|
18967
|
+
return data;
|
|
18968
|
+
});
|
|
18969
|
+
// 获取文档活动课时
|
|
18970
|
+
__publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
|
|
18971
|
+
const { data } = await this.request.cdn.cdnAPI.get(
|
|
18972
|
+
`/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/document_activity/${activityId}.json`
|
|
18973
|
+
);
|
|
18974
|
+
return data;
|
|
18975
|
+
});
|
|
18976
|
+
const { request, config: config2 } = props;
|
|
18977
|
+
this.request = request;
|
|
18978
|
+
this.config = config2;
|
|
18979
|
+
}
|
|
18980
|
+
}
|
|
18981
|
+
function sha256(_x) {
|
|
18982
|
+
return _sha.apply(this, arguments);
|
|
18983
|
+
}
|
|
18984
|
+
function _sha() {
|
|
18985
|
+
_sha = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(str) {
|
|
18986
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
18987
|
+
while (1)
|
|
18988
|
+
switch (_context.prev = _context.next) {
|
|
18989
|
+
case 0:
|
|
18990
|
+
return _context.abrupt("return", window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(str)).then(hex));
|
|
18991
|
+
case 1:
|
|
18992
|
+
case "end":
|
|
18993
|
+
return _context.stop();
|
|
18994
|
+
}
|
|
18995
|
+
}, _callee);
|
|
18996
|
+
}));
|
|
18997
|
+
return _sha.apply(this, arguments);
|
|
18998
|
+
}
|
|
18999
|
+
function hex(buffer) {
|
|
19000
|
+
return Array.prototype.map.call(new Uint8Array(buffer), function(b) {
|
|
19001
|
+
return `00${b.toString(16)}`.slice(-2);
|
|
19002
|
+
}).join("");
|
|
19003
|
+
}
|
|
19004
|
+
async function getRequestURL(params) {
|
|
19005
|
+
const { apiURL, language = "zh-CN", serviceName: serviceName2, sdpAppId, sdpOrgId } = params;
|
|
19006
|
+
const component = "auxo_channel_api";
|
|
19007
|
+
const [urlPath, qs] = apiURL.split("?");
|
|
19008
|
+
const hashCode = await sha256(`${urlPath}?${qs}`);
|
|
19009
|
+
const hashPath = `${urlPath}/${hashCode}.json`;
|
|
19010
|
+
return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
|
|
19011
|
+
}
|
|
19012
|
+
class Channel {
|
|
19013
|
+
constructor(props) {
|
|
19014
|
+
__publicField(this, "request");
|
|
19015
|
+
/* 获取频道列表
|
|
19016
|
+
scope: 'default' 默认频道
|
|
19017
|
+
scope: 'teach_training' 学习强师的频道
|
|
19018
|
+
*/
|
|
19019
|
+
__publicField(this, "getChannelList", async ({
|
|
19020
|
+
scope,
|
|
19021
|
+
language = "zh-CN",
|
|
19022
|
+
sdpAppId,
|
|
19023
|
+
sdpOrgId,
|
|
19024
|
+
serviceName: serviceName2,
|
|
19025
|
+
api: api2 = this.request.cdn.cdnAPI
|
|
19026
|
+
}) => {
|
|
19027
|
+
const requestURL = await getRequestURL({
|
|
19028
|
+
apiURL: `/v1/app/channels?language=zh-CN&scope=${scope}`,
|
|
19029
|
+
language,
|
|
19030
|
+
serviceName: serviceName2,
|
|
19031
|
+
sdpAppId,
|
|
19032
|
+
sdpOrgId
|
|
19033
|
+
});
|
|
19034
|
+
const { data } = await api2.get(requestURL);
|
|
19035
|
+
return data;
|
|
19036
|
+
});
|
|
19037
|
+
/* 获取频道板块信息 */
|
|
19038
|
+
__publicField(this, "getChannelSectionList", async ({ channelId, serviceName: serviceName2, sdpAppId, sdpOrgId, api: api2 = this.request.cdn.cdnBdcsFileAPI }) => {
|
|
19039
|
+
const requestURL = await getRequestURL({
|
|
19040
|
+
apiURL: `/v2/channels/${channelId}/sections?query_type=0`,
|
|
19041
|
+
serviceName: serviceName2,
|
|
19042
|
+
sdpAppId,
|
|
19043
|
+
sdpOrgId
|
|
19044
|
+
});
|
|
19045
|
+
const { data } = await api2.get(requestURL);
|
|
19046
|
+
return data;
|
|
19047
|
+
});
|
|
19048
|
+
const { request } = props;
|
|
19049
|
+
this.request = request;
|
|
19050
|
+
}
|
|
19051
|
+
}
|
|
19052
|
+
class ElearningTrain {
|
|
19053
|
+
constructor(props) {
|
|
19054
|
+
__publicField(this, "request");
|
|
19055
|
+
__publicField(this, "getTrainDetailStatic", async (trainId) => {
|
|
19056
|
+
try {
|
|
19057
|
+
const requestURL = `/teach/api_static/trains/${trainId}.json`;
|
|
19058
|
+
const { data } = await this.request.cdn.cdnAPI.get(requestURL);
|
|
19059
|
+
return data;
|
|
19060
|
+
} catch (_2) {
|
|
19061
|
+
return {};
|
|
19062
|
+
}
|
|
19063
|
+
});
|
|
19064
|
+
const { request } = props;
|
|
19065
|
+
this.request = request;
|
|
19066
|
+
}
|
|
19067
|
+
}
|
|
19068
|
+
class SiteConfig {
|
|
19069
|
+
constructor(props) {
|
|
19070
|
+
__publicField(this, "request");
|
|
19071
|
+
__publicField(this, "config");
|
|
19072
|
+
__publicField(this, "getSiteConfig", memoize$1(
|
|
19073
|
+
async () => {
|
|
19074
|
+
try {
|
|
19075
|
+
const { data } = await this.request.siteConfig.siteConfigAPI.get("/web_config.json");
|
|
19076
|
+
return data;
|
|
19077
|
+
} catch {
|
|
19078
|
+
return {};
|
|
19079
|
+
}
|
|
19080
|
+
},
|
|
19081
|
+
() => "web_config"
|
|
19082
|
+
));
|
|
19083
|
+
__publicField(this, "getAreaSites", memoize$1(
|
|
19084
|
+
async () => {
|
|
19085
|
+
const requestURL = `/${this.config.serviceName.site}/sites/sitelist.json`;
|
|
19086
|
+
const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
|
|
19087
|
+
return data;
|
|
19088
|
+
},
|
|
19089
|
+
() => "AreaSites"
|
|
19090
|
+
));
|
|
19091
|
+
__publicField(this, "getSiteCode", async () => {
|
|
19092
|
+
let siteCode = window.location.pathname.split("/")[1];
|
|
19093
|
+
const skipAreaSiteList = window.location.search.includes("_skip_area_sitelist=1") || window.isPreview;
|
|
19094
|
+
if (skipAreaSiteList) {
|
|
19095
|
+
return siteCode;
|
|
19096
|
+
}
|
|
19097
|
+
const areaSites = await this.getAreaSites();
|
|
19098
|
+
let areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
|
|
19099
|
+
if (areaSite) {
|
|
19100
|
+
return areaSite.code;
|
|
19101
|
+
}
|
|
19102
|
+
siteCode = window.location.hostname.split(".")[0];
|
|
19103
|
+
areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
|
|
19104
|
+
if (areaSite) {
|
|
19105
|
+
return areaSite.code;
|
|
19106
|
+
}
|
|
19107
|
+
return this.config.defaultAreaSite;
|
|
19108
|
+
});
|
|
19109
|
+
__publicField(this, "getSiteInfo", async (siteCode) => {
|
|
19110
|
+
const _siteCode = siteCode || await this.getSiteCode();
|
|
19111
|
+
const requestURL = `/${this.config.serviceName.site}/sites/${_siteCode}/site.json`;
|
|
19112
|
+
const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
|
|
19113
|
+
data.isHn = data.code === "hn";
|
|
19114
|
+
return data;
|
|
19115
|
+
});
|
|
19116
|
+
const { request, config: config2 } = props;
|
|
19117
|
+
this.request = request;
|
|
19118
|
+
this.config = config2;
|
|
19119
|
+
}
|
|
19120
|
+
}
|
|
19121
|
+
function converToTag(node) {
|
|
19122
|
+
return {
|
|
19123
|
+
tag_group_code: node.code,
|
|
19124
|
+
tag_group_name: node.next_level_name,
|
|
19125
|
+
tags: node.children.length === 0 ? [] : node.children.map((n2) => ({
|
|
19126
|
+
tag_name: n2.title,
|
|
19127
|
+
tag_id: n2.id,
|
|
19128
|
+
tag_code: n2.code,
|
|
19129
|
+
children: [converToTag(n2)]
|
|
19130
|
+
}))
|
|
19131
|
+
};
|
|
19132
|
+
}
|
|
19133
|
+
class Library {
|
|
19134
|
+
constructor(props) {
|
|
19135
|
+
__publicField(this, "request");
|
|
19136
|
+
__publicField(this, "config");
|
|
19137
|
+
__publicField(this, "getLibraryDynamicData", async ({ libraryId, sdpOrgId }) => {
|
|
19138
|
+
const getData = async ({ pageNo: pageNo2, pageSize: pageSize2 }) => {
|
|
19139
|
+
const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
|
|
19140
|
+
`/v1/libraries/${libraryId}/contents/actions/search/adapter`,
|
|
19141
|
+
{
|
|
19142
|
+
params: {
|
|
19143
|
+
page_no: pageNo2,
|
|
19144
|
+
page_size: pageSize2,
|
|
19145
|
+
sort_type: 3
|
|
19146
|
+
},
|
|
19147
|
+
headers: {
|
|
19148
|
+
"sdp-org-id": sdpOrgId
|
|
19149
|
+
}
|
|
19150
|
+
}
|
|
19151
|
+
);
|
|
19152
|
+
return data;
|
|
19153
|
+
};
|
|
19154
|
+
let pageNo = 0;
|
|
19155
|
+
const pageSize = 20;
|
|
19156
|
+
const libraryData = await getData({ pageNo, pageSize });
|
|
19157
|
+
const { total = 0 } = libraryData || {};
|
|
19158
|
+
const pageCount = Math.ceil(total / pageSize);
|
|
19159
|
+
let allData = libraryData.items;
|
|
19160
|
+
for (let i = 1; i < pageCount; i++) {
|
|
19161
|
+
pageNo = i;
|
|
19162
|
+
const data = await getData({ pageNo, pageSize });
|
|
19163
|
+
allData = allData.concat(data.items);
|
|
19164
|
+
}
|
|
19165
|
+
return allData;
|
|
19166
|
+
});
|
|
19167
|
+
__publicField(this, "getRequestURL", async ({ apiURL, language = "zh-CN", serviceName: serviceName2, sdpOrgId, sdpAppId }) => {
|
|
19168
|
+
const component = "elearning_library";
|
|
19169
|
+
const [urlPath, qs] = apiURL.split("?");
|
|
19170
|
+
const hashCode = await sha256(`${urlPath}?${qs}`);
|
|
19171
|
+
const hashPath = `${urlPath}/${hashCode}.json`;
|
|
19172
|
+
return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
|
|
19173
|
+
});
|
|
19174
|
+
/* 获取所有内容库*/
|
|
19175
|
+
__publicField(this, "getLibraryContentListAll", memoize$1(
|
|
19176
|
+
async ({ libraryId, sdpOrgId, sdpAppId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
|
|
19177
|
+
if (!libraryId) {
|
|
19178
|
+
return [];
|
|
19179
|
+
}
|
|
19180
|
+
if (window.isPreview) {
|
|
19181
|
+
try {
|
|
19182
|
+
const dynamicData = await this.getLibraryDynamicData({ libraryId, sdpOrgId });
|
|
19183
|
+
return dynamicData;
|
|
19184
|
+
} catch (e2) {
|
|
19185
|
+
}
|
|
19186
|
+
}
|
|
19187
|
+
const requestURL = await this.getRequestURL({
|
|
19188
|
+
apiURL: `/v1/libraries/${libraryId}/contents/actions/full/adapter?sort_type=3`,
|
|
19189
|
+
serviceName: serviceName2,
|
|
19190
|
+
sdpAppId,
|
|
19191
|
+
sdpOrgId
|
|
19192
|
+
});
|
|
19193
|
+
const { data } = await api2.get(requestURL);
|
|
19194
|
+
if (data.files.length) {
|
|
19195
|
+
const pageDataArray = await Promise.all(
|
|
19196
|
+
data.files.map(async (fileUrl) => {
|
|
19197
|
+
const { data: result } = await api2.get(fileUrl);
|
|
19198
|
+
return result;
|
|
19199
|
+
})
|
|
19200
|
+
);
|
|
19201
|
+
let allData = [];
|
|
19202
|
+
pageDataArray.forEach((pageData) => {
|
|
19203
|
+
allData = allData.concat(pageData);
|
|
19204
|
+
});
|
|
19205
|
+
return allData;
|
|
19206
|
+
} else {
|
|
19207
|
+
return [];
|
|
19208
|
+
}
|
|
19209
|
+
},
|
|
19210
|
+
({ libraryId, extraParams }) => `LibraryContentListAll_${libraryId}_${extraParams}`
|
|
19211
|
+
));
|
|
19212
|
+
/* 获取内容库所有资源 */
|
|
19213
|
+
__publicField(this, "getLibraryContentByUnitId", async ({ libraryId, unitId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 }) => {
|
|
19214
|
+
if (!libraryId || !unitId) {
|
|
19215
|
+
return {};
|
|
19216
|
+
}
|
|
19217
|
+
const data = await this.getLibraryContentListAll({
|
|
19218
|
+
libraryId,
|
|
19219
|
+
sdpAppId,
|
|
19220
|
+
sdpOrgId,
|
|
19221
|
+
serviceName: serviceName2,
|
|
19222
|
+
api: api2
|
|
19223
|
+
});
|
|
19224
|
+
return data.find((item) => item.unit_id === unitId) || {};
|
|
19225
|
+
});
|
|
19226
|
+
__publicField(this, "getDynamicCatalogs", async ({ libraryId, sdpOrgId }) => {
|
|
19227
|
+
const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
|
|
19228
|
+
`/v1/catalogs/libraries/${libraryId}`,
|
|
19229
|
+
{
|
|
19230
|
+
params: {
|
|
19231
|
+
all: true
|
|
19232
|
+
},
|
|
19233
|
+
headers: {
|
|
19234
|
+
"sdp-org-id": sdpOrgId ? sdpOrgId ?? "" : ""
|
|
19235
|
+
}
|
|
19236
|
+
}
|
|
19237
|
+
);
|
|
19238
|
+
return data;
|
|
19239
|
+
});
|
|
19240
|
+
/* 获取内容库所有标签 */
|
|
19241
|
+
__publicField(this, "getLibraryCatalogs", memoize$1(
|
|
19242
|
+
async ({ libraryId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
|
|
19243
|
+
if (!libraryId) {
|
|
19244
|
+
return [];
|
|
19245
|
+
}
|
|
19246
|
+
const requestURL = await this.getRequestURL({
|
|
19247
|
+
apiURL: `/v1/catalogs/libraries/${libraryId}?all=true`,
|
|
19248
|
+
serviceName: serviceName2,
|
|
19249
|
+
sdpAppId,
|
|
19250
|
+
sdpOrgId
|
|
19251
|
+
});
|
|
19252
|
+
try {
|
|
19253
|
+
let data;
|
|
19254
|
+
if (window.isPreview) {
|
|
19255
|
+
try {
|
|
19256
|
+
data = await this.getDynamicCatalogs(libraryId);
|
|
19257
|
+
} catch (e2) {
|
|
19258
|
+
}
|
|
19259
|
+
}
|
|
19260
|
+
if (!data) {
|
|
19261
|
+
const response = await api2.get(requestURL);
|
|
19262
|
+
data = response.data;
|
|
19263
|
+
}
|
|
19264
|
+
if (data) {
|
|
19265
|
+
const root2 = converToTag(data);
|
|
19266
|
+
return root2;
|
|
19267
|
+
}
|
|
19268
|
+
return {};
|
|
19269
|
+
} catch (e2) {
|
|
19270
|
+
console.error(e2);
|
|
19271
|
+
return {};
|
|
19272
|
+
}
|
|
19273
|
+
},
|
|
19274
|
+
({ libraryId }) => `LibraryCatalogs_${libraryId}`
|
|
19275
|
+
));
|
|
19276
|
+
const { request, config: config2 } = props;
|
|
19277
|
+
this.request = request;
|
|
19278
|
+
this.config = config2;
|
|
19279
|
+
}
|
|
19280
|
+
}
|
|
18439
19281
|
const _Service = class _Service {
|
|
18440
19282
|
constructor(props) {
|
|
18441
19283
|
__publicField(this, "env");
|
|
@@ -18449,10 +19291,12 @@ const _Service = class _Service {
|
|
|
18449
19291
|
__publicField(this, "recommend");
|
|
18450
19292
|
// 推荐相关接口
|
|
18451
19293
|
__publicField(this, "sdpAppId");
|
|
19294
|
+
__publicField(this, "config");
|
|
18452
19295
|
var _a2, _b2;
|
|
18453
19296
|
const { uc } = props;
|
|
18454
19297
|
this.uc = uc;
|
|
18455
19298
|
this.env = (_a2 = uc.options) == null ? void 0 : _a2.env;
|
|
19299
|
+
this.config = config[this.env];
|
|
18456
19300
|
this.sdpAppId = (_b2 = uc.options) == null ? void 0 : _b2.sdpAppId;
|
|
18457
19301
|
this.rawAPI = api;
|
|
18458
19302
|
this.init();
|
|
@@ -18469,43 +19313,73 @@ const _Service = class _Service {
|
|
|
18469
19313
|
this.uc = ucInstance;
|
|
18470
19314
|
this.init();
|
|
18471
19315
|
}
|
|
19316
|
+
initSingleRequest(requestFn) {
|
|
19317
|
+
return requestFn({ uc: this.uc, env: this.env });
|
|
19318
|
+
}
|
|
18472
19319
|
init() {
|
|
18473
|
-
|
|
19320
|
+
const requests = {
|
|
18474
19321
|
recommend: {
|
|
18475
|
-
recommendAPIV2
|
|
19322
|
+
recommendAPIV2
|
|
18476
19323
|
},
|
|
18477
19324
|
xProxy: {
|
|
18478
|
-
xProxyCloudAPI
|
|
18479
|
-
xProxyAssessmentAPI
|
|
18480
|
-
xProxyRecommendAPI
|
|
19325
|
+
xProxyCloudAPI,
|
|
19326
|
+
xProxyAssessmentAPI,
|
|
19327
|
+
xProxyRecommendAPI
|
|
18481
19328
|
},
|
|
18482
19329
|
assessment: {
|
|
18483
|
-
assessmentAPI
|
|
19330
|
+
assessmentAPI
|
|
18484
19331
|
},
|
|
18485
19332
|
xCloudWeb: {
|
|
18486
|
-
xCloudWebAPI
|
|
19333
|
+
xCloudWebAPI
|
|
18487
19334
|
},
|
|
18488
19335
|
xFeedback: {
|
|
18489
|
-
xFeddbackCommonAPI
|
|
18490
|
-
xFeddbackAuthAPI
|
|
19336
|
+
xFeddbackCommonAPI,
|
|
19337
|
+
xFeddbackAuthAPI
|
|
18491
19338
|
},
|
|
18492
19339
|
favorite: {
|
|
18493
|
-
favoriteCommonAPI
|
|
18494
|
-
favoriteAuthAPI
|
|
18495
|
-
favoriteAuthAPIWithError
|
|
19340
|
+
favoriteCommonAPI,
|
|
19341
|
+
favoriteAuthAPI,
|
|
19342
|
+
favoriteAuthAPIWithError
|
|
18496
19343
|
},
|
|
18497
19344
|
xStudyRecord: {
|
|
18498
|
-
xStudyRecordAPI
|
|
19345
|
+
xStudyRecordAPI
|
|
19346
|
+
},
|
|
19347
|
+
cdn: {
|
|
19348
|
+
cdnAPI,
|
|
19349
|
+
cdnBdcsFileAPI,
|
|
19350
|
+
cdnSFileAPI
|
|
19351
|
+
},
|
|
19352
|
+
siteConfig: {
|
|
19353
|
+
siteConfigAPI
|
|
19354
|
+
},
|
|
19355
|
+
elearningLibrary: {
|
|
19356
|
+
eLearningLibraryAPI
|
|
18499
19357
|
}
|
|
18500
19358
|
};
|
|
18501
|
-
this.
|
|
18502
|
-
|
|
18503
|
-
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
|
|
19359
|
+
this.request = {};
|
|
19360
|
+
Object.keys(requests).forEach((key) => {
|
|
19361
|
+
this.request[key] = {};
|
|
19362
|
+
Object.keys(requests[key]).forEach((subKey) => {
|
|
19363
|
+
this.request[key][subKey] = this.initSingleRequest(requests[key][subKey]);
|
|
19364
|
+
});
|
|
19365
|
+
});
|
|
19366
|
+
const services = {
|
|
19367
|
+
stat: Stat,
|
|
19368
|
+
assessment: Assessment,
|
|
19369
|
+
like: Like,
|
|
19370
|
+
feedback: Feedback,
|
|
19371
|
+
favorite: Favorite,
|
|
19372
|
+
studyRecord: StudyRecord,
|
|
19373
|
+
tCourse: TCourse,
|
|
19374
|
+
channel: Channel,
|
|
19375
|
+
elearningTrain: ElearningTrain,
|
|
19376
|
+
siteConfig: SiteConfig,
|
|
19377
|
+
library: Library
|
|
18508
19378
|
};
|
|
19379
|
+
this.service = {};
|
|
19380
|
+
Object.keys(services).forEach((key) => {
|
|
19381
|
+
this.service[key] = new services[key]({ request: this.request, config: this.config });
|
|
19382
|
+
});
|
|
18509
19383
|
}
|
|
18510
19384
|
};
|
|
18511
19385
|
__publicField(_Service, "instance");
|