react-toolkits 2.9.13 → 2.9.14
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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +11 -3
- package/lib/index.js +108 -79
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -205,13 +205,13 @@ interface NavMenuProps {
|
|
|
205
205
|
declare const NavMenu: react.NamedExoticComponent<NavMenuProps>;
|
|
206
206
|
|
|
207
207
|
type Area = 'all' | 'cn' | 'global';
|
|
208
|
-
type
|
|
208
|
+
type ScreenOrientation = 0 | 1;
|
|
209
209
|
interface Game {
|
|
210
210
|
id: number;
|
|
211
211
|
game_id: string | number;
|
|
212
212
|
game_group: string;
|
|
213
213
|
name: string;
|
|
214
|
-
screen_type:
|
|
214
|
+
screen_type: ScreenOrientation;
|
|
215
215
|
area: Area;
|
|
216
216
|
icon: string;
|
|
217
217
|
auth: string;
|
|
@@ -343,6 +343,11 @@ interface QueryListState {
|
|
|
343
343
|
}
|
|
344
344
|
declare const useQueryListStore: zustand.UseBoundStore<zustand.StoreApi<QueryListState>>;
|
|
345
345
|
|
|
346
|
+
interface RequireGameProps extends PropsWithChildren {
|
|
347
|
+
hideGameSelect?: boolean;
|
|
348
|
+
}
|
|
349
|
+
declare const RequireGame: FC<RequireGameProps>;
|
|
350
|
+
|
|
346
351
|
interface RequirePermissionProps {
|
|
347
352
|
code: string;
|
|
348
353
|
isGlobal?: boolean;
|
|
@@ -354,6 +359,9 @@ interface UserWidgetProps {
|
|
|
354
359
|
}
|
|
355
360
|
declare const UserWidget: FC<UserWidgetProps>;
|
|
356
361
|
|
|
362
|
+
declare const SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
|
|
363
|
+
declare const APP_ID_HEADER_NAME = "App-ID";
|
|
364
|
+
|
|
357
365
|
interface ModalState {
|
|
358
366
|
open: Map<number, boolean>;
|
|
359
367
|
getOpen: (uuid: number) => boolean;
|
|
@@ -454,4 +462,4 @@ declare const SignIn: FC<SignInProps>;
|
|
|
454
462
|
|
|
455
463
|
declare const mixedStorage: StateStorage;
|
|
456
464
|
|
|
457
|
-
export { ContextProvider, type ContextState, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FilterFormWrapper, type FilterFormWrapperProps, type Game, Highlight, type HighlightProps, InfiniteList, type InfiniteListProps, Layout, type LayoutState, NavMenu, type NavMenuItem, NotFound, OperationLogList, PermissionButton, type PermissionButtonProps, QueryList, QueryListAction, type QueryListProps, type QueryListRef, RequestError, type RequestOptions, type RequestResponse, RequirePermission, type RequirePermissionProps, SignIn, type TokenState, type UseFormModalProps, type UseModalOperation, type UseModalProps, UserWidget, type UserWidgetProps, contextStore, mixedStorage, _default as permissionRoutes, request, useFormModal, useGameStore, useLayoutStore, useModal, useModalStore, usePermission, usePermissions, useQueryListStore, useTokenStore, useTokenValidation, useToolkitsContext };
|
|
465
|
+
export { APP_ID_HEADER_NAME, ContextProvider, type ContextState, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FilterFormWrapper, type FilterFormWrapperProps, type Game, Highlight, type HighlightProps, InfiniteList, type InfiniteListProps, Layout, type LayoutState, NavMenu, type NavMenuItem, NotFound, OperationLogList, PermissionButton, type PermissionButtonProps, QueryList, QueryListAction, type QueryListProps, type QueryListRef, RequestError, type RequestOptions, type RequestResponse, RequireGame, RequirePermission, type RequirePermissionProps, SSO_URL, SignIn, type TokenState, type UseFormModalProps, type UseModalOperation, type UseModalProps, UserWidget, type UserWidgetProps, contextStore, mixedStorage, _default as permissionRoutes, request, useFormModal, useGameStore, useLayoutStore, useModal, useModalStore, usePermission, usePermissions, useQueryListStore, useTokenStore, useTokenValidation, useToolkitsContext };
|
package/lib/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useStore, create, createStore } from 'zustand';
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { pick, has, template, get, isEqual } from 'lodash-es';
|
|
5
5
|
import * as Antd2 from 'antd';
|
|
6
|
-
import { Modal, Form, theme, Space, Input, Tag, Typography, Spin, Result, Table, Button, Card, Select, Alert, Divider, Menu, App, Row, Col, Breadcrumb, Skeleton, Descriptions, Dropdown, Tooltip,
|
|
6
|
+
import { Modal, Form, theme, Space, Input, Tag, Typography, Spin, Result, Table, Button, Card, Select, Alert, Divider, Menu, App, Row, Col, Breadcrumb, Skeleton, Descriptions, Empty, Dropdown, Tooltip, Collapse, Checkbox } from 'antd';
|
|
7
7
|
import { flushSync } from 'react-dom';
|
|
8
8
|
import { createRoot } from 'react-dom/client';
|
|
9
9
|
import logoUrl from './logo-L6MFCL6M.png';
|
|
@@ -275,6 +275,15 @@ var init_highlight = __esm({
|
|
|
275
275
|
init_Highlight();
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
|
+
|
|
279
|
+
// src/constants.ts
|
|
280
|
+
var SSO_URL, APP_ID_HEADER_NAME;
|
|
281
|
+
var init_constants = __esm({
|
|
282
|
+
"src/constants.ts"() {
|
|
283
|
+
SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
|
|
284
|
+
APP_ID_HEADER_NAME = "App-ID";
|
|
285
|
+
}
|
|
286
|
+
});
|
|
278
287
|
var Logo, Logo_default;
|
|
279
288
|
var init_Logo = __esm({
|
|
280
289
|
"src/components/logo/Logo.tsx"() {
|
|
@@ -389,7 +398,7 @@ var init_NavMenu = __esm({
|
|
|
389
398
|
const location = useLocation();
|
|
390
399
|
const flattenItems = useMemo(() => flatItems(items ?? []), [items]);
|
|
391
400
|
const codes = useMemo(() => flattenItems.map((item) => item.code).filter(Boolean), [flattenItems]);
|
|
392
|
-
const { data: permissions, isLoading } = usePermissions(codes, { headers: {
|
|
401
|
+
const { data: permissions, isLoading } = usePermissions(codes, { headers: { APP_ID_HEADER_NAME: "global" } });
|
|
393
402
|
const internalItems = useMemo(() => transformItems(items ?? [], permissions), [items, permissions]);
|
|
394
403
|
const { openKeys, selectedKeys, setOpenKeys, setSelectedKeys } = useNavStore();
|
|
395
404
|
const onOpenChange = useCallback(
|
|
@@ -438,6 +447,47 @@ var init_navMenu = __esm({
|
|
|
438
447
|
init_NavMenu();
|
|
439
448
|
}
|
|
440
449
|
});
|
|
450
|
+
var Spin2, RequireGame, RequireGame_default;
|
|
451
|
+
var init_RequireGame = __esm({
|
|
452
|
+
"src/components/requireGame/RequireGame.tsx"() {
|
|
453
|
+
init_contextProvider();
|
|
454
|
+
init_layout();
|
|
455
|
+
init_locale();
|
|
456
|
+
({ Spin: Spin2 } = Antd2);
|
|
457
|
+
RequireGame = (props) => {
|
|
458
|
+
const { hideGameSelect, children } = props;
|
|
459
|
+
const usePermissionApiV2 = useToolkitsContext((state) => state.usePermissionApiV2);
|
|
460
|
+
const { game, isLoading } = useGameStore();
|
|
461
|
+
const { t } = useTranslation();
|
|
462
|
+
if (isLoading) {
|
|
463
|
+
return /* @__PURE__ */ jsx(
|
|
464
|
+
"div",
|
|
465
|
+
{
|
|
466
|
+
style: {
|
|
467
|
+
display: "flex",
|
|
468
|
+
justifyContent: "center",
|
|
469
|
+
alignItems: "center",
|
|
470
|
+
height: 200
|
|
471
|
+
},
|
|
472
|
+
children: /* @__PURE__ */ jsx(Spin2, {})
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
if (usePermissionApiV2 && !hideGameSelect && !game) {
|
|
477
|
+
return /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description: t("RequireGame.description") });
|
|
478
|
+
}
|
|
479
|
+
return children;
|
|
480
|
+
};
|
|
481
|
+
RequireGame_default = RequireGame;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
// src/components/requireGame/index.ts
|
|
486
|
+
var init_requireGame = __esm({
|
|
487
|
+
"src/components/requireGame/index.ts"() {
|
|
488
|
+
init_RequireGame();
|
|
489
|
+
}
|
|
490
|
+
});
|
|
441
491
|
function useTokenValidation(options) {
|
|
442
492
|
const usePermissionApiV2 = useToolkitsContext((state) => state.usePermissionApiV2);
|
|
443
493
|
return useSWRImmutable(
|
|
@@ -447,7 +497,7 @@ function useTokenValidation(options) {
|
|
|
447
497
|
body: {
|
|
448
498
|
permissions: ["100001"]
|
|
449
499
|
},
|
|
450
|
-
headers: {
|
|
500
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
451
501
|
})
|
|
452
502
|
);
|
|
453
503
|
}
|
|
@@ -455,6 +505,7 @@ var useTokenStore;
|
|
|
455
505
|
var init_token = __esm({
|
|
456
506
|
"src/hooks/token.ts"() {
|
|
457
507
|
init_contextProvider();
|
|
508
|
+
init_constants();
|
|
458
509
|
init_request();
|
|
459
510
|
useTokenStore = create()(
|
|
460
511
|
persist(
|
|
@@ -588,21 +639,22 @@ var init_stores2 = __esm({
|
|
|
588
639
|
games: [],
|
|
589
640
|
async refetchGames(apiV2) {
|
|
590
641
|
if (!get2().isLoading) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
set({
|
|
602
|
-
initialized: true,
|
|
603
|
-
isLoading: false
|
|
604
|
-
});
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
try {
|
|
645
|
+
set({ isLoading: true });
|
|
646
|
+
if (!apiV2) {
|
|
647
|
+
const response = await request("/api/usystem/game/all");
|
|
648
|
+
set({ games: response.data ?? [] });
|
|
649
|
+
} else {
|
|
650
|
+
const response = await request("/api/game/list");
|
|
651
|
+
set({ games: response.data?.list ?? [] });
|
|
605
652
|
}
|
|
653
|
+
} finally {
|
|
654
|
+
set({
|
|
655
|
+
initialized: true,
|
|
656
|
+
isLoading: false
|
|
657
|
+
});
|
|
606
658
|
}
|
|
607
659
|
}
|
|
608
660
|
}),
|
|
@@ -657,39 +709,6 @@ var init_GameSelect = __esm({
|
|
|
657
709
|
GameSelect_default = GameSelect;
|
|
658
710
|
}
|
|
659
711
|
});
|
|
660
|
-
var Spin2, RequireGame, RequireGame_default;
|
|
661
|
-
var init_RequireGame = __esm({
|
|
662
|
-
"src/components/layout/RequireGame.tsx"() {
|
|
663
|
-
init_contextProvider();
|
|
664
|
-
init_locale();
|
|
665
|
-
init_stores2();
|
|
666
|
-
({ Spin: Spin2 } = Antd2);
|
|
667
|
-
RequireGame = (props) => {
|
|
668
|
-
const { hideGameSelect, children } = props;
|
|
669
|
-
const usePermissionApiV2 = useToolkitsContext((state) => state.usePermissionApiV2);
|
|
670
|
-
const { game, isLoading } = useGameStore();
|
|
671
|
-
const { t } = useTranslation();
|
|
672
|
-
if (isLoading) {
|
|
673
|
-
return /* @__PURE__ */ jsx(
|
|
674
|
-
Spin2,
|
|
675
|
-
{
|
|
676
|
-
style: {
|
|
677
|
-
display: "flex",
|
|
678
|
-
justifyContent: "center",
|
|
679
|
-
alignItems: "center",
|
|
680
|
-
height: 200
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
);
|
|
684
|
-
}
|
|
685
|
-
if (usePermissionApiV2 && !hideGameSelect && !game) {
|
|
686
|
-
return /* @__PURE__ */ jsx(Empty, { image: Empty.PRESENTED_IMAGE_SIMPLE, description: t("RequireGame.description") });
|
|
687
|
-
}
|
|
688
|
-
return children;
|
|
689
|
-
};
|
|
690
|
-
RequireGame_default = RequireGame;
|
|
691
|
-
}
|
|
692
|
-
});
|
|
693
712
|
|
|
694
713
|
// src/components/layout/style.css
|
|
695
714
|
var init_style = __esm({
|
|
@@ -702,9 +721,9 @@ var init_Layout = __esm({
|
|
|
702
721
|
init_contextProvider();
|
|
703
722
|
init_logo();
|
|
704
723
|
init_navMenu();
|
|
724
|
+
init_requireGame();
|
|
705
725
|
init_userWidget();
|
|
706
726
|
init_GameSelect();
|
|
707
|
-
init_RequireGame();
|
|
708
727
|
init_stores2();
|
|
709
728
|
init_style();
|
|
710
729
|
({ Spin: Spin3, theme: theme3 } = Antd2);
|
|
@@ -849,10 +868,10 @@ async function request(url, opts = {}) {
|
|
|
849
868
|
if (token) {
|
|
850
869
|
headers.set("Authorization", `Bearer ${token}`);
|
|
851
870
|
}
|
|
852
|
-
if (!headers.has(
|
|
871
|
+
if (!headers.has(APP_ID_HEADER_NAME) && contextStore.getState().usePermissionApiV2) {
|
|
853
872
|
const game = useGameStore.getState().game;
|
|
854
873
|
if (game) {
|
|
855
|
-
headers.set(
|
|
874
|
+
headers.set(APP_ID_HEADER_NAME, String(game.game_id ?? game.id));
|
|
856
875
|
}
|
|
857
876
|
}
|
|
858
877
|
if (responseType === "blob") {
|
|
@@ -904,6 +923,7 @@ var init_request = __esm({
|
|
|
904
923
|
"src/utils/request.ts"() {
|
|
905
924
|
init_contextProvider();
|
|
906
925
|
init_layout();
|
|
926
|
+
init_constants();
|
|
907
927
|
init_token();
|
|
908
928
|
RequestError = class extends Error {
|
|
909
929
|
constructor(opts) {
|
|
@@ -974,11 +994,14 @@ var init_permission = __esm({
|
|
|
974
994
|
var PermissionButton, PermissionButton_default;
|
|
975
995
|
var init_PermissionButton = __esm({
|
|
976
996
|
"src/components/permissionButton/PermissionButton.tsx"() {
|
|
997
|
+
init_constants();
|
|
977
998
|
init_permission();
|
|
978
999
|
init_locale();
|
|
979
1000
|
PermissionButton = (props) => {
|
|
980
1001
|
const { children, code, showLoading, isGlobal, disabled, ...restProps } = props;
|
|
981
|
-
const { data, isLoading } = usePermissions(Array.isArray(code) ? code : [code], {
|
|
1002
|
+
const { data, isLoading } = usePermissions(Array.isArray(code) ? code : [code], {
|
|
1003
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1004
|
+
});
|
|
982
1005
|
const { t } = useTranslation();
|
|
983
1006
|
if (isLoading) {
|
|
984
1007
|
return /* @__PURE__ */ jsx(Button, { loading: showLoading, disabled: !showLoading, ...restProps, children });
|
|
@@ -1031,6 +1054,7 @@ var init_stores3 = __esm({
|
|
|
1031
1054
|
var QueryListAction, InternalQueryList, QueryList, QueryList_default;
|
|
1032
1055
|
var init_QueryList = __esm({
|
|
1033
1056
|
"src/components/queryList/QueryList.tsx"() {
|
|
1057
|
+
init_constants();
|
|
1034
1058
|
init_permission();
|
|
1035
1059
|
init_request();
|
|
1036
1060
|
init_contextProvider();
|
|
@@ -1079,7 +1103,7 @@ var init_QueryList = __esm({
|
|
|
1079
1103
|
const { t } = useTranslation();
|
|
1080
1104
|
const [_form] = Form.useForm(form);
|
|
1081
1105
|
const { accessible, isLoading } = usePermission(code, {
|
|
1082
|
-
headers: isGlobal ? {
|
|
1106
|
+
headers: isGlobal ? { [APP_ID_HEADER_NAME]: "global" } : void 0
|
|
1083
1107
|
});
|
|
1084
1108
|
const action = useRef(3 /* Init */);
|
|
1085
1109
|
const { game } = useGameStore();
|
|
@@ -1105,9 +1129,9 @@ var init_QueryList = __esm({
|
|
|
1105
1129
|
const newHeaders = new Headers(headers);
|
|
1106
1130
|
if (usePermissionApiV2) {
|
|
1107
1131
|
if (isGlobal) {
|
|
1108
|
-
newHeaders.set(
|
|
1132
|
+
newHeaders.set(APP_ID_HEADER_NAME, "global");
|
|
1109
1133
|
} else if (game) {
|
|
1110
|
-
newHeaders.set(
|
|
1134
|
+
newHeaders.set(APP_ID_HEADER_NAME, String(game.id));
|
|
1111
1135
|
}
|
|
1112
1136
|
}
|
|
1113
1137
|
return newHeaders;
|
|
@@ -1375,27 +1399,27 @@ var init_formModal = __esm({
|
|
|
1375
1399
|
function useAllPermissions() {
|
|
1376
1400
|
return useSWR3(
|
|
1377
1401
|
"/api/usystem/user/allPermssions",
|
|
1378
|
-
(url) => request(url, { headers: {
|
|
1402
|
+
(url) => request(url, { headers: { [APP_ID_HEADER_NAME]: "global" } }).then((response) => response.data)
|
|
1379
1403
|
);
|
|
1380
1404
|
}
|
|
1381
1405
|
function useAllPermissionsV2() {
|
|
1382
1406
|
return useSWR3(
|
|
1383
1407
|
"/api/usystem/user/allPermissionsV2",
|
|
1384
|
-
(url) => request(url, { headers: {
|
|
1408
|
+
(url) => request(url, { headers: { [APP_ID_HEADER_NAME]: "global" } }).then((response) => response.data)
|
|
1385
1409
|
);
|
|
1386
1410
|
}
|
|
1387
1411
|
function useAllRoles() {
|
|
1388
|
-
const { accessible } = usePermission("200005", { headers: {
|
|
1412
|
+
const { accessible } = usePermission("200005", { headers: { [APP_ID_HEADER_NAME]: "global" } });
|
|
1389
1413
|
return useSWR3(
|
|
1390
1414
|
accessible ? "/api/usystem/role/all" : null,
|
|
1391
|
-
(url) => request(url, { headers: {
|
|
1415
|
+
(url) => request(url, { headers: { [APP_ID_HEADER_NAME]: "global" } }).then((response) => response.data)
|
|
1392
1416
|
);
|
|
1393
1417
|
}
|
|
1394
1418
|
function useRole(name) {
|
|
1395
1419
|
const usePermissionApiV2 = useToolkitsContext((state) => state.usePermissionApiV2);
|
|
1396
1420
|
return useSWR3(
|
|
1397
1421
|
`/api/usystem/role/${usePermissionApiV2 ? "infoV2" : "info"}?name=${name}`,
|
|
1398
|
-
(url) => request(url, { headers: {
|
|
1422
|
+
(url) => request(url, { headers: { [APP_ID_HEADER_NAME]: "global" } }).then((response) => response.data)
|
|
1399
1423
|
);
|
|
1400
1424
|
}
|
|
1401
1425
|
function useCreateRole() {
|
|
@@ -1407,7 +1431,7 @@ function useCreateRole() {
|
|
|
1407
1431
|
}) => request(url, {
|
|
1408
1432
|
method: "post",
|
|
1409
1433
|
body: arg,
|
|
1410
|
-
headers: {
|
|
1434
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1411
1435
|
})
|
|
1412
1436
|
);
|
|
1413
1437
|
}
|
|
@@ -1420,7 +1444,7 @@ function useUpdateRole() {
|
|
|
1420
1444
|
}) => request(url, {
|
|
1421
1445
|
method: "post",
|
|
1422
1446
|
body: arg,
|
|
1423
|
-
headers: {
|
|
1447
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1424
1448
|
})
|
|
1425
1449
|
);
|
|
1426
1450
|
}
|
|
@@ -1432,7 +1456,7 @@ function useRemoveRole() {
|
|
|
1432
1456
|
}) => request(url, {
|
|
1433
1457
|
method: "post",
|
|
1434
1458
|
body: arg,
|
|
1435
|
-
headers: {
|
|
1459
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1436
1460
|
})
|
|
1437
1461
|
);
|
|
1438
1462
|
}
|
|
@@ -1444,7 +1468,7 @@ function useCreateUser() {
|
|
|
1444
1468
|
}) => request(url, {
|
|
1445
1469
|
method: "post",
|
|
1446
1470
|
body: arg,
|
|
1447
|
-
headers: {
|
|
1471
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1448
1472
|
})
|
|
1449
1473
|
);
|
|
1450
1474
|
}
|
|
@@ -1456,7 +1480,7 @@ function useUpdateUser() {
|
|
|
1456
1480
|
}) => request(url, {
|
|
1457
1481
|
method: "post",
|
|
1458
1482
|
body: arg,
|
|
1459
|
-
headers: {
|
|
1483
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1460
1484
|
})
|
|
1461
1485
|
);
|
|
1462
1486
|
}
|
|
@@ -1468,13 +1492,14 @@ function useRemoveUser() {
|
|
|
1468
1492
|
}) => request(url, {
|
|
1469
1493
|
method: "post",
|
|
1470
1494
|
body: arg,
|
|
1471
|
-
headers: {
|
|
1495
|
+
headers: { [APP_ID_HEADER_NAME]: "global" }
|
|
1472
1496
|
})
|
|
1473
1497
|
);
|
|
1474
1498
|
}
|
|
1475
1499
|
var init_hooks2 = __esm({
|
|
1476
1500
|
"src/features/permission/hooks/index.ts"() {
|
|
1477
1501
|
init_contextProvider();
|
|
1502
|
+
init_constants();
|
|
1478
1503
|
init_permission();
|
|
1479
1504
|
init_request();
|
|
1480
1505
|
}
|
|
@@ -1947,6 +1972,7 @@ var init_roleList = __esm({
|
|
|
1947
1972
|
init_permissionButton();
|
|
1948
1973
|
init_queryList();
|
|
1949
1974
|
init_stores3();
|
|
1975
|
+
init_constants();
|
|
1950
1976
|
init_permission2();
|
|
1951
1977
|
init_formModal();
|
|
1952
1978
|
init_permission();
|
|
@@ -2002,7 +2028,7 @@ var init_roleList = __esm({
|
|
|
2002
2028
|
});
|
|
2003
2029
|
};
|
|
2004
2030
|
RoleList = () => {
|
|
2005
|
-
const { accessible: viewable } = usePermission("200005", { headers: {
|
|
2031
|
+
const { accessible: viewable } = usePermission("200005", { headers: { [APP_ID_HEADER_NAME]: "global" } });
|
|
2006
2032
|
const { modal, message } = App.useApp();
|
|
2007
2033
|
const { t } = useTranslation();
|
|
2008
2034
|
const usePermissionApiV2 = useToolkitsContext((state) => state.usePermissionApiV2);
|
|
@@ -2013,7 +2039,7 @@ var init_roleList = __esm({
|
|
|
2013
2039
|
const handleUpdateBtnClick = async (record) => {
|
|
2014
2040
|
const { data: role } = await request(
|
|
2015
2041
|
`/api/usystem/role/info${usePermissionApiV2 ? "V2" : ""}?name=${record.name}`,
|
|
2016
|
-
{ headers: {
|
|
2042
|
+
{ headers: { [APP_ID_HEADER_NAME]: "global" } }
|
|
2017
2043
|
);
|
|
2018
2044
|
showUpdateModal({
|
|
2019
2045
|
initialValues: {
|
|
@@ -2345,6 +2371,7 @@ init_filterFormWrapper();
|
|
|
2345
2371
|
init_highlight();
|
|
2346
2372
|
|
|
2347
2373
|
// src/components/infiniteList/InfiniteList.tsx
|
|
2374
|
+
init_constants();
|
|
2348
2375
|
init_permission();
|
|
2349
2376
|
init_request();
|
|
2350
2377
|
init_contextProvider();
|
|
@@ -2383,9 +2410,9 @@ var InfiniteList = (props) => {
|
|
|
2383
2410
|
const newHeaders = new Headers(typeof headers === "function" ? headers(form) : headers);
|
|
2384
2411
|
if (usePermissionApiV2) {
|
|
2385
2412
|
if (isGlobal) {
|
|
2386
|
-
newHeaders.set(
|
|
2413
|
+
newHeaders.set(APP_ID_HEADER_NAME, "global");
|
|
2387
2414
|
} else if (game) {
|
|
2388
|
-
newHeaders.set(
|
|
2415
|
+
newHeaders.set(APP_ID_HEADER_NAME, String(game.id));
|
|
2389
2416
|
}
|
|
2390
2417
|
}
|
|
2391
2418
|
return newHeaders;
|
|
@@ -2497,13 +2524,18 @@ init_layout();
|
|
|
2497
2524
|
init_navMenu();
|
|
2498
2525
|
init_permissionButton();
|
|
2499
2526
|
init_queryList();
|
|
2527
|
+
init_requireGame();
|
|
2500
2528
|
|
|
2501
2529
|
// src/components/requirePermission/RequirePermission.tsx
|
|
2530
|
+
init_constants();
|
|
2502
2531
|
init_permission();
|
|
2503
2532
|
init_locale();
|
|
2504
2533
|
var RequirePermission = (props) => {
|
|
2505
2534
|
const { code, isGlobal, children } = props;
|
|
2506
|
-
const { accessible, isValidating } = usePermission(
|
|
2535
|
+
const { accessible, isValidating } = usePermission(
|
|
2536
|
+
code,
|
|
2537
|
+
isGlobal ? { headers: { [APP_ID_HEADER_NAME]: "global" } } : void 0
|
|
2538
|
+
);
|
|
2507
2539
|
const { t } = useTranslation();
|
|
2508
2540
|
if (isValidating) {
|
|
2509
2541
|
return /* @__PURE__ */ jsx(
|
|
@@ -2527,6 +2559,7 @@ var RequirePermission_default = RequirePermission;
|
|
|
2527
2559
|
|
|
2528
2560
|
// src/index.ts
|
|
2529
2561
|
init_userWidget();
|
|
2562
|
+
init_constants();
|
|
2530
2563
|
init_formModal();
|
|
2531
2564
|
init_modal();
|
|
2532
2565
|
init_permission();
|
|
@@ -2651,11 +2684,7 @@ var permission_default = /* @__PURE__ */ jsxs(Routes, { children: [
|
|
|
2651
2684
|
// src/pages/signIn/index.tsx
|
|
2652
2685
|
init_locale();
|
|
2653
2686
|
init_logo();
|
|
2654
|
-
|
|
2655
|
-
// src/constants.ts
|
|
2656
|
-
var SSO_URL = "https://idaas.ifunplus.cn/enduser/api/application/plugin_FunPlus/sso/v1";
|
|
2657
|
-
|
|
2658
|
-
// src/pages/signIn/index.tsx
|
|
2687
|
+
init_constants();
|
|
2659
2688
|
init_token();
|
|
2660
2689
|
init_request();
|
|
2661
2690
|
|
|
@@ -2717,6 +2746,6 @@ var signIn_default = SignIn;
|
|
|
2717
2746
|
init_request();
|
|
2718
2747
|
init_storage();
|
|
2719
2748
|
|
|
2720
|
-
export { Provider_default as ContextProvider, DynamicTags_default as DynamicTags, ExpandableParagraph_default as ExpandableParagraph, FilterFormWrapper_default as FilterFormWrapper, Highlight_default as Highlight, InfiniteList_default as InfiniteList, Layout_default as Layout, NavMenu_default as NavMenu, notFound_default as NotFound, operationLogList_default as OperationLogList, PermissionButton_default as PermissionButton, QueryList_default as QueryList, QueryListAction, RequestError, RequirePermission_default as RequirePermission, signIn_default as SignIn, UserWidget_default as UserWidget, contextStore, mixedStorage, permission_default as permissionRoutes, request, useFormModal, useGameStore, useLayoutStore, useModal, useModalStore, usePermission, usePermissions, useQueryListStore, useTokenStore, useTokenValidation, useToolkitsContext };
|
|
2749
|
+
export { APP_ID_HEADER_NAME, Provider_default as ContextProvider, DynamicTags_default as DynamicTags, ExpandableParagraph_default as ExpandableParagraph, FilterFormWrapper_default as FilterFormWrapper, Highlight_default as Highlight, InfiniteList_default as InfiniteList, Layout_default as Layout, NavMenu_default as NavMenu, notFound_default as NotFound, operationLogList_default as OperationLogList, PermissionButton_default as PermissionButton, QueryList_default as QueryList, QueryListAction, RequestError, RequireGame_default as RequireGame, RequirePermission_default as RequirePermission, SSO_URL, signIn_default as SignIn, UserWidget_default as UserWidget, contextStore, mixedStorage, permission_default as permissionRoutes, request, useFormModal, useGameStore, useLayoutStore, useModal, useModalStore, usePermission, usePermissions, useQueryListStore, useTokenStore, useTokenValidation, useToolkitsContext };
|
|
2721
2750
|
//# sourceMappingURL=index.js.map
|
|
2722
2751
|
//# sourceMappingURL=index.js.map
|