react-toolkits 2.14.0 → 2.14.1
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.js +12 -9
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -665,16 +665,19 @@ var init_hooks3 = __esm({
|
|
|
665
665
|
"src/components/layout/hooks.ts"() {
|
|
666
666
|
init_toolkitsProvider();
|
|
667
667
|
useGames = () => {
|
|
668
|
-
const { axios: axios2, gameApiV2 } = useToolkitsStore((s) => s);
|
|
669
|
-
return useSWR6(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
668
|
+
const { axios: axios2, gameApiV2, permissionVersion } = useToolkitsStore((s) => s);
|
|
669
|
+
return useSWR6(
|
|
670
|
+
permissionVersion !== "v1" /* V1 */ ? gameApiV2 ? "/api/game/list" : "/api/usystem/game/all" : null,
|
|
671
|
+
async (url4) => {
|
|
672
|
+
if (gameApiV2) {
|
|
673
|
+
const response = await axios2(url4);
|
|
674
|
+
return response.data.data.list ?? [];
|
|
675
|
+
} else {
|
|
676
|
+
const response = await axios2(url4);
|
|
677
|
+
return response.data.data ?? [];
|
|
678
|
+
}
|
|
676
679
|
}
|
|
677
|
-
|
|
680
|
+
);
|
|
678
681
|
};
|
|
679
682
|
useFindGame = (id2) => {
|
|
680
683
|
const { data } = useGames();
|