@lark-apaas/auth-sdk 0.1.0-alpha.4 → 0.1.0-alpha.6

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.
@@ -13,7 +13,7 @@ class PermissionClient {
13
13
  const { timeout = DEFAULT_CONFIG.timeout, headers = {} } = this.config;
14
14
  const { appId } = window;
15
15
  if (!appId) throw new Error('appId is required');
16
- const url = `/app/${appId}/runtime/api/v1/permissions/roles`;
16
+ const url = `/spark/app/${appId}/runtime/api/v1/permissions/roles`;
17
17
  const requestHeaders = {
18
18
  'Content-Type': 'application/json',
19
19
  ...headers
@@ -22,7 +22,7 @@ class PermissionClient {
22
22
  const timeoutId = setTimeout(()=>controller.abort(), timeout);
23
23
  try {
24
24
  const response = await fetch(url, {
25
- method: 'GET',
25
+ method: 'POST',
26
26
  headers: requestHeaders,
27
27
  signal: controller.signal,
28
28
  credentials: 'include'
@@ -31,7 +31,7 @@ class PermissionClient {
31
31
  if (!response.ok) throw new Error(`Permission API returned ${response.status}: ${response.statusText}`);
32
32
  const data = await response.json();
33
33
  return {
34
- roles: data.data?.role_list || [],
34
+ roles: data.data?.roleList || [],
35
35
  fetchedAt: new Date()
36
36
  };
37
37
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/auth-sdk",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.6",
4
4
  "description": "基于 CASL 的前端鉴权 SDK",
5
5
  "types": "./lib/index.d.ts",
6
6
  "main": "./lib/index.js",