openxiangda 1.0.85 → 1.0.87
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/README.md +28 -0
- package/lib/cli.js +482 -10
- package/openxiangda-skills/SKILL.md +5 -1
- package/openxiangda-skills/references/architecture-design.md +29 -0
- package/openxiangda-skills/references/openxiangda-api.md +105 -3
- package/openxiangda-skills/references/pages/page-sdk.md +35 -0
- package/openxiangda-skills/references/permissions-settings.md +39 -2
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +70 -4
- package/package.json +2 -1
- package/packages/sdk/dist/runtime/index.cjs +3590 -3388
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +4 -1001
- package/packages/sdk/dist/runtime/index.d.ts +4 -1001
- package/packages/sdk/dist/runtime/index.mjs +3049 -2849
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/react.cjs +2793 -116
- package/packages/sdk/dist/runtime/react.cjs.map +1 -1
- package/packages/sdk/dist/runtime/react.d.mts +1394 -2
- package/packages/sdk/dist/runtime/react.d.ts +1394 -2
- package/packages/sdk/dist/runtime/react.mjs +2749 -84
- package/packages/sdk/dist/runtime/react.mjs.map +1 -1
- package/templates/openxiangda-react-spa/AGENTS.md +29 -0
- package/templates/openxiangda-react-spa/src/app/router.tsx +21 -1
- package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +15 -0
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +8 -0
- package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +14 -0
- package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +8 -0
- package/templates/openxiangda-react-spa/tsconfig.app.json +1 -1
- package/templates/openxiangda-react-spa/vite.config.ts +1 -1
- package/packages/sdk/dist/openxiangdaProvider-CaXMpsnK.d.mts +0 -328
- package/packages/sdk/dist/openxiangdaProvider-CaXMpsnK.d.ts +0 -328
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- 菜单和首页文案优先改 `src/app/navigation.ts`、`src/app/starter-content.ts` 与 `src/pages/admin/AdminDashboardPage.tsx`。
|
|
12
12
|
- 页面、表单、字段、数据范围、流程动作、文件、连接器权限以后端接口为准;前端只做展示保护和清晰状态页。
|
|
13
13
|
- 本地开发通过 Vite `/service` 代理远端平台,保持 HttpOnly Cookie 同域访问。
|
|
14
|
+
- 新公开访问页使用 `/view/:appType/public/*`、`src/resources/routes/`、`src/resources/public-access/` 和 `PublicAccessGate`。不要使用旧 `?publicAccess=guest`。
|
|
14
15
|
|
|
15
16
|
## 常用命令
|
|
16
17
|
|
|
@@ -69,6 +70,34 @@ import { PermissionBoundary, useAppMenus, useRuntimeBootstrap } from "openxiangd
|
|
|
69
70
|
|
|
70
71
|
`PermissionBoundary` 只能做展示保护,不能替代后端权限。后端返回 401 时跳登录,403 时展示无权限状态。
|
|
71
72
|
|
|
73
|
+
公开页面需要同时声明 route 和 public access policy:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"code": "public.register",
|
|
78
|
+
"pathPattern": "/view/:appType/public/register",
|
|
79
|
+
"publicAccess": "guest",
|
|
80
|
+
"publicPolicyCode": "public_register"
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"code": "public_register",
|
|
87
|
+
"mode": "guest",
|
|
88
|
+
"routeCode": "public.register",
|
|
89
|
+
"externalRoleCodes": ["external_visitor"],
|
|
90
|
+
"grants": {
|
|
91
|
+
"forms": [],
|
|
92
|
+
"dataViews": [],
|
|
93
|
+
"functions": [],
|
|
94
|
+
"connectors": []
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
表单、dataView、function、connector 没有被 policy `grants` 显式列出时,公开 guest 默认无权访问。需要数据访问时,把同一个外部角色码加入对应后端权限组。
|
|
100
|
+
|
|
72
101
|
## 默认页与覆盖
|
|
73
102
|
|
|
74
103
|
- 表单提交:`/view/:appType/admin/forms/:formUuid/new`
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
} from "react-router-dom";
|
|
7
7
|
import { lazy, Suspense, type ReactNode } from "react";
|
|
8
8
|
import { Sparkles } from "lucide-react";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
LoginPage,
|
|
11
|
+
OpenXiangdaProvider,
|
|
12
|
+
PublicAccessGate,
|
|
13
|
+
} from "openxiangda/runtime/react";
|
|
10
14
|
|
|
11
15
|
import { AdminShell } from "@/layouts/AdminShell";
|
|
12
16
|
import { AdminDashboardPage } from "@/pages/admin/AdminDashboardPage";
|
|
@@ -29,6 +33,11 @@ const FormRoutePage = lazy(() =>
|
|
|
29
33
|
default: module.FormRoutePage,
|
|
30
34
|
})),
|
|
31
35
|
);
|
|
36
|
+
const PublicRegisterPage = lazy(() =>
|
|
37
|
+
import("@/pages/public/PublicRegisterPage").then(module => ({
|
|
38
|
+
default: module.PublicRegisterPage,
|
|
39
|
+
})),
|
|
40
|
+
);
|
|
32
41
|
|
|
33
42
|
const routeElement = (element: ReactNode) => (
|
|
34
43
|
<Suspense
|
|
@@ -70,6 +79,17 @@ export const router = createBrowserRouter([
|
|
|
70
79
|
children: [
|
|
71
80
|
{ index: true, element: <Navigate to="admin" replace /> },
|
|
72
81
|
{ path: "login", element: <LoginPage /> },
|
|
82
|
+
{
|
|
83
|
+
path: "public/register",
|
|
84
|
+
element: routeElement(
|
|
85
|
+
<PublicAccessGate
|
|
86
|
+
policyCode="public_register"
|
|
87
|
+
routeCode="public.register"
|
|
88
|
+
>
|
|
89
|
+
<PublicRegisterPage />
|
|
90
|
+
</PublicAccessGate>,
|
|
91
|
+
),
|
|
92
|
+
},
|
|
73
93
|
{
|
|
74
94
|
path: "admin",
|
|
75
95
|
element: <AdminShell />,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ClipboardList } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { StatePage } from "@/shared/ui";
|
|
4
|
+
|
|
5
|
+
export function PublicRegisterPage() {
|
|
6
|
+
return (
|
|
7
|
+
<StatePage
|
|
8
|
+
description="请填写报名信息并关注后续通知。"
|
|
9
|
+
fullScreen
|
|
10
|
+
icon={<ClipboardList size={24} />}
|
|
11
|
+
status="PUBLIC"
|
|
12
|
+
title="公开报名"
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"code": "public_register",
|
|
3
|
+
"name": "公开报名入口",
|
|
4
|
+
"mode": "guest",
|
|
5
|
+
"routeCode": "public.register",
|
|
6
|
+
"pathPattern": "/view/:appType/public/register",
|
|
7
|
+
"externalRoleCodes": ["external_visitor"],
|
|
8
|
+
"grants": {
|
|
9
|
+
"forms": [],
|
|
10
|
+
"dataViews": [],
|
|
11
|
+
"functions": [],
|
|
12
|
+
"connectors": []
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -27,7 +27,7 @@ const localSdkAliases = existsSync(localSdkRoot)
|
|
|
27
27
|
find: "openxiangda/runtime/react",
|
|
28
28
|
replacement: fileURLToPath(
|
|
29
29
|
new URL(
|
|
30
|
-
"../../packages/sdk/src/runtime/react/
|
|
30
|
+
"../../packages/sdk/src/runtime/react/index.ts",
|
|
31
31
|
import.meta.url,
|
|
32
32
|
),
|
|
33
33
|
),
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import React__default, { CSSProperties } from 'react';
|
|
2
|
-
|
|
3
|
-
type AuthMethodType = "password" | "dingtalk" | "sso" | "guest" | "phone_code" | string;
|
|
4
|
-
interface AuthMethod {
|
|
5
|
-
type: AuthMethodType;
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
label?: string;
|
|
8
|
-
protocol?: string;
|
|
9
|
-
[key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
interface LoginMethodsResult {
|
|
12
|
-
appType: string;
|
|
13
|
-
configCode?: string;
|
|
14
|
-
methods: AuthMethod[];
|
|
15
|
-
registration?: {
|
|
16
|
-
mode?: string;
|
|
17
|
-
[key: string]: unknown;
|
|
18
|
-
};
|
|
19
|
-
security?: {
|
|
20
|
-
hideFailureReason?: boolean;
|
|
21
|
-
[key: string]: unknown;
|
|
22
|
-
};
|
|
23
|
-
defaultRedirectUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
interface AuthUser {
|
|
26
|
-
id: string;
|
|
27
|
-
username?: string;
|
|
28
|
-
name?: string;
|
|
29
|
-
phone?: string | null;
|
|
30
|
-
email?: string | null;
|
|
31
|
-
avatar?: string | null;
|
|
32
|
-
jobNumber?: string | null;
|
|
33
|
-
departments?: Array<Record<string, unknown>>;
|
|
34
|
-
affiliatedDepartmentId?: string | null;
|
|
35
|
-
affiliatedDepartment?: Record<string, unknown> | null;
|
|
36
|
-
[key: string]: unknown;
|
|
37
|
-
}
|
|
38
|
-
interface AuthTokenData {
|
|
39
|
-
accessToken: string;
|
|
40
|
-
refreshToken: string;
|
|
41
|
-
token?: string;
|
|
42
|
-
accessTokenExpiresAt?: number;
|
|
43
|
-
refreshTokenExpiresAt?: number;
|
|
44
|
-
user?: AuthUser;
|
|
45
|
-
guestUser?: AuthUser;
|
|
46
|
-
[key: string]: unknown;
|
|
47
|
-
}
|
|
48
|
-
interface PhoneCodeSendResult {
|
|
49
|
-
challengeId: string;
|
|
50
|
-
expiresAt?: string | Date;
|
|
51
|
-
ttlSeconds?: number;
|
|
52
|
-
message?: string;
|
|
53
|
-
}
|
|
54
|
-
interface SsoLoginUrlResult {
|
|
55
|
-
loginUrl: string;
|
|
56
|
-
protocol?: string;
|
|
57
|
-
}
|
|
58
|
-
interface AuthClientOptions {
|
|
59
|
-
appType: string;
|
|
60
|
-
servicePrefix?: string;
|
|
61
|
-
fetchImpl?: typeof fetch;
|
|
62
|
-
}
|
|
63
|
-
interface PasswordLoginInput {
|
|
64
|
-
username: string;
|
|
65
|
-
password: string;
|
|
66
|
-
clientFingerprint?: string;
|
|
67
|
-
challengeId?: string;
|
|
68
|
-
challengeAnswer?: string;
|
|
69
|
-
}
|
|
70
|
-
interface DingTalkLoginInput {
|
|
71
|
-
code: string;
|
|
72
|
-
corpId?: string;
|
|
73
|
-
}
|
|
74
|
-
interface GuestLoginInput {
|
|
75
|
-
guestIdentifier?: string;
|
|
76
|
-
domain?: string;
|
|
77
|
-
ipAddress?: string;
|
|
78
|
-
userAgent?: string;
|
|
79
|
-
formUuid?: string;
|
|
80
|
-
}
|
|
81
|
-
interface PhoneCodeInput {
|
|
82
|
-
phone: string;
|
|
83
|
-
purpose?: "login" | "register" | string;
|
|
84
|
-
}
|
|
85
|
-
interface PhoneCodeLoginInput {
|
|
86
|
-
phone: string;
|
|
87
|
-
code: string;
|
|
88
|
-
challengeId?: string;
|
|
89
|
-
}
|
|
90
|
-
interface PhoneCodeRegisterInput extends PhoneCodeLoginInput {
|
|
91
|
-
name?: string;
|
|
92
|
-
email?: string;
|
|
93
|
-
}
|
|
94
|
-
interface SsoLoginUrlInput {
|
|
95
|
-
protocol?: string;
|
|
96
|
-
redirectUri?: string;
|
|
97
|
-
}
|
|
98
|
-
interface RefreshInput {
|
|
99
|
-
refreshToken?: string;
|
|
100
|
-
}
|
|
101
|
-
interface ResolveLoginUrlInput {
|
|
102
|
-
callbackUrl?: string;
|
|
103
|
-
callbackParamName?: string;
|
|
104
|
-
loginUrl?: string;
|
|
105
|
-
}
|
|
106
|
-
interface AppAuthClient {
|
|
107
|
-
appType: string;
|
|
108
|
-
servicePrefix: string;
|
|
109
|
-
getMethods: () => Promise<LoginMethodsResult>;
|
|
110
|
-
passwordLogin: (input: PasswordLoginInput) => Promise<AuthTokenData>;
|
|
111
|
-
dingtalkLogin: (input: DingTalkLoginInput) => Promise<AuthTokenData>;
|
|
112
|
-
guestLogin: (input?: GuestLoginInput) => Promise<AuthTokenData>;
|
|
113
|
-
sendPhoneCode: (input: PhoneCodeInput) => Promise<PhoneCodeSendResult>;
|
|
114
|
-
phoneCodeLogin: (input: PhoneCodeLoginInput) => Promise<AuthTokenData>;
|
|
115
|
-
registerWithPhoneCode: (input: PhoneCodeRegisterInput) => Promise<AuthTokenData>;
|
|
116
|
-
getSsoLoginUrl: (input?: SsoLoginUrlInput) => Promise<SsoLoginUrlResult>;
|
|
117
|
-
refresh: (input?: RefreshInput) => Promise<AuthTokenData>;
|
|
118
|
-
logout: () => Promise<void>;
|
|
119
|
-
resolveLoginUrl: (input?: ResolveLoginUrlInput) => string;
|
|
120
|
-
}
|
|
121
|
-
declare class AuthClientError extends Error {
|
|
122
|
-
status?: number;
|
|
123
|
-
code?: number | string;
|
|
124
|
-
payload?: unknown;
|
|
125
|
-
constructor(message: string, options?: {
|
|
126
|
-
status?: number;
|
|
127
|
-
code?: number | string;
|
|
128
|
-
payload?: unknown;
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
declare const createAuthClient: ({ appType, servicePrefix, fetchImpl, }: AuthClientOptions) => AppAuthClient;
|
|
132
|
-
|
|
133
|
-
interface UseAuthOptions extends Partial<AuthClientOptions> {
|
|
134
|
-
}
|
|
135
|
-
interface UseLoginMethodsState {
|
|
136
|
-
data: LoginMethodsResult | null;
|
|
137
|
-
methods: AuthMethod[];
|
|
138
|
-
loading: boolean;
|
|
139
|
-
error: Error | null;
|
|
140
|
-
reload: () => Promise<void>;
|
|
141
|
-
}
|
|
142
|
-
interface LoginPageProps extends UseAuthOptions {
|
|
143
|
-
title?: React__default.ReactNode;
|
|
144
|
-
subtitle?: React__default.ReactNode;
|
|
145
|
-
className?: string;
|
|
146
|
-
style?: CSSProperties;
|
|
147
|
-
defaultMethod?: "password" | "phone_code";
|
|
148
|
-
redirectUrl?: string;
|
|
149
|
-
redirectOnSuccess?: boolean;
|
|
150
|
-
onSuccess?: (data: AuthTokenData) => void | Promise<void>;
|
|
151
|
-
}
|
|
152
|
-
declare const useAuth: (options?: UseAuthOptions) => {
|
|
153
|
-
client: AppAuthClient;
|
|
154
|
-
getMethods: () => Promise<LoginMethodsResult>;
|
|
155
|
-
passwordLogin: (input: PasswordLoginInput) => Promise<AuthTokenData>;
|
|
156
|
-
dingtalkLogin: (input: DingTalkLoginInput) => Promise<AuthTokenData>;
|
|
157
|
-
guestLogin: (input?: GuestLoginInput) => Promise<AuthTokenData>;
|
|
158
|
-
sendPhoneCode: (input: PhoneCodeInput) => Promise<PhoneCodeSendResult>;
|
|
159
|
-
phoneCodeLogin: (input: PhoneCodeLoginInput) => Promise<AuthTokenData>;
|
|
160
|
-
registerWithPhoneCode: (input: PhoneCodeRegisterInput) => Promise<AuthTokenData>;
|
|
161
|
-
getSsoLoginUrl: (input?: SsoLoginUrlInput) => Promise<SsoLoginUrlResult>;
|
|
162
|
-
refresh: (input?: RefreshInput) => Promise<AuthTokenData>;
|
|
163
|
-
logout: () => Promise<void>;
|
|
164
|
-
resolveLoginUrl: (input?: ResolveLoginUrlInput) => string;
|
|
165
|
-
};
|
|
166
|
-
declare const useLoginMethods: (options?: UseAuthOptions) => UseLoginMethodsState;
|
|
167
|
-
declare const LoginPage: React__default.FC<LoginPageProps>;
|
|
168
|
-
|
|
169
|
-
type RuntimeErrorType = "unauthenticated" | "forbidden" | "network" | "unknown";
|
|
170
|
-
type RuntimeRequestError = Error & {
|
|
171
|
-
type?: RuntimeErrorType;
|
|
172
|
-
status?: number;
|
|
173
|
-
code?: number | string;
|
|
174
|
-
payload?: unknown;
|
|
175
|
-
};
|
|
176
|
-
interface RuntimeErrorSnapshot {
|
|
177
|
-
type: RuntimeErrorType;
|
|
178
|
-
status?: number;
|
|
179
|
-
code?: number | string;
|
|
180
|
-
message: string;
|
|
181
|
-
payload?: unknown;
|
|
182
|
-
}
|
|
183
|
-
declare class RuntimeHttpError extends Error {
|
|
184
|
-
type: RuntimeErrorType;
|
|
185
|
-
status?: number;
|
|
186
|
-
code?: number | string;
|
|
187
|
-
payload?: unknown;
|
|
188
|
-
constructor(snapshot: RuntimeErrorSnapshot);
|
|
189
|
-
}
|
|
190
|
-
interface RuntimeMenuItem {
|
|
191
|
-
id: string;
|
|
192
|
-
name: string;
|
|
193
|
-
resourceCode?: string | null;
|
|
194
|
-
routeCode?: string | null;
|
|
195
|
-
path?: string | null;
|
|
196
|
-
type?: string;
|
|
197
|
-
formUuid?: string | null;
|
|
198
|
-
pageId?: string | null;
|
|
199
|
-
parentId?: string | null;
|
|
200
|
-
sortOrder?: number;
|
|
201
|
-
isHidden?: boolean;
|
|
202
|
-
icon?: string | null;
|
|
203
|
-
children?: RuntimeMenuItem[];
|
|
204
|
-
[key: string]: unknown;
|
|
205
|
-
}
|
|
206
|
-
interface RuntimePagePermissions {
|
|
207
|
-
appType: string;
|
|
208
|
-
hasFullAccess: boolean;
|
|
209
|
-
roleCodes: string[];
|
|
210
|
-
roleSource?: string;
|
|
211
|
-
menuFormUuids: string[];
|
|
212
|
-
menuCodes: string[];
|
|
213
|
-
routeCodes: string[];
|
|
214
|
-
pathPatterns: string[];
|
|
215
|
-
}
|
|
216
|
-
interface RuntimeBootstrap {
|
|
217
|
-
appType: string;
|
|
218
|
-
app?: Record<string, unknown> | null;
|
|
219
|
-
user?: Record<string, unknown> | null;
|
|
220
|
-
runtime?: {
|
|
221
|
-
mode?: "legacy" | "react-spa" | string;
|
|
222
|
-
settings?: Record<string, unknown>;
|
|
223
|
-
activeReleaseId?: string | null;
|
|
224
|
-
activeBuildId?: string | null;
|
|
225
|
-
indexUrl?: string | null;
|
|
226
|
-
assetBaseUrl?: string | null;
|
|
227
|
-
};
|
|
228
|
-
permissions?: RuntimePagePermissions;
|
|
229
|
-
menus?: RuntimeMenuItem[];
|
|
230
|
-
servicePrefix?: string;
|
|
231
|
-
}
|
|
232
|
-
interface RouteAccessResult {
|
|
233
|
-
appType: string;
|
|
234
|
-
canAccess: boolean;
|
|
235
|
-
routeCode?: string;
|
|
236
|
-
menuCode?: string;
|
|
237
|
-
path?: string;
|
|
238
|
-
status?: number;
|
|
239
|
-
code?: number | string;
|
|
240
|
-
message?: string;
|
|
241
|
-
errorType?: RuntimeErrorType;
|
|
242
|
-
payload?: unknown;
|
|
243
|
-
permissions?: RuntimePagePermissions;
|
|
244
|
-
}
|
|
245
|
-
interface RuntimeRequestState<T> {
|
|
246
|
-
data: T | null;
|
|
247
|
-
loading: boolean;
|
|
248
|
-
error: RuntimeRequestError | null;
|
|
249
|
-
}
|
|
250
|
-
interface OpenXiangdaProviderProps {
|
|
251
|
-
appType?: string;
|
|
252
|
-
servicePrefix?: string;
|
|
253
|
-
fetchImpl?: typeof fetch;
|
|
254
|
-
children: React__default.ReactNode;
|
|
255
|
-
}
|
|
256
|
-
interface OpenXiangdaRuntimeStore extends RuntimeRequestState<RuntimeBootstrap> {
|
|
257
|
-
appType: string;
|
|
258
|
-
servicePrefix: string;
|
|
259
|
-
fetchImpl: typeof fetch;
|
|
260
|
-
reload: () => Promise<void>;
|
|
261
|
-
}
|
|
262
|
-
declare const OpenXiangdaProvider: React__default.FC<OpenXiangdaProviderProps>;
|
|
263
|
-
declare const useOpenXiangda: () => OpenXiangdaRuntimeStore;
|
|
264
|
-
declare const useRuntimeBootstrap: () => OpenXiangdaRuntimeStore;
|
|
265
|
-
declare const useAppMenus: () => {
|
|
266
|
-
data: RuntimeMenuItem[];
|
|
267
|
-
appType: string;
|
|
268
|
-
servicePrefix: string;
|
|
269
|
-
fetchImpl: typeof fetch;
|
|
270
|
-
reload: () => Promise<void>;
|
|
271
|
-
loading: boolean;
|
|
272
|
-
error: RuntimeRequestError | null;
|
|
273
|
-
};
|
|
274
|
-
declare const usePermission: () => {
|
|
275
|
-
data: RuntimePagePermissions | null;
|
|
276
|
-
appType: string;
|
|
277
|
-
servicePrefix: string;
|
|
278
|
-
fetchImpl: typeof fetch;
|
|
279
|
-
reload: () => Promise<void>;
|
|
280
|
-
loading: boolean;
|
|
281
|
-
error: RuntimeRequestError | null;
|
|
282
|
-
};
|
|
283
|
-
interface UseCanAccessRouteInput {
|
|
284
|
-
routeCode?: string;
|
|
285
|
-
menuCode?: string;
|
|
286
|
-
path?: string;
|
|
287
|
-
}
|
|
288
|
-
declare const useCanAccessRoute: (input: UseCanAccessRouteInput) => {
|
|
289
|
-
canAccess: boolean;
|
|
290
|
-
data: RouteAccessResult | null;
|
|
291
|
-
loading: boolean;
|
|
292
|
-
error: RuntimeRequestError | null;
|
|
293
|
-
};
|
|
294
|
-
interface PermissionBoundaryProps extends UseCanAccessRouteInput {
|
|
295
|
-
children: React__default.ReactNode;
|
|
296
|
-
fallback?: React__default.ReactNode | PermissionBoundaryFallback;
|
|
297
|
-
loadingFallback?: React__default.ReactNode | PermissionBoundaryFallback;
|
|
298
|
-
}
|
|
299
|
-
interface PermissionBoundaryFallbackState {
|
|
300
|
-
access: ReturnType<typeof useCanAccessRoute>;
|
|
301
|
-
runtime: ReturnType<typeof useOpenXiangda>;
|
|
302
|
-
error: RuntimeRequestError | null;
|
|
303
|
-
errorType: RuntimeErrorType;
|
|
304
|
-
status?: number;
|
|
305
|
-
code?: number | string;
|
|
306
|
-
message: string;
|
|
307
|
-
}
|
|
308
|
-
type PermissionBoundaryFallback = (state: PermissionBoundaryFallbackState) => React__default.ReactNode;
|
|
309
|
-
declare const PermissionBoundary: React__default.FC<PermissionBoundaryProps>;
|
|
310
|
-
interface RuntimeResolveLoginOptions {
|
|
311
|
-
redirectUri?: string;
|
|
312
|
-
loginUrl?: string;
|
|
313
|
-
domain?: string;
|
|
314
|
-
}
|
|
315
|
-
interface RuntimeRedirectLoginOptions extends RuntimeResolveLoginOptions {
|
|
316
|
-
replace?: boolean;
|
|
317
|
-
}
|
|
318
|
-
interface RuntimeLogoutOptions extends RuntimeRedirectLoginOptions {
|
|
319
|
-
continueOnError?: boolean;
|
|
320
|
-
}
|
|
321
|
-
declare const useRuntimeAuth: () => {
|
|
322
|
-
logout: () => Promise<any>;
|
|
323
|
-
logoutAndRedirect: (options?: RuntimeLogoutOptions) => Promise<string>;
|
|
324
|
-
redirectToLogin: (options?: RuntimeRedirectLoginOptions) => Promise<string>;
|
|
325
|
-
resolveLoginUrl: (options?: RuntimeResolveLoginOptions) => Promise<string>;
|
|
326
|
-
};
|
|
327
|
-
|
|
328
|
-
export { type AppAuthClient as A, type RuntimeRedirectLoginOptions as B, type RuntimeRequestError as C, type DingTalkLoginInput as D, type RuntimeRequestState as E, type RuntimeResolveLoginOptions as F, type GuestLoginInput as G, type SsoLoginUrlResult as H, type UseCanAccessRouteInput as I, type UseLoginMethodsState as J, createAuthClient as K, type LoginMethodsResult as L, useAppMenus as M, useAuth as N, OpenXiangdaProvider as O, type PasswordLoginInput as P, useCanAccessRoute as Q, type RefreshInput as R, type SsoLoginUrlInput as S, useLoginMethods as T, type UseAuthOptions as U, useOpenXiangda as V, usePermission as W, useRuntimeAuth as X, useRuntimeBootstrap as Y, AuthClientError as a, type AuthClientOptions as b, type AuthMethod as c, type AuthMethodType as d, type AuthTokenData as e, type AuthUser as f, LoginPage as g, type LoginPageProps as h, type OpenXiangdaProviderProps as i, PermissionBoundary as j, type PermissionBoundaryFallback as k, type PermissionBoundaryFallbackState as l, type PermissionBoundaryProps as m, type PhoneCodeInput as n, type PhoneCodeLoginInput as o, type PhoneCodeRegisterInput as p, type PhoneCodeSendResult as q, type ResolveLoginUrlInput as r, type RouteAccessResult as s, type RuntimeBootstrap as t, type RuntimeErrorSnapshot as u, type RuntimeErrorType as v, RuntimeHttpError as w, type RuntimeLogoutOptions as x, type RuntimeMenuItem as y, type RuntimePagePermissions as z };
|