jcjy-components 0.1.4 → 0.1.5

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 CHANGED
@@ -49,7 +49,7 @@ export default {
49
49
  本库已内置类型声明,TS 项目可直接获得类型提示。
50
50
 
51
51
  ```ts
52
- import type { AuthGatewayConfig } from "jcjy-components/dist/components/auth-gateway/interface";
52
+ import type { AuthGatewayConfig } from "jcjy-components";
53
53
  ```
54
54
 
55
55
  ## 样式说明
@@ -6,8 +6,11 @@ export declare const TabKey: {
6
6
  };
7
7
  export type TabKey = (typeof TabKey)[keyof typeof TabKey];
8
8
  export interface AuthGatewayProps {
9
+ /** 网关配置项(标题、背景、布局等) */
9
10
  config: AuthGatewayConfig;
11
+ /** 是否启用严格注册规则(密码复杂度等) */
10
12
  strictRegister?: boolean;
13
+ /** 身份绑定回调(绑定学校/姓名/学号) */
11
14
  binding: (v: {
12
15
  orgName: string;
13
16
  name: string;
@@ -15,11 +18,13 @@ export interface AuthGatewayProps {
15
18
  }, headers: {
16
19
  token: string;
17
20
  }) => Promise<any>;
21
+ /** 账号注册回调 */
18
22
  register: (params: {
19
23
  userName: string;
20
24
  passwd: string;
21
25
  weChatOpenId?: string;
22
26
  }) => Promise<any>;
27
+ /** 登录回调(支持账号或微信) */
23
28
  login: (params: {
24
29
  weChatCode?: string;
25
30
  userName?: string;
@@ -30,21 +35,61 @@ export interface AuthGatewayProps {
30
35
  msg: string;
31
36
  weChatUserDetail: any;
32
37
  } | any>;
38
+ /** 微信登录配置(扫码 appId 与回调地址) */
33
39
  wechatConfig?: {
40
+ /** 微信开放平台应用 appId */
34
41
  appId: string;
42
+ /** 扫码后回调地址 */
35
43
  redirectUrl: string;
36
44
  };
37
45
  }
46
+ /** AuthGateway 组件配置 */
38
47
  export interface AuthGatewayConfig {
48
+ /** 登录页标题 */
39
49
  title?: string;
50
+ /** 网站图标 URL */
40
51
  favicon?: string;
52
+ /** 登录页背景图 URL */
41
53
  loginBackground?: string;
54
+ /**
55
+ * 是否跳过身份绑定
56
+ * - "0": 需要绑定(默认)
57
+ * - "1": 跳过绑定
58
+ */
42
59
  skipBind?: "0" | "1";
60
+ /**
61
+ * 是否隐藏页脚
62
+ * - "0": 显示(默认)
63
+ * - "1": 隐藏
64
+ */
43
65
  hf?: "0" | "1";
66
+ /**
67
+ * 是否隐藏背景图
68
+ * - "0": 显示背景(默认)
69
+ * - "1": 隐藏背景
70
+ */
44
71
  nb?: "0" | "1";
72
+ /** 自定义页脚 HTML 文本 */
45
73
  cf?: string;
74
+ /**
75
+ * 来源标记
76
+ * - "inline": 内嵌模式(不自动跳转)
77
+ */
46
78
  from?: "inline";
79
+ /** 是否隐藏微信登录入口(有值即隐藏) */
47
80
  hideWx?: string;
81
+ /**
82
+ * 登录卡片布局
83
+ * - "default": 右侧(桌面)/居中(移动)
84
+ * - "center": 始终居中
85
+ * - "left": 左侧(桌面)/居中(移动)
86
+ */
48
87
  layout?: "default" | "center" | "left";
88
+ /**
89
+ * 是否隐藏注册入口
90
+ * - "0": 显示(默认)
91
+ * - "1": 隐藏
92
+ */
93
+ hideRegister?: "0" | "1";
49
94
  }
50
95
  export declare const DEFAULT_CONFIG: AuthGatewayConfig;