beer-assembly-biz 1.1.1-alpha.2 → 1.1.1-alpha.21
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/AppLayout.d.ts +10 -10
- package/AppLayout.js +10 -11
- package/BackPageContainer.d.ts +7 -0
- package/BackPageContainer.js +33 -0
- package/InlineContainer.d.ts +6 -0
- package/InlineContainer.js +28 -0
- package/MediaModals.d.ts +32 -0
- package/MediaModals.js +372 -0
- package/MyPageContainer.d.ts +16 -0
- package/MyPageContainer.js +71 -0
- package/Permission.d.ts +8 -0
- package/Permission.js +7 -0
- package/Upgrade.d.ts +7 -0
- package/Upgrade.js +46 -0
- package/UserModals.js +2 -2
- package/auth/AuthPassword.d.ts +8 -4
- package/auth/AuthPassword.js +25 -11
- package/auth/AuthStyle01.d.ts +23 -6
- package/auth/AuthStyle01.js +10 -6
- package/auth/AuthStyle02.d.ts +23 -6
- package/auth/AuthStyle02.js +10 -6
- package/content/ParentContext.d.ts +8 -0
- package/content/ParentContext.js +9 -0
- package/content/PermissionContext.d.ts +4 -0
- package/content/PermissionContext.js +12 -0
- package/fonts/harmony/HarmonyOS_Medium.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Medium.z.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a0.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.a1.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aa.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ab.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ac.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ad.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ae.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.af.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ag.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ah.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ai.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aj.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ak.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.al.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.am.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.an.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ao.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ap.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aq.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ar.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.as.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.at.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.au.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.av.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.aw.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ax.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.ay.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.az.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.b.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.c.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.d.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.e.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.f.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.g.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.h.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.i.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.j.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.k.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.l.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.m.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.n.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.o.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.p.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.q.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.r.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.s.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.t.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.u.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.v.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.w.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.x.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.y.woff2 +0 -0
- package/fonts/harmony/HarmonyOS_Regular.z.woff2 +0 -0
- package/fonts/harmony/medium.css +485 -0
- package/fonts/harmony/regular.css +485 -0
- package/icon/media.png +0 -0
- package/icon/volc.svg +96 -0
- package/images/assets_background_01.png +0 -0
- package/images/avatar.png +0 -0
- package/images/layout_01.png +0 -0
- package/images/layout_02.png +0 -0
- package/images/layout_03.png +0 -0
- package/package.json +4 -4
- package/fonts/harmony/harmony.txt +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { css } from '@emotion/css';
|
|
3
|
+
import { PageContainer } from '@ant-design/pro-components';
|
|
4
|
+
import { message, Modal, Tabs } from 'antd';
|
|
5
|
+
import { Outlet, useLocation } from 'react-router-dom';
|
|
6
|
+
import ParentContext from './content/ParentContext';
|
|
7
|
+
const pathPartition = (sessionStorage.getItem('DETAIL_PARTITION') || '') === ''
|
|
8
|
+
? ['CREATE', 'EDIT', 'COPY', 'AUDIT', 'PREVIEW', 'DETAIL', 'READ', 'IN', 'INPUT', 'OUTPUT']
|
|
9
|
+
: JSON.parse(sessionStorage.getItem('DETAIL_PARTITION') || '[]');
|
|
10
|
+
export const Component = (props) => {
|
|
11
|
+
const location = useLocation();
|
|
12
|
+
const [messageApi, contextHolder] = message.useMessage();
|
|
13
|
+
const [modal, contextModalHolder] = Modal.useModal();
|
|
14
|
+
const [isSubpage, setIsSubpage] = useState(false);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const partition = pathPartition.find(path => {
|
|
17
|
+
return location.pathname.toUpperCase()
|
|
18
|
+
.indexOf(`/${path}/`) > -1;
|
|
19
|
+
});
|
|
20
|
+
if (partition !== undefined) {
|
|
21
|
+
setIsSubpage(true);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setIsSubpage(false);
|
|
25
|
+
}
|
|
26
|
+
}, [location]);
|
|
27
|
+
return React.createElement(React.Fragment, null,
|
|
28
|
+
React.createElement(ParentContext.Provider, { value: {
|
|
29
|
+
messageApi,
|
|
30
|
+
modal,
|
|
31
|
+
active: () => {
|
|
32
|
+
props?.onRefresh?.();
|
|
33
|
+
}
|
|
34
|
+
} },
|
|
35
|
+
contextHolder,
|
|
36
|
+
contextModalHolder,
|
|
37
|
+
React.createElement(PageContainer, { style: { display: isSubpage ? 'none' : 'block' }, className: css `
|
|
38
|
+
.ant-page-header-heading {
|
|
39
|
+
padding-block-start: 0 !important;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ant-page-header-heading-title {
|
|
43
|
+
font-size: 15px;
|
|
44
|
+
line-height: 1.5;
|
|
45
|
+
color: #333;
|
|
46
|
+
}
|
|
47
|
+
`, header: {
|
|
48
|
+
style: {
|
|
49
|
+
background: '#fff',
|
|
50
|
+
padding: (props?.tabList?.length || 0) <= 0 ? '10px 24px 10px 24px' : '10px 24px 2px 24px',
|
|
51
|
+
borderBottom: (props?.tabList?.length || 0) <= 0 ? '1px solid rgba(0, 0, 0, 0.06)' : undefined
|
|
52
|
+
}
|
|
53
|
+
}, title: props.title, ghost: true, childrenContentStyle: {
|
|
54
|
+
padding: '0'
|
|
55
|
+
} },
|
|
56
|
+
(props?.tabList?.length || 0) > 0 ? React.createElement(React.Fragment, null,
|
|
57
|
+
React.createElement(Tabs, { size: "small", items: props?.tabList, className: css `
|
|
58
|
+
background: #fff;
|
|
59
|
+
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
|
|
60
|
+
|
|
61
|
+
.ant-tabs-nav::before {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
`, tabBarStyle: { margin: '0 24px' }, onChange: (e) => props?.onTabChange?.(e) })) : undefined,
|
|
65
|
+
props?.banner,
|
|
66
|
+
React.createElement("div", { className: css `
|
|
67
|
+
padding: 12px 16px;
|
|
68
|
+
` }, props.children)),
|
|
69
|
+
React.createElement(Outlet, null)));
|
|
70
|
+
};
|
|
71
|
+
export default Component;
|
package/Permission.d.ts
ADDED
package/Permission.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import PermissionContext from './content/PermissionContext';
|
|
3
|
+
export const Component = (props) => {
|
|
4
|
+
const { isPermission } = useContext(PermissionContext);
|
|
5
|
+
return React.createElement(React.Fragment, null, isPermission(props.domain, props.permission) ? props?.children : undefined);
|
|
6
|
+
};
|
|
7
|
+
export default Component;
|
package/Upgrade.d.ts
ADDED
package/Upgrade.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Modal } from 'antd';
|
|
3
|
+
const TIME_KEY = 'VERSION_TIME';
|
|
4
|
+
const App = (props) => {
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
// 每5分钟执行一次
|
|
7
|
+
setTimeout(async () => {
|
|
8
|
+
// 读取缓存的上次弹出更新时间
|
|
9
|
+
const lastTime = Number(localStorage.getItem(TIME_KEY) || 0);
|
|
10
|
+
if (Number.isNaN(lastTime)) {
|
|
11
|
+
localStorage.removeItem(TIME_KEY);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// 30分钟执行一次
|
|
15
|
+
if (new Date().getTime() <= lastTime + 1800000) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
// 更新刷新时间
|
|
19
|
+
localStorage.setItem(TIME_KEY, new Date().getTime()
|
|
20
|
+
.toString());
|
|
21
|
+
const newVersion = await props.request?.();
|
|
22
|
+
if (newVersion === undefined || newVersion === '') {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (newVersion === props.localVersion) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// 弹出提示框
|
|
29
|
+
Modal.confirm({
|
|
30
|
+
title: '版本更新提示',
|
|
31
|
+
content: React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement("p", { style: {
|
|
33
|
+
fontSize: '15px',
|
|
34
|
+
lineHeight: '26px'
|
|
35
|
+
} }, "\u60A8\u5DF2\u7ECF\u957F\u65F6\u95F4\u672A\u4F7F\u7528\u6B64\u9875\u9762\uFF0C\u5728\u6B64\u671F\u95F4\u5E73\u53F0\u6709\u8FC7\u66F4\u65B0\uFF0C\u5982\u60A8\u6B64\u65F6\u5728\u9875\u9762\u4E2D\u6CA1\u6709\u586B\u5199\u76F8\u5173\u4FE1\u606F\u7B49\u64CD\u4F5C\uFF0C\u8BF7\u70B9\u51FB\u5237\u65B0\u9875\u9762\u4F7F\u7528\u6700\u65B0\u7248\u672C\uFF01")),
|
|
36
|
+
okText: '确定',
|
|
37
|
+
cancelText: '取消',
|
|
38
|
+
onOk: () => {
|
|
39
|
+
window.location.reload();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}, 5000);
|
|
43
|
+
}, []);
|
|
44
|
+
return React.createElement(React.Fragment, null);
|
|
45
|
+
};
|
|
46
|
+
export default App;
|
package/UserModals.js
CHANGED
|
@@ -11,7 +11,7 @@ export class UserModals {
|
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
13
|
if (callbackRef.current) {
|
|
14
|
-
if (await callbackRef.current?.(form.
|
|
14
|
+
if (await callbackRef.current?.(form.getFieldValue('password'))) {
|
|
15
15
|
setIsOpenModal(false);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -34,6 +34,6 @@ export class UserModals {
|
|
|
34
34
|
required: true,
|
|
35
35
|
message: '请输入密码'
|
|
36
36
|
}] },
|
|
37
|
-
React.createElement(Input.Password, { placeholder: "\u65B0\u5BC6\u7801" })))))];
|
|
37
|
+
React.createElement(Input.Password, { placeholder: "\u65B0\u5BC6\u7801", autoComplete: "off" })))))];
|
|
38
38
|
}
|
|
39
39
|
}
|
package/auth/AuthPassword.d.ts
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { Slider, SliderCodeToken } from 'beer-assembly/SliderCode';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare type AuthPasswordProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 是否启用企业登录.
|
|
6
|
+
*/
|
|
7
|
+
companyStatus?: boolean;
|
|
4
8
|
/**
|
|
5
9
|
* HTML 协议.
|
|
6
10
|
*/
|
|
7
|
-
protocol
|
|
11
|
+
protocol?: string;
|
|
8
12
|
/**
|
|
9
13
|
* 请求滑块验证码.
|
|
10
14
|
*/
|
|
11
|
-
requestSlider
|
|
15
|
+
requestSlider?: () => Promise<Slider>;
|
|
12
16
|
/**
|
|
13
17
|
* 滑块验证码样式.
|
|
14
18
|
*/
|
|
15
|
-
sliderToken
|
|
19
|
+
sliderToken?: SliderCodeToken;
|
|
16
20
|
/**
|
|
17
21
|
* 登录请求
|
|
18
22
|
* @param code 代码
|
|
19
23
|
* @param slider 滑块
|
|
20
24
|
* @param params 参数
|
|
21
25
|
*/
|
|
22
|
-
requestLogin?: (code: string, slider: Slider, params: {
|
|
26
|
+
requestLogin?: (code: string | undefined, slider: Slider | undefined, params: {
|
|
23
27
|
username: string;
|
|
24
28
|
password: string;
|
|
25
29
|
}) => Promise<boolean>;
|
package/auth/AuthPassword.js
CHANGED
|
@@ -23,10 +23,30 @@ const App = (props) => {
|
|
|
23
23
|
props?.onErrorMessage?.('请输入密码信息');
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
+
// 启动Loading
|
|
26
27
|
setIsLoading(true);
|
|
28
|
+
// 如果不需要滑块验证; 直接登录
|
|
29
|
+
if (props?.requestSlider === undefined) {
|
|
30
|
+
await onConfirmLogin();
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
const onConfirmLogin = async (code, slider) => {
|
|
35
|
+
const params = form.getFieldsValue();
|
|
36
|
+
const func = props?.requestLogin;
|
|
37
|
+
if (func !== undefined) {
|
|
38
|
+
const result = await func(code, slider, params);
|
|
39
|
+
if (!result) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// 如果处理成功, 关闭Loading
|
|
44
|
+
setIsLoading(false);
|
|
27
45
|
return true;
|
|
28
46
|
};
|
|
29
47
|
return React.createElement(Form, { form: form },
|
|
48
|
+
props?.companyStatus ? React.createElement(Form.Item, { name: "companyName", style: { marginBottom: 12 } },
|
|
49
|
+
React.createElement(Input, { className: "companyName", maxLength: 32, placeholder: "\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0", style: { height: 36 } })) : undefined,
|
|
30
50
|
React.createElement(Form.Item, { name: "username", style: { marginBottom: 12 } },
|
|
31
51
|
React.createElement(Input, { className: "input", maxLength: 32, placeholder: "\u8BF7\u8F93\u5165\u8D26\u53F7", style: { height: 36 } })),
|
|
32
52
|
React.createElement(Form.Item, { name: "password", style: { marginBottom: 12 } },
|
|
@@ -37,22 +57,16 @@ const App = (props) => {
|
|
|
37
57
|
} },
|
|
38
58
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: props?.protocol } }))),
|
|
39
59
|
React.createElement(Form.Item, null,
|
|
40
|
-
React.createElement(Dropdown, { placement: "top", arrow: true, destroyPopupOnHide: true, dropdownRender: () => React.createElement(React.Fragment, null,
|
|
60
|
+
props?.requestSlider !== undefined ? React.createElement(Dropdown, { placement: "top", arrow: true, destroyPopupOnHide: true, dropdownRender: () => React.createElement(React.Fragment, null,
|
|
41
61
|
React.createElement("div", { style: {
|
|
42
62
|
width: '250px',
|
|
43
63
|
display: 'block',
|
|
44
64
|
marginLeft: '35px'
|
|
45
65
|
} },
|
|
46
|
-
React.createElement(SliderCode, { request: props?.requestSlider
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (result) {
|
|
51
|
-
setIsLoading(false);
|
|
52
|
-
}
|
|
53
|
-
return result;
|
|
54
|
-
}, token: props?.sliderToken }))), trigger: ['click'], open: isLoading },
|
|
55
|
-
React.createElement("div", null)),
|
|
66
|
+
React.createElement(SliderCode, { request: props?.requestSlider || (async () => {
|
|
67
|
+
return {};
|
|
68
|
+
}), onReceipt: onConfirmLogin, token: props?.sliderToken }))), trigger: ['click'], open: isLoading },
|
|
69
|
+
React.createElement("div", null)) : undefined,
|
|
56
70
|
React.createElement(Button, { type: "primary", className: css `
|
|
57
71
|
width: 100%;
|
|
58
72
|
height: 38px;
|
package/auth/AuthStyle01.d.ts
CHANGED
|
@@ -8,7 +8,16 @@ declare type AuthStyleProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Logo 图片.
|
|
10
10
|
*/
|
|
11
|
-
logo:
|
|
11
|
+
logo: {
|
|
12
|
+
/**
|
|
13
|
+
* 路径
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* 高度
|
|
18
|
+
*/
|
|
19
|
+
height?: number;
|
|
20
|
+
};
|
|
12
21
|
/**
|
|
13
22
|
* 侧边栏图片
|
|
14
23
|
*/
|
|
@@ -16,23 +25,27 @@ declare type AuthStyleProps = {
|
|
|
16
25
|
/**
|
|
17
26
|
* 描述.
|
|
18
27
|
*/
|
|
19
|
-
description
|
|
28
|
+
description?: string;
|
|
20
29
|
/**
|
|
21
30
|
* HTML 协议.
|
|
22
31
|
*/
|
|
23
|
-
protocol
|
|
32
|
+
protocol?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 企业状态.
|
|
35
|
+
*/
|
|
36
|
+
companyStatus?: boolean;
|
|
24
37
|
/**
|
|
25
38
|
* HTML 关于.
|
|
26
39
|
*/
|
|
27
|
-
copyright
|
|
40
|
+
copyright?: string;
|
|
28
41
|
/**
|
|
29
42
|
* 请求滑块验证码.
|
|
30
43
|
*/
|
|
31
|
-
requestSlider
|
|
44
|
+
requestSlider?: () => Promise<Slider>;
|
|
32
45
|
/**
|
|
33
46
|
* 滑块验证码样式.
|
|
34
47
|
*/
|
|
35
|
-
sliderToken
|
|
48
|
+
sliderToken?: SliderCodeToken;
|
|
36
49
|
/**
|
|
37
50
|
* 登录对象.
|
|
38
51
|
* @param params 参数
|
|
@@ -48,6 +61,10 @@ declare type AuthStyleProps = {
|
|
|
48
61
|
code: string;
|
|
49
62
|
data?: {};
|
|
50
63
|
}>;
|
|
64
|
+
/**
|
|
65
|
+
* 登录处理.
|
|
66
|
+
*/
|
|
67
|
+
login?: (userInfo: any) => void;
|
|
51
68
|
};
|
|
52
69
|
declare const App: FC<AuthStyleProps>;
|
|
53
70
|
export default App;
|
package/auth/AuthStyle01.js
CHANGED
|
@@ -11,8 +11,8 @@ const App = (props) => {
|
|
|
11
11
|
const result = await props?.systemLogin?.({
|
|
12
12
|
account: params.username.trim(),
|
|
13
13
|
password: params.password.trim(),
|
|
14
|
-
authCode: slider
|
|
15
|
-
code
|
|
14
|
+
authCode: slider?.authCode || '',
|
|
15
|
+
code: code || ''
|
|
16
16
|
});
|
|
17
17
|
if (result === undefined) {
|
|
18
18
|
setErrorMessage('登录失败,授权没有配置!');
|
|
@@ -20,7 +20,11 @@ const App = (props) => {
|
|
|
20
20
|
}
|
|
21
21
|
if (result.success) {
|
|
22
22
|
setErrorMessage('');
|
|
23
|
-
|
|
23
|
+
if (props?.login === undefined) {
|
|
24
|
+
Session.login(result.data);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
props?.login?.(result.data);
|
|
24
28
|
}
|
|
25
29
|
else {
|
|
26
30
|
// 如果是1201 则是重新加载验证码
|
|
@@ -66,10 +70,10 @@ const App = (props) => {
|
|
|
66
70
|
padding: 30px 40px 0 40px;
|
|
67
71
|
` },
|
|
68
72
|
React.createElement("img", { className: css `
|
|
69
|
-
height:
|
|
73
|
+
height: ${props?.logo?.height || 42}px;
|
|
70
74
|
margin: 0 auto 0 auto;
|
|
71
75
|
display: block;
|
|
72
|
-
`, src: props?.logo, alt: "" }),
|
|
76
|
+
`, src: props?.logo?.path, alt: "" }),
|
|
73
77
|
React.createElement("p", { className: css `
|
|
74
78
|
font-size: 13px;
|
|
75
79
|
margin: 6px auto 10px auto;
|
|
@@ -90,7 +94,7 @@ const App = (props) => {
|
|
|
90
94
|
padding: '6px 10px',
|
|
91
95
|
fontWeight: '500'
|
|
92
96
|
}, message: errorMessage, type: "error", showIcon: true }) : undefined,
|
|
93
|
-
React.createElement(AuthPassword, { protocol: props?.protocol, requestSlider: props?.requestSlider, sliderToken: props?.sliderToken, requestLogin: onConfirmLogin, onErrorMessage: (message) => setErrorMessage(message) }))
|
|
97
|
+
React.createElement(AuthPassword, { companyStatus: props?.companyStatus, protocol: props?.protocol, requestSlider: props?.requestSlider, sliderToken: props?.sliderToken, requestLogin: onConfirmLogin, onErrorMessage: (message) => setErrorMessage(message) }))
|
|
94
98
|
}
|
|
95
99
|
] })),
|
|
96
100
|
React.createElement("p", { className: css `
|
package/auth/AuthStyle02.d.ts
CHANGED
|
@@ -8,27 +8,40 @@ declare type AuthStyleProps = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Logo 图片.
|
|
10
10
|
*/
|
|
11
|
-
logo:
|
|
11
|
+
logo: {
|
|
12
|
+
/**
|
|
13
|
+
* 路径
|
|
14
|
+
*/
|
|
15
|
+
path: string;
|
|
16
|
+
/**
|
|
17
|
+
* 高度
|
|
18
|
+
*/
|
|
19
|
+
height?: number;
|
|
20
|
+
};
|
|
12
21
|
/**
|
|
13
22
|
* 描述.
|
|
14
23
|
*/
|
|
15
|
-
description
|
|
24
|
+
description?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 是否允许企业
|
|
27
|
+
*/
|
|
28
|
+
companyStatus?: boolean;
|
|
16
29
|
/**
|
|
17
30
|
* HTML 协议.
|
|
18
31
|
*/
|
|
19
|
-
protocol
|
|
32
|
+
protocol?: string;
|
|
20
33
|
/**
|
|
21
34
|
* HTML 关于.
|
|
22
35
|
*/
|
|
23
|
-
copyright
|
|
36
|
+
copyright?: string;
|
|
24
37
|
/**
|
|
25
38
|
* 请求滑块验证码.
|
|
26
39
|
*/
|
|
27
|
-
requestSlider
|
|
40
|
+
requestSlider?: () => Promise<Slider>;
|
|
28
41
|
/**
|
|
29
42
|
* 滑块验证码样式.
|
|
30
43
|
*/
|
|
31
|
-
sliderToken
|
|
44
|
+
sliderToken?: SliderCodeToken;
|
|
32
45
|
/**
|
|
33
46
|
* 登录对象.
|
|
34
47
|
* @param params 参数
|
|
@@ -44,6 +57,10 @@ declare type AuthStyleProps = {
|
|
|
44
57
|
code: string;
|
|
45
58
|
data?: {};
|
|
46
59
|
}>;
|
|
60
|
+
/**
|
|
61
|
+
* 登录处理.
|
|
62
|
+
*/
|
|
63
|
+
login?: (userInfo: any) => void;
|
|
47
64
|
};
|
|
48
65
|
declare const App: FC<AuthStyleProps>;
|
|
49
66
|
export default App;
|
package/auth/AuthStyle02.js
CHANGED
|
@@ -11,8 +11,8 @@ const App = (props) => {
|
|
|
11
11
|
const result = await props?.systemLogin?.({
|
|
12
12
|
account: params.username.trim(),
|
|
13
13
|
password: params.password.trim(),
|
|
14
|
-
authCode: slider
|
|
15
|
-
code
|
|
14
|
+
authCode: slider?.authCode || '',
|
|
15
|
+
code: code || ''
|
|
16
16
|
});
|
|
17
17
|
if (result === undefined) {
|
|
18
18
|
setErrorMessage('登录失败,授权没有配置!');
|
|
@@ -20,7 +20,11 @@ const App = (props) => {
|
|
|
20
20
|
}
|
|
21
21
|
if (result.success) {
|
|
22
22
|
setErrorMessage('');
|
|
23
|
-
|
|
23
|
+
if (props?.login === undefined) {
|
|
24
|
+
Session.login(result.data);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
props?.login?.(result.data);
|
|
24
28
|
}
|
|
25
29
|
else {
|
|
26
30
|
// 如果是1201 则是重新加载验证码
|
|
@@ -59,10 +63,10 @@ const App = (props) => {
|
|
|
59
63
|
padding: 30px 40px 0 40px;
|
|
60
64
|
` },
|
|
61
65
|
React.createElement("img", { className: css `
|
|
62
|
-
height:
|
|
66
|
+
height: ${props?.logo?.height || 42}px;
|
|
63
67
|
margin: 0 auto 0 auto;
|
|
64
68
|
display: block;
|
|
65
|
-
`, src: props
|
|
69
|
+
`, src: props?.logo?.path, alt: "" }),
|
|
66
70
|
React.createElement("p", { className: css `
|
|
67
71
|
font-size: 13px;
|
|
68
72
|
margin: 6px auto 10px auto;
|
|
@@ -83,7 +87,7 @@ const App = (props) => {
|
|
|
83
87
|
padding: '6px 10px',
|
|
84
88
|
fontWeight: '500'
|
|
85
89
|
}, message: errorMessage, type: "error", showIcon: true }) : undefined,
|
|
86
|
-
React.createElement(AuthPassword, { protocol: props?.protocol, requestSlider: props?.requestSlider, sliderToken: props?.sliderToken, requestLogin: onConfirmLogin, onErrorMessage: (message) => setErrorMessage(message) }))
|
|
90
|
+
React.createElement(AuthPassword, { companyStatus: props?.companyStatus, protocol: props?.protocol, requestSlider: props?.requestSlider, sliderToken: props?.sliderToken, requestLogin: onConfirmLogin, onErrorMessage: (message) => setErrorMessage(message) }))
|
|
87
91
|
}
|
|
88
92
|
] })),
|
|
89
93
|
React.createElement("p", { className: css `
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MessageInstance } from 'antd/es/message/interface';
|
|
2
|
+
import type { HookAPI } from 'antd/es/modal/useModal';
|
|
3
|
+
declare const ParentContext: import("react").Context<{
|
|
4
|
+
messageApi: MessageInstance | undefined;
|
|
5
|
+
modal: HookAPI | undefined;
|
|
6
|
+
active: () => void;
|
|
7
|
+
}>;
|
|
8
|
+
export default ParentContext;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
const PermissionContext = createContext({
|
|
3
|
+
isPermission: (domain, permission) => {
|
|
4
|
+
console.log('parent context' + domain);
|
|
5
|
+
console.log('parent context' + permission);
|
|
6
|
+
if (!permission) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export default PermissionContext;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|