jcjy-components 0.1.4 → 0.1.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.
- package/README.md +13 -1
- package/dist/components/auth-gateway/ag-input.vue.d.ts +16 -1
- package/dist/components/auth-gateway/interface.d.ts +52 -0
- package/dist/index.es.js +1596 -1841
- package/dist/index.umd.cjs +1 -14
- package/dist/jcjy-components.css +2 -1
- package/package.json +12 -11
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
|
|
52
|
+
import type { AuthGatewayConfig } from "jcjy-components";
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
## 样式说明
|
|
@@ -77,6 +77,18 @@ import type { AuthGatewayConfig } from "jcjy-components/dist/components/auth-gat
|
|
|
77
77
|
</template>
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
`AuthGatewayConfig` 中与登录页展示相关的行为:
|
|
81
|
+
|
|
82
|
+
- `loginBackground` 传值时,组件按该图片渲染登录页背景;若同时传 `nb: "1"`,则不显示背景图。
|
|
83
|
+
- `loginBackground` 不传或传空字符串时,组件不再使用内置默认图,而是显示内置的侧边宣传文案区。
|
|
84
|
+
- `layout` 仍支持 `default`、`center`、`left`,用于控制认证区在不同布局下的位置。
|
|
85
|
+
|
|
86
|
+
普通账号登录默认展示“记住我”:
|
|
87
|
+
|
|
88
|
+
- 勾选后登录,组件会把账号和原始密码保存到浏览器 `localStorage`,下次进入登录页自动回填。
|
|
89
|
+
- 未勾选登录时,组件会清理已保存的账号和密码。
|
|
90
|
+
- 保存时会对账号和密码做基于 `charCodeAt` 的可逆字符编码混淆,避免在 `localStorage` 中直接显示明文;该方式不等同安全加密,不能抵御同源脚本读取或有代码访问权限的人还原。
|
|
91
|
+
|
|
80
92
|
### 主题工具
|
|
81
93
|
|
|
82
94
|
```ts
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
2
3
|
modelValue: string;
|
|
3
4
|
type?: "text" | "password";
|
|
4
5
|
id?: string;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
autocomplete?: string;
|
|
8
|
+
showPassword?: boolean;
|
|
7
9
|
};
|
|
8
|
-
declare
|
|
10
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
default?: (props: typeof __VLS_1) => any;
|
|
13
|
+
} & {
|
|
14
|
+
suffix?: (props: typeof __VLS_3) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
17
|
"update:modelValue": (value: string) => any;
|
|
10
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
19
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
@@ -14,6 +22,13 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
22
|
id: string;
|
|
15
23
|
placeholder: string;
|
|
16
24
|
autocomplete: string;
|
|
25
|
+
showPassword: boolean;
|
|
17
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
28
|
declare const _default: typeof __VLS_export;
|
|
19
29
|
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -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,68 @@ 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";
|
|
94
|
+
/**
|
|
95
|
+
* 右上角 快捷导航 只有在默认模式时显示
|
|
96
|
+
*/
|
|
97
|
+
links?: {
|
|
98
|
+
url: string;
|
|
99
|
+
name: string;
|
|
100
|
+
}[];
|
|
49
101
|
}
|
|
50
102
|
export declare const DEFAULT_CONFIG: AuthGatewayConfig;
|