react-toolkits 2.13.30 → 2.13.31
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 +2 -10
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/lib/index.js
CHANGED
|
@@ -619,20 +619,12 @@ var init_highlight = __esm({
|
|
|
619
619
|
}
|
|
620
620
|
});
|
|
621
621
|
function usePermission(code, config) {
|
|
622
|
-
const { axios: axios2, permissionVersion
|
|
622
|
+
const { axios: axios2, permissionVersion } = useToolkitsStore((s) => s);
|
|
623
623
|
const url4 = permissionVersion !== "v1" /* V1 */ ? "/api/usystem/user/checkV2" : "/api/usystem/user/check";
|
|
624
624
|
const permissionCodes = typeof code !== "undefined" ? typeof code === "string" ? [code] : code : [];
|
|
625
625
|
const body = { permissions: permissionCodes };
|
|
626
|
-
const mergedConfig = {
|
|
627
|
-
...config,
|
|
628
|
-
headers: {
|
|
629
|
-
// FIXME: 在 QueryList 内,切换游戏的时有时不会触发查询
|
|
630
|
-
[APP_ID_HEADER]: gameId,
|
|
631
|
-
...config?.headers
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
626
|
const { data, ...rest } = useSWR6(
|
|
635
|
-
permissionCodes.length > 0 ? [url4, body,
|
|
627
|
+
permissionCodes.length > 0 ? [url4, body, config] : null,
|
|
636
628
|
(args) => axios2.post(...args).then((response) => response.data.data)
|
|
637
629
|
);
|
|
638
630
|
let newData;
|